Source for file Ruleelement.php
Documentation is available at Ruleelement.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
* @author Greg Swindle <greg@swindle.net>
* Represents an element of a Rule or RuleContext.
* The name of the RuleElement.
* Constructor initializes {@link $name}.
* Constructor initializes {@link $name}.
* Returns the type of RuleElement.
* Returns the name of the RuleElement.
* Represents a Boolean operator or a quantifier operator.
* The name of the RuleElement.
* Constructor initializes {@link $name}, i.e., the operator.
$this->operators =
array( "AND", "OR", "NOT", "XOR", "EQUALTO", "NOTEQUALTO", "LESSTHAN", "GREATERTHAN", "LESSTHANOREQUALTO", "GREATERTHANOREQUALTO" );
if( in_array( $operator, $this->operators ) ) {
parent::Operator( $operator );
throw
new Exception( $operator .
" is not a valid operator." );
* Constructor initializes {@link $name}, i.e., the operator.
$this->operators =
array( "AND", "OR", "NOT", "XOR", "EQUALTO", "NOTEQUALTO", "LESSTHAN", "GREATERTHAN", "LESSTHANOREQUALTO", "GREATERTHANOREQUALTO" );
if( in_array( $operator, $this->operators ) ) {
throw
new Exception( $operator .
" is not a valid operator." );
* Represents a Proposition in formal logic, a statement with at truth value.
* The Boolean truth value of the Proposition.
* Constructor initializes {@link $name}, and the {@link $value}.
$this->value =
$truthValue;
* Constructor initializes {@link $name}, and the {@link $value}.
$this->value =
$truthValue;
* Returns "Proposition."
* Returns a human-readable statement and value.
if( $this->value ==
true ) {
return "Proposition statement = " .
$this->name .
", value = " .
$truthValue;
* Performs a Boolean AND operation on another {@link Proposition}
* @param Proposition $proposition
$resultName =
"( " .
$this->name .
" AND " .
$proposition->name .
" )";
$resultValue =
( $this->value and $proposition->value );
* Performs a Boolean OR operation on another {@link Proposition}
* @param Proposition $proposition
$resultName =
"( " .
$this->name .
" OR " .
$proposition->name .
" )";
$resultValue =
( $this->value or $proposition->value );
* Performs a Boolean NOT operation its own value
$resultName =
"( NOT " .
$this->name .
" )";
$resultValue =
( !$this->value );
* Performs a Boolean XOR operation on another {@link Proposition}
* @param Proposition $proposition
$resultName =
"( " .
$this->name .
" XOR " .
$proposition->name .
" )";
$resultValue =
( $this->value xor $proposition->value );
* A symbol that represents a value.
* Constructor initializes {@link $name}, and the {@link $value}.
* Constructor initializes {@link $name}, and the {@link $value}.
* Returns "Variable."
* Returns a human-readable statement and value.
return "Variable name = " .
$this->name .
", value = " .
$this->value;
* Determines whether another Variable's value is equal to its own value.
* @param Variable $variable
$statement =
"( " .
$this->name .
" == " .
$variable->name .
" )";
$truthValue =
( $this->value ==
$variable->value );
* Determines whether another Variable's value is <em>not</em> equal to its own value.
* @param Variable $variable
$statement =
"( " .
$this->name .
" != " .
$variable->name .
" )";
$truthValue =
( $this->value !=
$variable->value );
* Determines whether another Variable's value is less than to its own value.
* @param Variable $variable
$statement =
"( " .
$this->name .
" < " .
$variable->name .
" )";
$truthValue =
( $this->value <
$variable->value );
* Determines whether another Variable's value is less than or equal to to its own value.
* @param Variable $variable
$statement =
"( " .
$this->name .
" <= " .
$variable->name .
" )";
$truthValue =
( $this->value <=
$variable->value );
* Determines whether another Variable's value is greater than to its own value.
* @param Variable $variable
$statement =
"( " .
$this->name .
" > " .
$variable->name .
" )";
$truthValue =
( $this->value >
$variable->value );
* Determines whether another Variable's value is greater than or equal to its own value.
* @param Variable $variable
$statement =
"( " .
$this->name .
" >= " .
$variable->name .
" )";
$truthValue =
( $this->value >=
$variable->value );
/* End of file Ruleelement.php */
/* Location: ./system/application/libraries/Phprules/Ruleelement.php */
Documentation generated on Thu, 24 Mar 2011 21:27:41 -0500 by phpDocumentor 1.4.1