Literal = seqoftoken; State = setof Literal;
Goal = setof Literal;
Action :: name : Literal
pra : setof Literal
add : setof Literal
del : setof Literal;
Planning_Problem :: AS : setof Action
I : State
G : Goal
inv mk_Planning_Problem ( AS, I, G) == forall l inset G &
(l inset I or exists A insetAS & l inset
A.add) and not (G subset I) and forall A insetAS & not (exists p : Literal & p inset A.add and
p inset A.del);
Action_id = token;
Action_instances = map Action_id to Action;
Arc ::
source : Action_id
dest : Action_id;
Bounded_Poset = setof Arc inv p == forall x, y inset get_nodes(p) & not (before(x, y, p) and before(y, x, p)) and
x <> mk_token("pinit") => before(mk_token("pinit"), x, p) and
x <> mk_token("goal") => before(x, mk_token("goal"), p);
Goal_instance ::
gl : Literal
ai : Action_id;
Goal_instances = setof Goal_instance
state Partial_Plan of
pp: Planning_Problem
Os: Action_instances
Ts: Bounded_Poset
Ps: Goal_instances As: Goal_instances inv mk_Partial_Plan(pp, Os, Ts, Ps, As)==
(Os(mk_token("pinit")) = mk_Action([mk_token("pinit")], { }, pp.I, { })) and
(Os(mk_token("goal")) = mk_Action([mk_token("goal")], pp.G, { }, { })) and rng Os subset pp.ASunion {Os(mk_token("pinit")), Os(mk_token("goal"))} and dom Os = get_nodes(Ts) and Asinter Ps = {} and forall A insetdom Os & (forall p inset Os(A).pra &
mk_Goal_instance(p, A) inset (Ps unionAs)) and forall gi insetAs & exists A insetdom Os & achieve(Os, Ts, A, gi) end
functions
get_nodes : setof Arc -> setof Action_id
get_nodes(p) ==
{a.source | a inset p} union {a.dest | a inset p};
before : Action_id * Action_id * setof Arc -> bool
before(x, z, p) ==
mk_Arc(x, z) inset p or exists y inset get_nodes(p) & before(x, y, p) and before(y, z, p);
add_node : Action_id * Bounded_Poset -> Bounded_Poset
add_node(u, p) ==
p union {mk_Arc(mk_token("pinit"), u), mk_Arc(u, mk_token("goal"))};
make_before : Action_id * Action_id * Bounded_Poset -> Bounded_Poset
make_before(u, v, p) == if possibly_before(u, v, p) and {u, v} subset get_nodes(p) then p union {mk_Arc(u, v)} else p;
newid(isa : setof Action_id) i: Action_id post i notinset isa;
achieve : Action_instances * Bounded_Poset * Action_id * Goal_instance -> bool
achieve(Os, Ts, A, mk_Goal_instance(p, O)) ==
before(A, O, Ts) and
p inset Os(A).add and not (exists C insetdom Os &
possibly_before(C, O, Ts) and
possibly_before(A, C, Ts) and
p inset Os(C).del);
declobber:Action_instances * Bounded_Poset * Action_id * Goal_instance -> bool
declobber(Os, Ts, NewA, mk_Goal_instance(q, C)) ==
before(C, NewA, Ts) or not(q inset Os(NewA).del) or exists W insetdom Os &
(before(NewA, W, Ts) and
before(W, C, Ts) and
q inset Os(W).add)
operations
INIT (ppi : Planning_Problem) extwr pp : Planning_Problem wr Os : Action_instances wr Ts : Bounded_Poset wr Ps : Goal_instances wrAs : Goal_instances post pp = ppi and
Os = {mk_token("pinit") |-> mk_Action([mk_token("pinit")], { },
ppi.I, { }),
mk_token("goal") |->
mk_Action([mk_token ("goal")], ppi.G, { }, { })} and
Ts = initposet( ) and
Ps = {mk_Goal_instance(g, mk_token("goal")) | g inset ppi.G} and As = { };
ACHIEVE_1(gi : Goal_instance) extrd Os : Action_instances wr Ts : Bounded_Poset wr Ps : Goal_instances wrAs : Goal_instances pre gi inset Ps postexists A insetdom Os & achieve(Os, Ts, A, gi) and
completion_of (Ts, Ts~) and
Ps = Ps~ \{gi} and As = As~ union {gi};
ACHIEVE_2(gi: Goal_instance) extrd pp : Planning_Problem wr Os : Action_instances wr Ts : Bounded_Poset wr Ps : Goal_instances wrAs : Goal_instances pre gi inset Ps postlet NewA = newid(dom Os~) in exists A inset pp.AS & Os = Os~ ++ {NewA |-> A} and
achieve(Os, Ts, NewA, gi) and forall gj insetAs~ & declobber(Os, Ts, NewA, gj) and
completion_of(Ts, add_node(NewA, Ts~)) and
Ps = (Ps~ \ {gi}) union {mk_Goal_instance(p, NewA) | p inset A.pra} and As = As~ union {gi}
\end{vdm_al}
¤ Dauer der Verarbeitung: 0.14 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.