LogicalFunctions package
Requirements.LogicalFunctions
ยท source
Library of logical functions (2-/3-/4-valued logical operators without memory)
Extends Modelica.Icons.Package
Sublibrary LogicalFunctions contains operators without memory, implemented as Modelica functions.
The input arguments of these functions have 2-valued logic type (Boolean) or, for the
four-valued operators and4, or4, not4, and4All,
or4All and the card* counts, 4-valued logic type.
The output arguments of these functions have 2-valued or 4-valued logic type
(Boolean or Property).
The provided operators reason about their input arguments based on Boolean algebra, or,
for Property values, on the four-valued ETL algebra described at
Property (which is not a Boolean algebra:
absorption and distributivity fail, so Property expressions are never simplified).
The icon of a function depends on the the type of its output argument
(whether it is Boolean or Property).
Contents
| Name | Kind | Description | |
|---|---|---|---|
| card | function | Returns the number of elements of a Boolean vector that are true | |
| exists | function | Returns true if at least one element of a Boolean vector is true ('or' of all elements) | |
| forall | function | Returns true if all elements of a Boolean vector are true ('and' of all elements) | |
| implies | function | Returns check as long as the condition is true, otherwise returns true | |
| first | function | Returns the value of the first element of a Boolean vector | |
| last | function | Returns the value of the last element of a Boolean vector | |
| oneTrue | function | Returns true if exactly one element of a Boolean vector is true ('xor' of all elements) | |
| PropertyToBoolean | function | Convert Property (Violated, Undecided, Satisfied, Undefined) to Boolean (false, true) | |
| PropertyToInteger | function | Convert Property (Violated, Undecided, Satisfied) to Integer (1,2,3) | |
| BooleanToProperty | function | Convert Boolean (false,true) to Property (Violated, Satisfied) | |
| IntegerToProperty | function | Convert Integer (1,2,3,4) to Property (Violated, Undecided, Satisfied, Undefined) | |
| during | function | Return Satisfied when check is true as long as condition is true | |
| during3 | function | Return Satisfied when check is Satisfied as long as condition is true (check: 4-valued logic) | |
| forall3 | function | Returns Violated, if at least one element of the Property vector is Violated (superseded by and4All) | |
| cardSatisfied | function | Returns the number of elements of a Property vector that are Satisfied | |
| cardUndecided | function | Returns the number of elements of a Property vector that are Undecided | |
| cardViolated | function | Returns the number of elements of a Property vector that are Violated | |
| cardUndefined | function | Returns the number of elements of a Property vector that are Undefined | |
| and4 | function | 4-valued logic 'and' of two Property values (ETL: Undefined is the neutral element) | |
| or4 | function | 4-valued logic 'or' of two Property values (ETL: Undefined is the neutral element) | |
| not4 | function | 4-valued logic 'not' of a Property value (ETL: Undecided and Undefined are fixed) | |
| and4All | function | 4-valued logic 'and' over a Property vector (the empty vector gives Undefined, the neutral element) | |
| or4All | function | 4-valued logic 'or' over a Property vector (the empty vector gives Undefined, the neutral element) | |
| marginAnd | function | Margin of a conjunction: the minimum of the margins whose property is applicable (not Undefined) | |
| marginOr | function | Margin of a disjunction: the maximum of the margins whose property is applicable (not Undefined) | |
| bandAnd | function | Uncertainty band of a conjunction: could and4All(p) flip inside the uncertainty intervals of its elements? | |
| bandOr | function | Uncertainty band of a disjunction: could or4All(p) flip inside the uncertainty intervals of its elements? |