% excerpts presented at DAML PI Meeting Rules Breakout % of draft (-v9) of RuleML abstract syntax specification % excerpts from GBNF and SCLPRevised sections % by Benjamin Grosof % created 3/28/03 GBNF is an extended variant of EBNF. GBNF statements are of two kinds: containment and macro. A macro is similar in spirit to an EBNF production. A containment specifies the content of an element. GBNF includes both unordered concatenation and ordered concatenation. Attributes are treated as a kind of element. Macros are useful for specifying XML entities. ":" defines a containment. "=" defines a macro. "," means unordered concatenation. "\" means ordered concatenation. "|" separates alternatives (disjunctively). "*" means unordered Kleene star -- zero or more repetitions, concatenated. "?" means optional inclusion. "+" means one or more repetitions, concatenated and unordered. "(...)" delimits an expression. ";" delimits the end of a statement. "\*" is the ordered version of "*". "\+" is the ordered version of "+". "@" prefixes an attribute. "$" delimits a (following) default value of an attribute. The following is the specification of Situated Courteous LP sub-language of RuleML -- a very expressive one yet still tractable when the Herbrand universe is polynomial-size. GBNF enables this specification to be quite concise. rulebase : _rbaselab? , _statements , @direction ; _statements : (imp | fact | mutex | sens | effe)* ; @direction : (forward | backward | bidirectional) $ bidirectional ; _rbaselab : ind | cterm ; imp : _rlab? , _head , _body ; fact : _rlab? , _head ; _rlab : ind | cterm ; _head : (cslit | (atom)) | andh ; _body : bodyexpr ; bodyexpr = (fclit | (cslit | flit | atom)) | ((andb | and) | orb) ; and : (atom | and)*; andb : (bodyexpr)* ; orb : (bodyexpr)+ ; andh : ((cslit | atom) | andh)+ ; _opr = rel ; _args = (tup | roli) ; cslit : _opr , _args , @cneg ; fclit : _opr , _args , @cneg, @fneg ; flit : _opr , _args , @fneg ; atom : _opr , _args ; @cneg : bool $ no; @fneg : bool $ no; bool = yes | no ; rel : constname ; ind : constname ; ctor : constname ; constname = PCDATA | (@href , nick?) ; nick : PCDATA ; @href : URI ; URI = CDATA ; var : PCDATA ; cterm : _opc , _args ; _opc = ctor ; tup : (ind | var | cterm | tup | roli)\* ; roli : (_arv)* ; _arv : arole, (ind | var | cterm | tup | roli) ; arole : constname ; /* courteous features stuff */ mutex : _oppo , _mgiv? ; _oppo = ando ; _mgiv = bodyexpr ; ando : cslit , cslit ; /* situated features stuff */ bind = bound | free ; sens : _opr , _aproc, _modli? ; effe : _opr , _aproc ; _aproc = jproc | uproc ; uproc : constname ; jproc : clas, meth, path? ; path : constname ; clas : constname ; meth : constname ; _modli : bmtup | bmroli ; bmtup : (bmode | bmtup | bmroli)\* ; bmroli : (_arbm)* ; _arbm : arole, (bmode | bmtup | bmroli) ; bmode : @bval ; @bval : bind $ free ;