Personal tools
You are here: Home Mediabase Mailinglists Paladin

Formal Expression Rules


Formal Expression Language for PALADIN (FELP) is the language used for defining formally patterns
and their components in PALADIN.


Variables


1. Simple Variables.
Simple variables are strings which start with a character and can contain
characters or digits inside v=[A-Za-z]([A-Za-z0-9]*).
Only characters from the English aplphabet may be used.

2. Properties.
Properties are defined recursively as either two simple variables concatenated
with dot (.) or a property and a simple variable concatenated with dot (.)
p=v.v|v.p
. Example: variable.property or variable.property1.property2.
3. Set Variables.
Set variables (s) are defined as two simple variables concantenated with
,..., s=v,...,v.


Formal Expression Definition


Formal Expression f is:
ExpressionResult of the expression
1.vthe value of the variable
2.pthe value of the property
3.(f)the value of the expression in the parantheses
4.f1+f1the sum of the values of the two operands
5.f1-f1the difference of the values of the two operands
6.f1*f1the product of the values of the two operands
7.f1/f1the quotient of the values of the two operands
8.f1=f1true if the values of the two operands are equal,
false otherwise
9.f1!=f1true if the values of the two operands are different,
false otherwise
10.f1>f1true if the value of the first operand is greater
than the value of the second
11.f1<f1true if the value of the first operand is less
than the value of the second
12.f1&f1true if and only if the values of
both of the operands are true
13.f1|f1true if and only if the values of
both of the operands are true
14.~f1true if and only if the value of the operand is false
15.EXISTS[v1|f]true if and only if there exists variables v1,
satisfying f
16.FORALL[v1|f]true if and only if there all variables v1,
satisfy f
17.SUM FOREACH[v1|f]sum of the values of all variables v1,
which satisfy f
18.AVERAGE FOREACH[v1|f]the average value of the values of all variables v1,
which satisfy f
19.COOUNT FOREACH[v1|f]the count of all variables v1,
which satisfy f



Additional definitions and explanations:


f1 and v1 are defined using the regular expressions:
1. f1 = v|p|(f).
2. v1 = (v+p+s)(,(v+p+s))*
3. Space characters between two charcters are allowed in the formal expression, as long as at most one of
the characters is a letter or a digit.
4. During the expression evaluation the boolean values true and false correspond to 1 and 0,
respectively. Undefined variable is considered to have a value false or 0.


Rules for inistantiating variables


When a formal expression is defined using the web interface, none of the variables is bound.
First the expression is processed and the variables are identified,
and then on the next step, their type can be set.
1. Variables, used in a force expression:
1.1. Simple variables are bound to terms from the term database.
1.2. Simple variables are set at execution time from the user interface.
1.3. Simple variable are bound to a set variable, if the simple variable occurs in the right side of
a quantor expression and the set variable in its left side.
1.4. Properties are split in two parts -a variable part and a property part.
The variable is bound to a term. The property is bound to a property of that term.
1.5. Set variables are bound to a term.
1.6. If the type of a simple or a set variable is not set, then its type is the term actor.
1.7. If the type of a property is not set, then the type of the variable part is the term actor
and the type of the property is its own name.

2. Variables, used in a force relation expression:
2.1. Simple variables are bound to forces from the pattern.
2.2. Simple variables are set at execution time from the user interface.
2.3. Simple variable are bound to a set variable, if the simple variable occurs in the right side of
a quantor expression and the set variable in its left side.
2.4. Properties are split in two parts -a variable part and a property part.
The variable is bound to a force. The property is bound to a property of that force.
2.5. Set variables are bound to a force.
2.6. If the type of a simple or a set variable is not set,
then the type of the variable can be the one of the types of the availables forces.
2.7. If the type of a property is not set,
then the type of the variable part can be the one of the types of the availables forces
and the type of the property is its own name.

3. Variables, used in a disturbance expression:
3.1. Simple variables are bound to forces or force relations from the pattern.
3.2. Simple variables are set at execution time from the user interface.
3.3. Simple variable are bound to a set variable, if the simple variable occurs in the right side of
a quantor expression and the set variable in its left side.
3.4. Properties are split in two parts -a variable part and a property part.
The variable is bound to a force or a force relations.
The property is bound to a property of the force or the force relations .
3.5. Set variables are bound to a force or a force relations .
3.6. If the type of a simple or a set variable is not set,
then the type of the variable can be the one of the types of the availables forces or force relations.
3.7. If the type of a property is not set, then the type of the variable part
can be the one of the types of the availables forces or force relations
and the type of the property is its own name.

4. Variables, used in a i* dependency expression:
Same as variables used in a disturbance expression.