2CL syntax

Writing a new example and producing the corresponding graphs by means of the 2CL Tool is very simple and intuitive. 2CL files are structured in three parts, identified by the labels:

  • initial:
    this section contains the facts and commitments that hold in the initial state. They are separated by commas and the list ends with a full stop;

    initial: c(x,y,p), e.

  • constitutive:
    this section contains the definition of the actions. Each definition starts with the name of the defined action, followed by the keyword means and the list of the effects separated by commas. The possible precondition to the executability of the action follows. If present, it is introduced by the keyword if. Each action definition must end with a full stop.

    action means create(c(x,y,z)), cancel(c(y,x,r)), f1, f2 if cond1 & !cond2.

    e.g. pay means paid, create(c(x,y,send_feedback)) if enough_money.

  • regulative:
    this section specifies the set of constraints. Each constraint has the form

    antecedent constraint consequent

    where "constraint" is an arrow that follows the semantics of the 2CL Language.

The constitutive component is mandatory, while the other two can be omitted: they will be considered empty.

Commitments have the form:

c(debtor, creditor, condition)    e.g. c(fp, inv, invested)

while conditional commitments have the form:

cc(debtor, creditor, antec_condition, conseq_condition)     e.g. cc(dc, asker, asked_data, sent_data)

For a quick look on how to specify your own example, please take a look at the examples.