![]() |
Reference Manual |
Parentheses, square brackets and angled brackets
are to be interpreted as literals except for angled brackets surrounding a word,
e.g. as in <belief-templates>. A line such as <template-type> <
<instance-name> > is intended to represent a name such as Location<currentLocation>,
or in the case where the instance is not named, Location<>.
NULL means that nothing is printed in the
agent definition file.
==========================================================================
<agent-definition> ::= <version-number>
<unstructured-comments>
<separator-line> <abbreviated-names>
<separator-line> <initial-objects>
<separator-line> <action-definitions>
<separator-line> <capabilities>
<separator-line> <belief-templates>
<separator-line> <initial-beliefs>
<separator-line> <initial-agency-beliefs>
<separator-line <intial-commitments>
<separator-line <intial-intentions>
<separator-line> <behavioral-rules>
<separator-line>
<version-statement> ::= RETICULAR AGENT
DEFINITION BNF VERSION: <version>
<version> ::= <numeral> {.<numeral>}*
<unstructured-comments> ::= <string>*
<separator-line> ::= =========================
The separator line may be any length, composed
of the SEPARATOR_LINE_CHAR. The <unstructured-comments> may be anything.
--------------------------ABBREVIATED NAMES-------------------------
<abbreviated-names> ::= ABBREVIATED NAMES
<name-table-entry>*
<name-table-entry> ::= ( <abbreviated-name>
<full-pkg-class-name> )
<abbreviated-name> ::= <string>
<full-pkg-class-name> ::= <string>
--------------------------INITIAL OBJECTS---------------------------
<initial-objects> ::= INITIAL OBJECTS
<initial-object>*
# Note: the CTOR_ARGS keyword is now optional.
<initial-object> ::= ( <pkg-class-name>
< <instance-name> > {CTOR_ARGS
| NULL} <ctor-arg-spec>* )
#Note: You only use quotes on the String when
the type of object is String.
<ctor-arg-spec> ::= ( <ctor-arg-type>
<ctor-arg-value>* ) |
( java.lang.String "<string>"
)
<ctor-arg-type> ::= <pkg-class-name>
<ctor-arg-value> ::= <string>|<numeral>|<ctor-arg-spec>|
DEFAULT | NULL
<string> ::= <alphanumeric>*
<numeral> ::= <digit>*{.<digit>*}
<instance-name> ::= <string> |
NULL
<pkg-class-name> ::= <package-name>.<class-name>
| <class-name>
<package-name> ::= {<string>.}*<string>
<class-name> ::= <string>
---------------------------ACTION DEFINITIONS----------------------
<action-definitions> ::= ACTION DEFINITIONS
<action-definition>*
<action-definition> ::= ( <action-name>
PAC_OBJECT <pkg-class-name>
< <pac-object-name> > PAC_METHOD
<method-name>
( <method-arg-type>* ) )
| ( <action-name> SEPARATE_THREAD
PAC_OBJECT <pkg-class-name>< <pac-object-name>
> )
<action-name> ::= <string>
<method-name> ::= <string>
<method-arg-type> ::= <pkg-class-name>
<pac-object-name> ::= <string>
| NULL
---------------------------CAPABILITIES-------------------------------------
<capabilities> ::= CAPABILITIES <capability>*
<capability> ::= ( <action-name>
( <pattern-variable>* )
PRECONDITIONS ( <lhs-pattern>* ) EFFECTS
( <mental-change>* ) )
---------------------------BELIEF TEMPLATES-------------------------------
<belief-templates> ::= BELIEF TEMPLATES
<belief-template>*
<belief-template> ::= (<template-type>
FIELDS [{<field-type> <<field-name>
>}* ]
CTOR-ARGS [ <arg-type>* ] )
<template-type> ::= <string>
<field-type> ::= <string>
<arg-type> ::= <string>
<field-name> ::= <string>
---------------------------INITIAL BELIEFS---------------------------------
<initial-beliefs> ::= INITIAL BELIEFS
<initial-belief>*
<initial-belief> ::= ( <template-type>
< <instance-name> >
CTOR-ARGS <ctor-arg-spec>* )
---------------------------INITIAL COMMITMENTS------------------------------
<initial-commitments> ::= INITIAL COMMITMENTS
<commitment>*
<commitment> ::= (<agent-name>
[ <time> ] <action-name> ( <bound-element>* ))
<time> ::= <year>:<month>:<day>
<hour>:<minute>:<second> |STARTUP | SHUTDOWN
<year> ::= <numeral>
<month> ::= <numeral>
<day> ::= <numeral>
<hour> ::= <numeral>
<minute> ::= <numeral>
<second> ::= <numeral>
---------------------------BEHAVIORAL RULES--------------------------------
<behavioral-rules> ::= BEHAVIORAL RULES
<behavioral-rule>*
<behavioral-rule> ::= ( <rule-name>
WHEN <when-clause>
IF <if-clause>
THEN <then-clause> )
<rule-name> ::= <quoted-string>
<when-clause> ::= <compound-lhs-pattern>*
<if-clause> ::= <compound-lhs-pattern>*
<then-clause> ::= <action-statement>*
{ <mental-change> | <temp-var-rhs-pattern>
}*
=========================== RULE PATTERN SUPPORT
===============================
# This section breaks up the rule "compound-lhs-patterns"
into more specific
# elements which are needed for correct representation.
<compound-lhs-pattern> ::= ( <simple-lhs-pattern>
) |
( <compound-lhs-pattern> AND <compound-lhs-pattern>
) |
( <compound-lhs-pattern> OR <compound-lhs-pattern>
) |
( NOT( <compound-lhs-pattern> ) ) |
(<quantified-pattern> )
<simple-lhs-pattern> ::= <object-relation>
|
<numerical-relation> |
<bind-pattern> |
<message-pattern> |
<temp-var-lhs-pattern>
# Example of new object relation using predicate
method with args:
# OBJ [INST Time<currentTime>] during(
(Time [VAR Time<?t1>]),
# (Time [VAR Time<?t2>]) )
# The comma in the arg list is optional
<object-relation> ::= OBJ <lhs-pattern-element>
<operator-keyword>
<lhs-pattern-element>|
OBJ <lhs-pattern-element>
<predicate-method-name> ( <arg-element-spec>*
)
<arg-element-spec> ::= ( <arg-class-name>
<lhs-pattern-element>* )
<operator-keyword> ::= EQUALS | NOT EQUALS
| ELEMENT-OF | NOT-ELEMENT-OF
<numerical-relation> ::= NUM <lhs-pattern-element>
<rel-op-symbol>
<lhs-pattern-element>
<rel-op-symbol> ::= = | != | < | <=
| > | >=
<bind-pattern> ::= BIND <pattern-variable>
| BIND <named-instance-var>
<temp-var-lhs-pattern> ::= SET_TEMPORARY
<pattern-variable> TO
<lhs-pattern-element>
<quantified-pattern> ::= <quantifier>
<quant-var-list>
( <compound-lhs-pattern> )
<quantifier> ::= FOR_ALL | EXISTS
<quant-var-list> ::= <top-level-pattern-variable>+
<pattern-element> ::= <lhs-pattern-element>
| <rhs-pattern-element>
<lhs-pattern-element> := <pattern-variable>
|
<message-pattern-variable> |
<bound-element> |
<named-instance-var> |
<function>
<rhs-pattern-element> := <lhs-pattern-element>
|
<return-variable> |
<new-object-element>
#The second option is a special case for handling
KqmlMessage casting.
#This is because the content field is an object
and needs to be cast
#to its specific type.
<pattern-variable> ::= [ VAR <pkg-class-name>
< <var-name> >{.<field-name>}*
] |
[VAR ( ( <pkg-class-name> ) KqmlMessage
< <var-name> >.content ) {.<field-name>}*
]
<message-pattern-variable> ::= [ VAR
<pkg-class-name> < <var-name> >
{.<field-name>}* ] | [VAR ( ( <pkg-class-name>
)
KqmlMessage < <var-name> >.content
) {.<field-name>}* ]
# The <top-level-pattern-var> is a restricted
form of pattern variable
# which is used as the target variable in
<quantified-pattern> and
# <retraction>
<top-level-pattern-var> ::= [ VAR <pkg-class-name>
< <var-name> > ]
<var-name> ::= <string>
<field-name> ::= <string>
<bound-element> ::= [ VAL <pkg-class-name>
<value> ] |
[ VAL <pkg-class-name> <ctor-arg-spec>*
]
<value> ::= "<string>"
| <numeral> | NULL
<named-instance-var> ::= [ INST <pkg-class-name>
< <instance-name> > {.<field-name>}*
]
# The <top-level-named-instance-var>
is a restricted form of named instance
# variable used as the target variable in
<retraction>
<top-level-named-instance-var>::= [INST
<pkg-class-name> <<instance-name> >]
<return-variable> ::= [ RVAR <pkg-class-name>
< <var-name> > ]
<new-object-element> ::= [ NEW <pkg-class-name>
<ctor-arg-element-spec>* ]
<ctor-arg-element-spec> ::= ( <ctor-arg-class-name>
<rhs-pattern-element>* )
<function> ::= <math-function>
| <arithmetic-function> | <string-function>
<arithmetic-func> ::= [ AFUNC <pattern-element>
<arithmetic-symbol>
<pattern-element> ]
<arithmetic-symbol> ::= + | - | * | /
<math-function> ::= [MFUNC <math-func-keyword>
( <math-func-operand-list> ) ]
<math-func-keyword> ::= Sqrt | Log |
Exp | Random | Round | Mod | Power |
Abs | Max | Min | Floor | Ceiling | Sin |
Cos | Tan |
ArcSin | ArcCos | ArcTan | ConvertToInteger
|
ConvertToFloat
<math-func-operand-list> ::= NULL | <pattern-element>
|
<pattern-element> <pattern-element>
<string-function> ::= [ SFUNC <string-func-keyword>
( <string-func-operand-list> ) ]
<string-func-keyword> ::= Concat | Substring
| Length | Uppercase |
Lowercase | Trim | IndexOf | LastIndexOf
<string-func-operand-list> ::= <pattern-element>
|
<pattern-element> <pattern-element>
|
<pattern-element> <pattern-element>
<pattern-element>
==========================================================================
#This section lays out the agent's beliefs about its own agency and
#all of the other agents it knows about. It
does this in a general
#intial beliefs manner (i.e. it uses the format
for an initial belief)
#It will look like an initial belief to the
agent engine parser.
#The <comm-info> for the self agent
cannot be null.
<initial-agency-beliefs> ::= INITIAL
AGENCY BELIEFS
<self-spec> { <agency-tool-spec>
| NULL }
{ <debugger-spec> | NULL }
{ <remote-agents-spec> | NULL } | NULL
<self-spec> ::= ( SELF <agent-name>
[ <agent-address> ]
{ [<comm-info>] }+ [ <keys> ]
[ <agencies> ] )
<agency-tool-spec> ::= ( AGENCY_TOOL
<remote-agent> )
<debugger-spec> ::= ( DEBUGGER <remote-agent>
)
<remote-agents-spec> ::= REMOTE_AGENTS
{ ( <remote-agent> ) }*
<remote-agent> ::= <agent-name>
[ <agent-address> ]
[<comm-info>] [ <keys> ] [ <agencies>
]
<agent> ::= <String> (quoted string)
<agencies> ::= <agency> { , <agency>
} *
<agency> ::= <String> (quoted string)
<comm-info> ::= <rmi> | <socket>
| NULL
<rmi> ::= RMI : rmiRegistry-port-number
<socket> ::= SOCKET : socket-port-number
: full-pkg-class-name
<agent-address> ::= <IPaddress>
| CURRENT_IP_ADDRESS
<IPAddress> ::= address (number or name)
<keys> ::= <public-key> <private-key>
| NULL
<public-key> ::= byte[]
<private-key> ::= byte[]
==========================================================================
#RHS support
<rhs-pattern> ::= ( <action-statement>
) |
( <mental-change> ) |
( <temp-var-rhs-pattern> )
<action-statement> ::= DO <action-name>
( <rhs-pattern-element>
{ , <rhs-pattern-element> }* )|
DO <return-variable> = <action-name>
( <rhs-pattern-element> { , <rhs-pattern-element>
}* ) |
DO SendKqmlMessage( <mssg-pattern-element>
<sender-pattern-element>
<receiver-pattern-element>
<performative-pattern-element>
<reply-with-pattern-element>
<in-reply-to-pattern-element>
<to-pattern-element>
<from-pattern-element>
<language-pattern-element>
<ontology-pattern-element>
<content-pattern-element> )|
DO <target-element> <method-name>
( <ctor-arg-element-spec>
{ , <ctor-arg-element-spec> }* |
NULL ) # For the "run" method |
DO <target-element> run ( ) SEPARATE_THREAD
|
DO <return-variable> = <target-element>
<method-name> ( <ctor-arg-element-spec>
{ , <ctor-arg-element-spec> }* | NULL
)
<target-element> ::= <pattern-variable>
| <named-instance-var>
<method-name> ::= <String>
<mssg-pattern-element> ::= <rhs-pattern-element>
<sender-pattern-element> ::= SENDER
<rhs-pattern-element> | []
<receiver-pattern-element> ::= RECEIVER
<rhs-pattern-element> | []
<performative-pattern-element> ::= PERFORMATIVE
<rhs-pattern-element> | []
<reply-with-pattern-element> ::= REPLY_WITH
<rhs-pattern-element> | []
<in-reply-to-pattern-element> ::= IN_REPLY_TO
<rhs-pattern-element> | []
<to-pattern-element> ::= TO <rhs-pattern-element>
| []
<from-pattern-element> ::= FROM <rhs-pattern-element>
| []
<language-pattern-element> ::= LANGUAGE
<rhs-pattern-element> | []
<ontology-pattern-element> ::= ONTOLOGY
<rhs-pattern-element> | []
<content-pattern-element> ::= CONTENT
<rhs-pattern-element> | []
<mental-change> ::= <assertion>
| <retraction>
<assertion> ::= ASSERT ( <instance-name>
<object-pattern> ) |
ASSERT ( <replacement> )
<instance-name> ::= <bound-element>
| NULL
<object-pattern> ::= <pattern-variable>
| <return-variable> |
<new-object-element> | <bound-element>
|
<named-instance-var>
<replacement> ::= SET_VALUE_OF <pattern-variable>
TO <rhs-pattern-element>|
SET_VALUE_OF <named-instance-var> TO
<rhs-pattern-element>
# A retraction target will be either a <top-level-pattern-variable>
or a
# <top-level-named-instance-var>. These
are restricted forms of pattern
# vars or named instance vars which cannot
have any subobjects specified.
<retraction> ::= RETRACT ( <top-level-pattern-variable>
) |
RETRACT ( <top-level-named-instance-var>
)
<temp-var-rhs-pattern> ::= SET_TEMPORARY
<pattern-variable>
TO <rhs-pattern-element>
--------------------------------------------------------------------------