automaton(Location,Vars,Vars0,T0,Time):-
c(Inv),c(Vars,Vars0,T0,Time).
Here, automaton is the name of the automaton itself, and Location represents is the
current location of the automaton. Vars is a list of real variables participating in the
automata, whereas Vars0 is a list of the correspondent initial values. c(Invs) is the
constraint that represents the invariant of the location, and the constraint predicate
c(Vars,Vars0, T0, Time) represents the continuous flows of the variable Vars wrt. time
{T0, Time} , where T0 is the initial time at the start of the continuous flow. The opera-
tional semantics are encode into CLP
evolve
predicate as follows.
evolve(Automaton,(L1,Var1),(L2,Var2),T0,Time,Event) :-
continuous(Automaton,(L1,Var1),(L1,Var2),T0,Time,Event);
discrete(Automaton,(L1,Var1),(L2,Var2),T0,Time,Event).
the
evolve
alternates between
continuous
and
discrete
based on the constraints that
appear during the run, as well as the Event that may occur.
Now, after the automata have been specified, a driver program is needed to coor-
dinate and execute the behaviors of the automata. For this reason, driver predicate is
implemented to do these missions. The last argument of the driver represents symboli-
cally the list of reachable regions.
driver((L1,Var01),(L2,Var02),...,(Ln,Var0n),T0,
[(L1,L2,..,Ln,Var1,Var2,..,Varn,Time,Event)|NextRegion]) :-
automaton1(L1,Var1,Var01,T0,Time1),
automaton2(L2,Var2,Var02,T0,Time2),
... ,
automatonn(Ln,Varn,Var0n,T0,Timen),
Time1 $=Time2, Time1 $=Time3, ..., Time1 $=Timen,
evolve(automaton1,(L1,Var01),(NextL1,Nvar01),T0,Time1,Event),
evolve(automaton2,(L2,Var02),(NextL2,Nvar02),T0,Time1,Event),
... ,
evolve(automatonn,(Ln,Var0n),(NextLn,Nvar0n),T0,Time1,Event),
driver((NextL1,Nvar01),(NextL2,Nvar02),...,(NextLn,Nvar0n),Time1,NextRegion).
To run the program, the driver has to be invoked with a query starting from the initial
states of the hybrid automata. An example, showing how to query the driver on logistic
multi-agent scenario, takes the form:
driver((init1,0),(init2,0),(init3,0),(init4,0),0,Reached).
5 Planning as Reachability Analysis
Now we have an executable constraint based specification, which can be used to ver-
ify several properties of our multi-agent team by means of a reachability analysis. Let
Reached represents the set of reached regions, then in terms of CLP, the reachability
analysis can be generally specified by checking whether
Reached
|=
Ψ
holds, where
Ψ
is the constraint predicate that describes a property of interest.
73