Execute your Rules with Sequences

Basics

All analyses in Soley are based on rules, sequences and procedures/functions. Sequences apply different rules, rules contain the code to manipulate the input graph and procedures/functions can be part of a sequence or rule to calculate variables with inputs and returning outputs if necessary. To execute several rules in a row or to adapt them for the total graph, you can use sequences.

Quick Start Example

To execute rules you include them in a sequence.

  • Call rules in square brackets: This will apply the rule for all defined patterns on the LHS, that exist in the graph.
  • Call rules with an asterix: This will execute the rule as long as it finds a LHS pattern in the graph
  • Call rules with a number in square brackets behind the rule name: This will execute the rule at least as often as the number states.

Different rules are separated by a “|”. Be aware that the rules will be executed after each other according to the stated order. Examples are given in the code below.

1 sequence analyzeGraph{        //Call a sequence
2  [Rule1] |                    //Execute Rule1 for all LHS pattern
3   Rule2* |                    //Execute Rule2 as long as pattern is found
4  Rule3[5]                     //Execute Rule3 as long as pattern is found, but at least 5 times
5 }

Note: There are more ways to execute rules in sequences and to control the sequence flow. Go to further information and have at the additional articles.

Further Information

Please refer to the Soley tutorial and the other articles in this Knowledge Base category for additional descriptions regarding this topic. If you have to run several calculations procedures/functions might be the right tool. If you want to manipulate your graph in a certain way, have a look at the rules article.

Was this article helpful?

Related Articles