next up previous
Next: Prototype execution Up: Prototype implementation Previous: Extending Prolog to develop

Implementing a working prototype

To implement a working prototype, the proper Prolag code must be supplied for any agent in the system. This code must

  1. implement all the computational features characterizing an agent: its initial state, its behavior and its engine; and
  2. respect the specifications of the agent and of the system given in steps 1 through 3 of the method.
For interface agents, the Prolag code must also define the interpreter predicates.

The ability of automatically translating the agents' specifications into Prolag code and of reusing already implemented structures, should avoid the burden of a hand-made prototype implementation developed by scratch. The research in this direction is quite recent and far from resulting into a completely automatic translation process, but some preliminary, promising results have already been obtained.

In [3] an engine for the PRS architecture [8] have been specified using tex2html_wrap_inline1030 . An approach to the translation of tex2html_wrap_inline1030 rules into Prolag code has also been given. The tex2html_wrap_inline1030 clauses used for specifying the PRS engine assume the general form tex2html_wrap_inline1097

where all the formulas tex2html_wrap_inline1099 are atomic. In order to translate in Prolag a multi-conclusion guarded clause C of such a form, it is necessary to introduce an auxiliary predicate tex2html_wrap_inline1103 , defined as
tex2html_wrap_inline1103 :-  retract_state( tex2html_wrap_inline1107 ),..., retract_state( tex2html_wrap_inline1109 ), tex2html_wrap_inline1111 ,
assert_state( tex2html_wrap_inline1113 ), ...,assert_state( tex2html_wrap_inline1115 ).

where retract_state and assert_state are the predicates for state update described in Subsection 5.1. The execution of retract_state( tex2html_wrap_inline1107 ),..., retract_state( tex2html_wrap_inline1109 ) consumes the atomic formulas tex2html_wrap_inline1121 , the proof of tex2html_wrap_inline1123 tests both the clause guard and the condition over the current state, and finally the execution of assert_state( tex2html_wrap_inline1113 ), ..., assert_state( tex2html_wrap_inline1115 ) adds new information to the state. Applying this transformation to every tex2html_wrap_inline1030 clause, a corresponding set of Prolag clauses is obtained. Such a set can be partitioned by grouping together clauses regarding the four main activities performed by a PRS agent that are perception, plan_triggering, plan_execution and action_execution.

The engine of a Prolag agent is defined by a predicate cycle. The cycle defining the PRS engine results into:
cycle :- perception; plan_triggering; plan_execution; action_execution.
Each activity can be defined by the clauses belonging to the corresponding activity group, for example
plan_triggering :- tex2html_wrap_inline1131 ; ... ; tex2html_wrap_inline1133
where tex2html_wrap_inline1135 are the clauses of the plan triggering group.

Another issue that have been considered is the compilation from ACLPL into Prolag. Due to their rule-based nature, ACLPL specifications can be easily translated into a form that can be manipulated by a reactive-proactive engine. A working compiler has been implemented, which takes as input an ACLPL\ program and generates a code of this form.

reactive_rule(Message, Condition, Actions).
...
proactive_rule(Condition, Actions).
...
p1(..) :- ...
...
pm(..) :- ...

reactive_rule is a reactive rule, proctive_rule is a proactive rule and p1, ..., pm are Prolag predicates.
The cycle for a reactive-proactive agent may have the form

cycle :-
async_receive_one(Msg_input, Msg_output),
(Msg_output == no_message ->
Actions1 = []
;
select_reactive_rule(Msg_output, Actions1)
),
select_proactive_rule(Actions2),
choose(Actions1, Actions2, Actions),
execute(Actions).


The predicate cycle defines a simple engine for the agent architecture. First, the mail-box is inspected and a message is picked up from it. Then, a fired reactive rule is selected from the agent behavior and the set of associated actions is returned. Selection among proactive rules is also performed, and a set of proactive actions is returned. Finally, a set of actions is chosen and executed. Obviously, more sophisticated strategies for rules selection and actions choice can be taken into a more complete engine. The integration in CaseLP of the compiler for ACLPL and the engines for reactive, proactive and reactive-proactive architecture has still to be completed.


next up previous
Next: Prototype execution Up: Prototype implementation Previous: Extending Prolog to develop

Floriano Zini
Wed Oct 20 15:24:59 GMT+0200 1999