Plan Rules in ASTRA

In ASTRA, plan rules are defined using a different syntax to that used in AgentSpeak(L).  Specifically, the syntax adopted in ASTRA attempts to be closer to the syntax used in languages like Java and C – the plan body part of a rule is implemented as a code block which itself is made up of a sequence of primitive statements, control flow statements, or sub-blocks.  Primitive statements are terminated by a semi-colon (;).  An illustration of this can be seen below:

rule te : ctxt {
    Ac1;
    Ac2;
    {
        Ac3;
        Ac4;
    }
}

Notice that in the above example, the rule keyword is used to declare that we have  a rule. this is followed by a triggering event (te); and the plans context (ctxt), which is optional and may be omitted when it is true.  The plan body is defined as a code block that consists of a sequence of three statements: 2 primitive statements Ac1 and Ac2, and a code sub-block that contains two more (sequentially executed) primitive statements Ac3 and Ac4.  This syntax is the standard syntax for any C-derived programming language, including Java.