| 46 | ==Conditions and loops== |
| 47 | We want to be able to express that an event occurs under certain conditions. |
| 48 | ||'''Meaning'''||'''Operator and example''' || |
| 49 | ||if condition cond holds then A occurs else B occurs || if cond then A else B || |
| 50 | ||Repeat some action while condition cond holds ||do A while cond || |
| 51 | |
| 52 | = Objects = |
| 53 | |
| 54 | An object has a type, may have certain variables associated with it, and an initial state. Logical topology describes (each item is in separate section): |
| 55 | * Object types, variables of interest and initial state. A variable is a new object. |
| 56 | * Object aliases if needed: an object in a given state or whose variable(s) have some given value(s) can be assigned an alias for easier human manipulation such as a Vulnerable node that is in infected state is called Infected node. |
| 57 | * Cardinality of objects using the notation specified above |
| 58 | * Topological relationships between objects: one example is '''collocated''' function. Users can define other relationship functions such as A and B being on the same subnet, A being a leaf node, etc. All function definitions reside in the domain knowledge base. |
| 59 | |
| 60 | || '''Meaning''' || Operator and example || |
| 61 | ||A is of type X || A extends X || |
| 62 | ||A’s initial state is Z || A := { state = Z} || |
| 63 | ||A has an object M of type Y and with initial value I || A := { Y M = I} || |
| 64 | ||A is an alias for B in state C || B := A{ state = C}|| |
| 65 | ||There are N objects of type A || |A|,,N,, || |
| 66 | ||A is different than B|| A != B|| |
| 67 | ||A and B reside on the same physical node ||collocated(A,B)|| |
| 68 | |
| 69 | = States and state changes = |
| 70 | State name may be just a symbolic name or it may be associated with an object variable holding some value. An object in a given state always responds in the same manner to the same stimuli. |
| 71 | |
| 72 | State change names start with s followed by a number. They are defined within curly brackets by specifying the object and its new state, like this: |
| 73 | |
| 74 | {{{s1 := {object.state = newstate}}}} |
| 75 | |
| 76 | =Events = |
| 77 | |
| 78 | Some events may lead to transitions between states, others occur but don’t change object state. Each event has the type, the origin and one or more destinations. These are specified within curly brackets. Event names start with e followed by a number. Each event may have multiple parameters. Example of an event definition: |
| 79 | |
| 80 | {{{e1 := {type = TYPE, origin = object, destination = object, …}}}} |
| 81 | |
| 82 | |