A variable in the EH&S Expert.
Facts are containers for data in the sets of rules of the EH&S Expert and can be used in the following ways:
You can tag facts as input facts or output facts (keywords IN or OUT). They are either supplied with data before the set of rules is run, or they are read after the rules are applied.
You can also create facts without special tags and use them for storing interim results.
You can fill facts directly with default data.
Facts can always be found at the beginning of the set of rules, in a section that is headed with the keyword FACTS. The individual facts are separated by commas.
Example
FACTS
Stoffname(IN),
Flammpunkt(IN),
RSatz(OUT),
HatPB(OUT) := "Y",
...
Note
If you create a set of rules using the rule editor, the editor generates a rule file with the correct syntax automatically.
In the rules of the EH&S Expert, facts are used without any type specifications (text, integers, for example). All facts can adopt all types of data. If required, the data is converted automatically.
The following data types are distinguished internally and in assignments:
Text
for alphanumeric values
Texts can be entered between two quotation marks ("hello," for example).
Number
for numbers
Numbers are written directly.
List
for sets made up of several alphanumeric values or numbers
Sets are written as one element between two square brackets. Characteristics that are assigned multiple values are represented as sets.
Range
for numerical value ranges
Ranges are written in curly brackets. The lower and upper limits are included, provided they are not excluded explicitly by operators (<, >). The expression to
stands between the lower and upper limit (for example, {>2 to 3}).
The following functions determine the range limits:
LO({>2 to 3}) results in 2
UP({>2 to 3}) results in 3
The following functions determine the operators of the range limits:
OPLO({>2 to 3}) results in ">"
OPUP({>2 to 3}) results in "<=" (Default)
The following function determines whether a value is within the range limits:
2.5IN({>2 to 3}) results in TRUE
Example
The following assignments of data types to facts are therefore possible:
X := 1
Y := 134.4
T := "Hello"
M := ["A","B","C"]
R := {>1 to 7}
Conversion between the data types is explained in the following tables using examples. The second row shows the data types before the conversion; the columns below it show the conversion result in each case:
Number | Range | |||
5 | {1 to 3} | {3 to 3} | {>=1 to <=3} | |
Number | Error | 3 | Error | |
Range | {5 to 5} | |||
Text | "5" | ">=1 - <=3" | ">=3 - <= 3“ | ">=1 - <=3" |
List | [5] | [{1 to 3}] | [{3 to 3}] | [{>=1 to <=3}] |
Text | List | ||||||
"Hello" | "1 - 3" | "1" | ["Hello"] | [1] | [{1 to 3}] | [1,"A", 5] | |
Number | Error | Error | 1 | Error | 1 | Error | Error |
Range | Error | {1 to 3} | {1 to 1} | Error | {1 to 1} | {1 to 3} | Error |
Text | "Hello" | "1" | ">=1 - <=3" | Error | |||
List | ["Hello"] | ["1 - 3"] | ["1"] |
When defining the facts, an assignment to the corresponding elements in EH&S (characteristics, identifiers, and so on) is not yet made. These assignments are made centrally in the mapping tables. In this way, rules can be written without the system being aware of the exact assignment to the elements in EH&S.