Question about nesting quantifiers in effects

21 views
Skip to first unread message

Robert P. Goldman

unread,
May 4, 2012, 4:51:13 PM5/4/12
to Fast Downward
As far as I can tell, fast downward will not allow me to have an
effect of the following form

(forall (?X - foo)
(when (pred ?X)
(forall (?Y - bar)
....)))

I believe that when parsing, effects.py checks to see if a quantified
effect contains either (a) a simple effect or (b) a conditional effect
(line 170).

Would this be difficult to change?

I have a somewhat oddball reason to request this: in my domain, the
nested FORALL in the above example is generated by a macro. This
permits me to put the same code (representing a single ramification)
in multiple places in my PDDL file. If I am forced to lift the nested
quantifier out above the when (which works), then I cannot use a macro
to repeat the same logic in multiple places. This exposes my PDDL
domain to errors that arise from inconsistencies in multiple copies of
the same logic.

If it's trivial to make this modification to FD, so that it
automatically lifts the quantifiers, that would be great.

Actually, if there's a simple modification I can make to my code, I
would appreciate a pointer. Here's the exact example:

(and
(not (authenticated ?U ?O))
(console_user nobody nouid ?O)
(not (console_user ?H ?U ?O))
(and (forall (?HH - c_host) (not (has_session ?HH ?Sess)))
(forall (?PP - c_process) (not (session_process ?Sess ?
PP)))
(forall (?HH - c_human) (not (session_owner ?Sess ?HH))))
(forall (?P - c_process)
(when (session_process ?Sess ?P)
;; this seems to be the problematic line:
(forall (?U - c_uid ?Prog - c_program)
(and (when (euid ?O ?P ?U) (not (euid ?O ?P ?U)))
(when (running_prog ?O ?P ?Prog)
(not (running_prog ?O ?P ?Prog)))
(not (has_process ?O ?P))))))
))

This version parses successfully:
:effect
(and
(not (authenticated ?U ?O))
(console_user nobody nouid ?O)
(not (console_user ?H ?U ?O))
(and (forall (?HH - c_host) (not (has_session ?HH ?Sess)))
(forall (?PP - c_process) (not (session_process ?Sess ?
PP)))
(forall (?HH - c_human) (not (session_owner ?Sess ?HH))))
(forall (?P - c_process ?U - c_uid ?Prog - c_program)
(when (session_process ?Sess ?P)
(and (when (euid ?O ?P ?U) (not (euid ?O ?P ?U)))
(when (running_prog ?O ?P ?Prog)
(not (running_prog ?O ?P ?Prog)))
(not (has_process ?O ?P)))))
))

The logic is that I have a macro that says what it means to kill a
process: remove assertions about its euid, remove the assertion(s)
about the program(s) it runs, and delete it from the list of processes
on a host. I have an operator that kills a session (?Sess), and I
want to quantify over the processes in that session. (Similarly, the
nested conjunction in the above effect is what happens when you expand
the macro that says what it means to kill a session....)

Best,
Robert

Malte Helmert

unread,
May 5, 2012, 8:35:12 AM5/5/12
to fast-d...@googlegroups.com
On 04.05.2012 22:51, Robert P. Goldman wrote:
> As far as I can tell, fast downward will not allow me to have an
> effect of the following form
>
> (forall (?X - foo)
> (when (pred ?X)
> (forall (?Y - bar)
> ....)))
>
> I believe that when parsing, effects.py checks to see if a quantified
> effect contains either (a) a simple effect or (b) a conditional effect
> (line 170).
>
> Would this be difficult to change?

Hi Robert,

I think it should not be difficult to change, and as far as I recally
arbitrarily nested effects worked at some point. So this is a bug. Can
you open an issue in the tracker, attach a domain and problem file and
assign it to me?

I fear that the performance of the planner when faced with constructs of
this kind will be somewhat poor, but don't let this deter you. We'd be
happy to work on performance issues related to this later.

Cheers,

Malte
Reply all
Reply to author
Forward
0 new messages