Reaction RuleML 0.1 Syntax
The syntax of Reaction RuleML is specified by means of extended
BNF (EBNF), i.e. alternatives are separated by vertical bars (|);
zero to one occurrences are written in square brackets ([]) and
zero to many occurrences in braces ({}).
RuleML HornLog Layer (RuleML
hornlog.xsd)
RuleML
0.91 content models
HornLog2RR Layer (hornlog2rr.xsd)
Derivation Rules with Naf, Neg, Equal and Updates (redefined
in hornlog2rr.xsd)
Naf ::= weak | Atom | Neg
Neg ::= strong | Atom | And | Or | Neg | Implies | Equivalent
| Forall | Exists | Equal
Assert ::= [oid,] {formula | Atom | Implies | Equivalent | Forall
| Equal | Neg }
Retract ::= [oid,] {formula | Atom | Implies | Equivalent | Forall
| Equal | Neg }
Rulebase ::= [oid,] {formula | Atom | Implies | Equivalent | Forall
| Equal | Neg}
Implies ::= [oid,] (head, body) | (body, head) | {Atom | Naf |
Neg | And | Or | Equal | Assert | Retract,} (Atom | Neg | Equal)
Query ::= [oid,] {formula | Atom | Naf | Neg | Rulebase | And
| Or | Entails | Exists | Equal}
RR Layer (rr.xsd)
Reaction Rule Constructs (rr_module.xsd)
Reaction ::= [oid,] [event | Naf | Neg | Atom | Reaction | Message
| Sequence | Disjunction | Xor | Conjunction | Concurrent | Not
| Any | Aperiodic | Periodic,] [body | Naf | Neg | Atom | And
| Or | Equal,] [action | Atom | Assert | Retract | Message | Sequence
| Disjunction | Xor | Conjunction | Concurrent | Not | Any | Aperiodic
| Periodic,] [postcond | Naf | Neg | Atom | And | Or | Equal,]
[alternative | Atom | Assert | Retract | Message | Sequence |
Disjunction | Xor | Conjunction | Concurrent | Not | Any | Aperiodic
| Periodic]
event ::= Naf | Neg | Atom | Message | Reaction | Sequence | Disjunction
| Xor | Conjunction | Concurrent | Not | Any | Aperiodic | Periodic
cond ::= Naf | Neg | Atom | And | Or | Equal
action ::= Atom | Assert | Retract | Message | Sequence | Disjunction
| Xor | Conjunction | Concurrent | Not | Any | Aperiodic | Periodic
postcond ::= Naf | Neg | Atom | And | Or | Equal
alternative ::= Atom | Assert | Retract | Message | Sequence |
Disjunction | Xor | Conjunction | Concurrent | Not | Any | Aperiodic
| Periodic
"Derivation rules" with nested local reaction rules
(redefined in rr.xsd)
Implies ::= [oid,] (head, body) | (body, head) | {Atom | Reaction
| Naf | Neg | And | Or | Equal | Assert | Retract,} (Atom | Neg
| Equal)
Rulebase ::= [oid,] {formula | Atom | Implies | Reaction | Equivalent
| Forall | Equal | Neg}
ID-Based Update Constructs (redefined in rr.xsd)
Assert ::= [oid,] {formula | Rulebase | Atom | Implies | Reaction
| Equivalent | Entails | Forall | Neg}
Retract ::= [oid,] {formula | Rulebase | Atom | Implies | Reaction
| Equivalent | Entails | Forall | Neg}
Message Constructs (rr_module.xsd)
Message ::= oid | Ind | Var | Expr, protocol | Ind | Var | Expr,
sender | Ind | Var | Expr, content | Assert | Retract | Query
| Inform
protocol ::= Ind | Var | Expr
sender ::= Ind | Var | Expr
content ::= Assert | Retract | Query | Inform
Time / Event Interval Constructs (algebra_module.xsd)
time ::= Ind | Var | Expr
interval ::= Interval | Plex | Var
Interval ::= [oid,] event | action | time | Ind | Var | Expr |
Sequence | Disjunction | Xor | Conjunction | Concurrent | Not
| Any | Aperiodic | Periodic , event | action | time | Ind | Var
| Expr | Sequence | Disjunction | Xor | Conjunction | Concurrent
| Not | Any | Aperiodic | Periodic
Complex Event and Action Algebra Constructs (algebra_module.xsd)
Sequence ::= [oid,] {event | action | Ind | Var | Expr | Sequence
| Disjunction | Xor
| Conjunction | Concurrent | Not | Any | Aperiodic | Periodic
}
Disjunction ::= [oid,] {event | action | Ind | Var | Expr | Sequence
| Disjunction | Xor
| Conjunction | Concurrent | Not | Any | Aperiodic | Periodic
}
Conjunction ::= [oid,] {event | action | Ind | Var | Expr | Sequence
| Disjunction | Xor
| Conjunction | Concurrent | Not | Any | Aperiodic | Periodic
}
Xor ::= [oid,] {event | action | Ind | Var | Expr | Sequence |
Disjunction | Xor
| Conjunction | Concurrent | Not | Any | Aperiodic | Periodic
}
Concurrent::= [oid,] {event | action | Ind | Var | Expr | Sequence
| Disjunction |
Xor | Conjunction | Concurrent | Not | Any | Aperiodic | Periodic
}
Not::= [oid,] event | action | Ind | Var | Expr | Sequence | Disjunction
| Xor | Conjunction |
Concurrent | Not | Any | Aperiodic | Periodic , interval | Interval
| Plex | Var
Any ::= [oid,] Ind | Data | Var , event | action | Ind | Var |
Expr | Sequence
| Disjunction | Xor | Conjunction | Concurrent | Not | Any | Aperiodic
| Periodic
Aperiodic ::= [oid,] event | action | Ind | Var | Expr | Sequence
| Disjunction | Xor |
Conjunction | Concurrent | Not | Any | Aperiodic | Periodic, interval
|
Interval | Plex | Var
Periodic ::= [oid,] time | Ind | Var | Expr, interval | Interval
| Plex | Var
KR Temporal / Event / Action / Transition / Process Logics
Layer (kr.xsd)
State Processing Constructs (state_module.xsd)
state ::= Ind | Var | Expr
Initiates ::= [oid,] state | Ind | Var | Expr
Terminates ::= [oid,] state | Ind | Var | Expr
HoldsState: [oid,] (state | Ind | Var | Expr), (time | interval
| Ind | Expr | Interval)
Reaction RuleML 0.1 Content Models
The content models are specified in a DTD like notation
RuleML HornLog Layer (RuleML
hornlog.xsd)
RuleML
0.91 content models
HornLog2RR Layer
Derivation Rules with Naf, Neg, Equal and Updates (redefined
in hornlog2rr.xsd)
Naf : (weak | Atom | Neg)
Neg : (strong | Atom | And | Or | Neg | Implies | Equivalent |
Forall | Exists | Equal)
Assert : (oid?, (formula | Atom | Implies | Equivalent | Forall
| Equal | Neg )*)
Retract : (oid?, (formula | Atom | Implies | Equivalent | Forall
| Equal | Neg )*)
Rulebase : (oid?, (formula | Atom | Implies | Equivalent | Forall
| Equal | Neg)*)
Implies: (oid?, (head, body) | (body, head) | ( (Atom | And |
Or | Equal | Naf | Neg | Assert | Retract ), (Atom | Equal | Neg)
))
Query: ( oid?, (formula | Atom | Naf | Neg | Rulebase | And |
Or | Entails | Exists | Equal)* )
Var: @mode; possible values: +|-|?; default value: ?; optional
attribute
Assert: @safety; possible values: transactional|normal; default
value: normal; optional attribute
Retract: @safety; possible values: transactional|normal; default
value: normal; optional attribute
Rel: @lang; possible values: java|modal; default value: java;
optional attribute
Rel: @in; possible values: no|yes|semi; default value:no; optional
attribute
Fun: @lang; possible values: java|modal; default value: java;
optional attribute
Fun : @in; possible values: no|yes|semi; default value:no; optional
attribute
RR Layer (rr.xsd)
Reaction Rule Constructs (rr_module.xsd)
Reaction: ( oid?, (event | Naf | Neg | Atom | Reaction | Message
| Sequence | Disjunction | Xor | Conjunction | Concurrent | Not
| Any | Aperiodic | Periodic)?, (body | Naf | Neg | Atom | And
| Or | Equal)?, (action | Atom | Assert | Retract | Message |
Sequence | Disjunction | Xor | Conjunction | Concurrent | Not
| Any | Aperiodic | Periodic)?, (postcond | Naf | Neg | Atom |
And | Or | Equal)?, (alternative | Atom | Assert | Retract | Message
| Sequence | Disjunction | Xor | Conjunction | Concurrent | Not
| Any | Aperiodic | Periodic)?)
Reaction: @exec; possible values: active | passive | reasoning;
default value: passive; required attribute
Reaction: @kind; possible values: pattern combinations; default
value: eca; required attribute
Reaction: @eval; possible values: weak | strong; default value:
strong; optional attribute
event: ( Naf | Neg | Atom | Reaction | Message | Sequence | Disjunction
| Xor | Conjunction | Concurrent | Not | Any | Aperiodic | Periodic
| Ind | Var | Expr)
event: @arg; possible values: arg1, arg2,..,argn; optional attribute
action: ( Atom | Assert | Retract | Message | Sequence | Disjunction
| Xor | Conjunction | Concurrent | Not | Any | Aperiodic | Periodic
| Ind | Var | Expr)
action: @arg; possible values: arg1, arg2,..,argn; optional attribute
postcond: (Naf | Neg | Atom | And | Or | Equal)
alternative: ( Atom | Assert | Retract | Message | Sequence |
Disjunction | Xor | Conjunction | Concurrent | Not | Any | Aperiodic
| Periodic)
alternative: @arg; possible values: arg1, arg2,..,argn; optional
attribute
"Derivation rules" with nested local reaction rules
(redefined in rr.xsd)
Implies: (oid?, (head, body) | (body, head) | ( (Atom | And |
Or | Equal | Naf | Neg | Assert | Retract | Reaction), (Atom |
Equal | Neg) ))
Rulebase : (oid?, (formula | Atom | Reaction | Implies | Equivalent
| Forall | Equal | Neg)*)
ID-Based Update Constructs (redefined in rr.xsd
with Reaction)
Assert: ( oid?, (formula | Rulebase | Atom | Implies | Reaction
| Equivalent | Entails | Forall | Equal | Neg)* )
Retract: ( oid?, (formula | Rulebase | Atom | Implies | Reaction
| Equivalent | Entails | Forall | Equal | Neg)* )
Message Constructs (rr_module.xsd)
Message: ( (oid | Ind | Var | Expr), (protocol | Ind | Var |
Expr), (sender | Ind | Var | Expr), (content | Assert | Retract | Query | Inform)
)
protocol: (Ind | Var | Expr)
sender: (Ind | Var | Expr)
content: (Assert | Retract | Query | Inform)
Message: @mode; possible values: inbound | outbound; required
attribute
Message: @directive; possible values: performatives, e.g. ACL:inform;
required attribute
Time / Event Interval Constructs (algebra_module.xsd)
time: (Ind | Var | Expr)
interval: (Interval | Plex | Var)
Interval: ( oid?, event | action | time | Ind | Var | Expr | Sequence
| Disjunction | Xor | Conjunction | Concurrent | Not | Any | Aperiodic
| Periodic , event | time | Ind | Var | Expr | Sequence | Disjunction
| Xor | Conjunction | Concurrent | Not | Any | Aperiodic | Periodic)
Complex Event / Action Algebra Constructs (algebra_module.xsd)
Sequence: (oid?, (event | action | Ind | Var | Expr | Sequence
| Disjunction | Xor | Conjunction | Concurrent | Not | Any | Aperiodic
| Periodic)*)
Disjunction: (oid?, (event | action | Ind | Var | Expr | Sequence
| Disjunction | Xor | Conjunction | Concurrent | Not | Any | Aperiodic
| Periodic)*)
Conjunction: (oid?, (event | action | Ind | Var | Expr | Sequence
| Disjunction | Xor | Conjunction | Concurrent | Not | Any | Aperiodic
| Periodic)*)
Xor:(oid?, (event | action | Ind | Var | Expr | Sequence | Disjunction
| Xor | Conjunction | Concurrent | Not | Any | Aperiodic | Periodic)*)
Concurrent: (oid?, (event | action | Ind | Var | Expr | Sequence
| Disjunction | Xor | Conjunction | Concurrent | Not | Any | Aperiodic
| Periodic)*)
Not: (oid?, event | action | Ind | Var | Expr | Sequence | Disjunction
| Xor | Conjunction | Concurrent | Not | Any | Aperiodic | Periodic,
interval | Interval | Plex | Var)
Any: (oid?, Ind | Data | Var, event | action | Ind | Var | Expr
|Sequence | Disjunction | Xor | Conjunction | Concurrent | Not
| Any | Aperiodic | Periodic, interval | Interval | Plex | Var)
Aperiodic: (oid?, event | action | Ind | Var | Expr | Sequence
| Disjunction | Xor | Conjunction | Concurrent | Not | Any | Aperiodic
| Periodic, interval | Interval | Plex | Var)
Periodic: (oid?, time | Ind | Var | Expr , interval | Interval
| Plex | Var)
Interval: ( oid?, event | action | time | Ind | Var | Expr | Sequence
| Disjunction | Xor | Conjunction | Concurrent | Not | Any | Aperiodic
| Periodic , event | action | time | Ind | Var | Expr | Sequence
| Disjunction | Xor | Conjunction | Concurrent | Not | Any | Aperiodic
| Periodic)
KR Temporal / Event / Action / Transition / Process Logics
Layer (kr.xsd)
State Processing Constructs (state_module.xsd)
state: (Ind | Var | Expr)
Initiates: (oid?, (state | Ind | Var | Expr))
Terminates: (oid?, (state | Ind | Var | Expr))
HoldsState: (oid?, (state | Ind | Var | Expr), (time | interval
| Ind | Var | Expr | Interval) )
<< back