DECAF Language Specification ---------------------------- Rules: * Each kind of object has its own unique type. Types Currently supported: - deftask - defaction - library - NLT - provides * The entire definition of an object consists of attribute/value pairs. * Attribute name start with a ':' followed by a keyword. Current Attributes :name - applies to all objects :parent - applies to all non-root objects :parameters - applies to all objects :provisions - applies to all objects :outcomes - applies to all objects :behavior_profile - applies to defaction objects only :utility_function - applies to root task only :caf - applies to defaction objects only :deadline - applies to defaction objects only :from - applies to provides objects only :to - applies to provides objects only * The value for each attribute is a list of one or more items in quotes and the list is enclosed in parentheses. If a particular attribute has no value, then the word "NONE" will appear. * Objects can appear in any order. References to objects defined later are allowed. * There are no such thing as comment lines. This is true since we do expect DECAF files to be generated by hand, only through the planeditor. * Data types of all values are in parentheses after the attribute name. Symbol means an arbitrary sequence of alphanumeric characters with no internal spaces or '-' (dashes). Details ------- - Provides indicates a data flow from one action/task to another. - the syntax is :from ("actionName.OutcomeName) :to (ActionName.ProvisionName) - Note outcomes cannot be inflow to a parameter, only a provision. (provides :from ("sendReply.OK") :to ("Reply.OK") ) - defaction is the basic unit of work. It represents a method in a java class - The method code will be found in a file of the action parents name. In this - example you would find Send.java and the method result(). - All actions will have NO children. (defaction :name ("result") :parent ("Send") :children ("NONE") :parameters ("NOPROV") :provisions ("input") :outcomes ("OK") :behavior_profile (:cost "NONE" :quality "NONE" :duration "NONE") :utility_function ("NONE") :caf ("AND") ) - A non-local-task is a representation for send a message to an outside entity. - ALL NLT will be coded as below with no more or less fields. This code is - built internally by DECAF and does not represent user code. Input id always - a KQML message (one or more) and the outcome is a KQML message. (NLT :name ("sendReply") :parent ("Reply") :parameters ("NOPROV") :provisions ("KQML") :outcomes ("OK") ) - A deftask structure is a representation of a group of actions. All tasks except the - root task will have a parent. All tasks must have one or more children. The name of the - task is used for the name of the java file where the actions will be found. (deftask :name ("Send") :parent ("NONE") :children ("formatMsg" "sendMsg" "result") :parameters ("NOPROV") :provisions ("NOPROV") :outcomes ("OK") :behavior_profile (:cost "NONE" :quality "NONE" :duration "NONE") :utility_function ("NONE") :caf ("AND") ) - A library entry has only one parameter, the name. It is assumed that - this is pre-written code which can be called by the DECAF architecture - in a fashion similar to C library calls. Parameters are predefined - as well as outcomes. (library :name ("Unsubscribe") ) - The behavior_profile applies ONLY to actions and not tasks The three - values of cost, quality and duration are used internally by DECAF to - reason about action scheduling. :behavior_profile (:cost "NONE" :quality "NONE" :duration "NONE") - The utility_function is used ONLY by the root task. It is an indication - by the user of how results are to be used. :utility_function ("NONE") - The caf (Characteristic Accumulation Function) applies ONLY to Task - and is an indication of how sub-task and action results are to be used. - Choices for this are AND (default), OR, XOR, and SUM. :caf ("AND")