Antecedent
Antecedent
¶
Expression tree that represents and evaluates the antecedent of a rule.
structure
The structure of a rule is:
if (antecedent) then (consequent)
The structure of the antecedent of a rule is:
if variable is [hedge]* term [(and|or) variable is [hedge]* term]*
*
-marked elements may appear zero or more times,
elements in brackets are optional, and
elements in parentheses are compulsory.
Attributes¶
Functions¶
__repr__
¶
__repr__() -> str
Return the code to construct the antecedent in Python.
Returns:
Type | Description |
---|---|
str
|
code to construct the antecedent in Python. |
activation_degree
¶
activation_degree(
conjunction: TNorm | None = None, disjunction: SNorm | None = None, node: Expression | None = None
) -> Scalar
Compute the activation degree of the antecedent on the expression tree from the given node.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
conjunction |
TNorm | None
|
conjunction operator from the rule block |
None
|
disjunction |
SNorm | None
|
disjunction operator from the rule block |
None
|
node |
Expression | None
|
node in the expression tree of the antecedent |
None
|
Returns:
Type | Description |
---|---|
Scalar
|
activation degree of the antecedent. |
infix
¶
infix(node: Expression | None = None) -> str
Return the infix notation of the node.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
node |
Expression | None
|
node in the expression tree of the antecedent |
None
|
Returns:
Type | Description |
---|---|
str
|
infix notation of the node. |
load
¶
load(engine: Engine) -> None
Load the antecedent using the engine to identify and get references to the input and output variables.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
engine |
Engine
|
engine to get references in the antecedent. |
required |
postfix
¶
postfix(node: Expression | None = None) -> str
Return the postfix notation of the node.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
node |
Expression | None
|
node in the expression tree of the antecedent |
None
|
Returns:
Type | Description |
---|---|
str
|
postfix notation of the node. |
prefix
¶
prefix(node: Expression | None = None) -> str
Return the prefix notation of the node.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
node |
Expression | None
|
node in the expression tree of the antecedent |
None
|
Returns:
Type | Description |
---|---|
str
|
prefix notation of the node. |