Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions bdi_extension/anc_eff.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,21 @@ def __hash__(self):
return hash((self.negate_inner_rml, self.hard_bdi, self.agent, tuple(self.nested)))

def negate(self, already_negated: bool=False):
"""Propagate a negation through this BDI term and any nested ones.
- Flip ``hard_bdi``/``possible`` status at every level (mirrors how apply_cond_effs
treats negations when nesting new BDI wrappers).
- Toggle the inner RML negation unless the caller already handled it
(``already_negated=True`` is used when the raw predicate was negated upstream).
- If we have nesting, push the inner-negation marker down to the deepest term so
only one layer carries it, avoiding duplicate `!` flags after nesting/merging.
"""
# Will only be None for NegateOnly terms
if self.hard_bdi is not None:
self.hard_bdi = not self.hard_bdi
# Toggle inner RML negation unless already handled
if not already_negated:
self.negate_inner_rml = not self.negate_inner_rml
# Push inner RML negation to deepest nested term
if self.nested:
for b in self.nested:
b.hard_bdi = not b.hard_bdi
Expand Down
545 changes: 358 additions & 187 deletions bdi_extension/apply_cond_effs.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bdi_extension/bdi-grapevine/domain.pdkbddl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
:derive-condition always
:parameters (?a - agent ?l1 ?l2 - loc)
:precondition (and (at ?a ?l1) (connected ?l1 ?l2))
:effect (and (at ?a ?l2) (!at ?a ?l1))
:effect (and (at ?a ?l2) (not (at ?a ?l1)))
)

(:action share
Expand Down
158 changes: 79 additions & 79 deletions bdi_extension/bdi-grapevine/output_1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,33 @@ INFO translator time limit: None
INFO translator memory limit: None
INFO translator command line string: /usr/bin/python3 /workspace/downward/builds/release/bin/translate/translate.py bdi_extension/bdi-grapevine/pdkb-domain.pddl bdi_extension/bdi-grapevine/pdkb-problem.pddl --invariant-generation-max-time 10 --sas-file output.sas
Parsing...
Parsing: [0.070s CPU, 0.072s wall-clock]
Normalizing task... [0.000s CPU, 0.002s wall-clock]
Parsing: [0.010s CPU, 0.014s wall-clock]
Normalizing task... [0.000s CPU, 0.000s wall-clock]
Instantiating...
Generating Datalog program... [0.000s CPU, 0.001s wall-clock]
Generating Datalog program... [0.000s CPU, 0.000s wall-clock]
Normalizing Datalog program...
Normalizing Datalog program: [0.010s CPU, 0.006s wall-clock]
Preparing model... [0.000s CPU, 0.003s wall-clock]
Generated 445 rules.
Computing model... [0.000s CPU, 0.001s wall-clock]
Normalizing Datalog program: [0.010s CPU, 0.004s wall-clock]
Preparing model... [0.000s CPU, 0.001s wall-clock]
Generated 121 rules.
Computing model... [0.000s CPU, 0.000s wall-clock]
347 relevant atoms
0 auxiliary atoms
347 final queue length
439 total queue pushes
Completing instantiation... [0.010s CPU, 0.003s wall-clock]
Instantiating: [0.020s CPU, 0.014s wall-clock]
435 total queue pushes
Completing instantiation... [0.000s CPU, 0.001s wall-clock]
Instantiating: [0.010s CPU, 0.007s wall-clock]
Computing fact groups...
Finding invariants...
56 initial candidates
Finding invariants: [0.000s CPU, 0.001s wall-clock]
52 initial candidates
Finding invariants: [7.250s CPU, 7.250s wall-clock]
Checking invariant weight... [0.000s CPU, 0.000s wall-clock]
Instantiating groups... [0.000s CPU, 0.000s wall-clock]
Collecting mutex groups... [0.000s CPU, 0.000s wall-clock]
Choosing groups...
38 uncovered facts
Choosing groups: [0.000s CPU, 0.000s wall-clock]
Building translation key... [0.000s CPU, 0.000s wall-clock]
Computing fact groups: [0.000s CPU, 0.002s wall-clock]
Computing fact groups: [7.250s CPU, 7.250s wall-clock]
Building STRIPS to SAS dictionary... [0.000s CPU, 0.000s wall-clock]
Building dictionary for full mutex groups... [0.000s CPU, 0.000s wall-clock]
Building mutex information...
Expand All @@ -44,93 +44,93 @@ Simplifying axioms... [0.000s CPU, 0.000s wall-clock]
Translator axioms removed by simplifying: 0
Processing axioms: [0.000s CPU, 0.000s wall-clock]
Translating task: [0.000s CPU, 0.002s wall-clock]
40 effect conditions simplified
44 effect conditions simplified
0 implied preconditions added
Detecting unreachable propositions...
2 operators removed
0 operators removed
0 axioms removed
32 propositions removed
28 propositions removed
Detecting unreachable propositions: [0.000s CPU, 0.000s wall-clock]
Reordering and filtering variables...
3 of 22 variables necessary.
5 of 24 variables necessary.
0 of 0 mutex groups necessary.
4 of 10 operators necessary.
6 of 12 operators necessary.
0 of 0 axiom rules necessary.
Reordering and filtering variables: [0.000s CPU, 0.000s wall-clock]
Translator variables: 3
Translator variables: 5
Translator derived variables: 0
Translator facts: 6
Translator facts: 10
Translator goal facts: 1
Translator mutex groups: 0
Translator total mutex groups size: 0
Translator operators: 4
Translator operators: 6
Translator axioms: 0
Translator task size: 20
Translator peak memory: 34744 KB
Writing output... [0.000s CPU, 0.001s wall-clock]
Done! [0.090s CPU, 0.095s wall-clock]
Translator task size: 40
Translator peak memory: 204732 KB
Writing output... [0.000s CPU, 0.000s wall-clock]
Done! [7.270s CPU, 7.275s wall-clock]
translate exit code: 0

INFO Running search (release).
INFO search stdin: output.sas
INFO search time limit: 1800s
INFO search memory limit: None
INFO search command line string: /workspace/downward/builds/release/bin/downward --search 'let(hlm,landmark_sum(lm_factory=lm_reasonable_orders_hps(lm_rhw()),transform=adapt_costs(one),pref=false),let(hff,ff(transform=adapt_costs(one)),lazy_greedy([hff,hlm],preferred=[hff,hlm],cost_type=one,reopen_closed=false)))' --internal-plan-file sas_plan < output.sas
[t=0.009325s, 12120 KB] reading input...
[t=0.010080s, 12120 KB] done reading input!
[t=0.014408s, 12384 KB] Initializing landmark sum heuristic...
[t=0.014408s, 12384 KB] Generating landmark graph...
[t=0.014408s, 12384 KB] Building a landmark graph with reasonable orders.
[t=0.014408s, 12384 KB] Initializing Exploration...
[t=0.014408s, 12384 KB] Generating landmarks using the RPG/SAS+ approach
[t=0.014408s, 12384 KB] Landmarks generation time: 0.000000s
[t=0.014408s, 12384 KB] Discovered 2 landmarks, of which 0 are disjunctive and 0 are conjunctive.
[t=0.014408s, 12384 KB] 1 edges
[t=0.014408s, 12384 KB] approx. reasonable orders
[t=0.014408s, 12384 KB] Landmarks generation time: 0.000000s
[t=0.014408s, 12384 KB] Discovered 2 landmarks, of which 0 are disjunctive and 0 are conjunctive.
[t=0.014408s, 12384 KB] 1 edges
[t=0.014408s, 12384 KB] Landmark graph generation time: 0.000000s
[t=0.014408s, 12384 KB] Landmark graph contains 2 landmarks, of which 0 are disjunctive and 0 are conjunctive.
[t=0.014408s, 12384 KB] Landmark graph contains 1 orderings.
[t=0.014408s, 12384 KB] Simplifying 4 unary operators... done! [4 unary operators]
[t=0.014408s, 12384 KB] time to simplify: 0.000000s
[t=0.014408s, 12384 KB] Initializing additive heuristic...
[t=0.014408s, 12384 KB] Initializing FF heuristic...
[t=0.014408s, 12384 KB] Building successor generator...done!
[t=0.014408s, 12384 KB] peak memory difference for successor generator creation: 0 KB
[t=0.014408s, 12384 KB] time for successor generation creation: 0.000000s
[t=0.014408s, 12384 KB] Variables: 3
[t=0.016023s, 12384 KB] FactPairs: 6
[t=0.016023s, 12384 KB] Bytes per state: 4
[t=0.016023s, 12384 KB] Conducting lazy best first search, (real) bound = 2147483647
[t=0.016023s, 12516 KB] New best heuristic value for landmark_sum_heuristic: 1
[t=0.016023s, 12516 KB] New best heuristic value for ff: 2
[t=0.016023s, 12516 KB] g=0, 1 evaluated, 0 expanded
[t=0.016023s, 12516 KB] Initial heuristic value for landmark_sum_heuristic: 1
[t=0.016023s, 12516 KB] Initial heuristic value for ff: 2
[t=0.016023s, 12516 KB] New best heuristic value for ff: 1
[t=0.016023s, 12516 KB] g=1, 2 evaluated, 1 expanded
[t=0.016023s, 12516 KB] Solution found!
[t=0.016023s, 12516 KB] Actual search time: 0.000000s
move_alice_l1_l2 (1)
share_bob_bob_l2 (1)
[t=0.016023s, 12516 KB] Plan length: 2 step(s).
[t=0.016023s, 12516 KB] Plan cost: 2
[t=0.016023s, 12516 KB] Expanded 2 state(s).
[t=0.016023s, 12516 KB] Reopened 0 state(s).
[t=0.016023s, 12516 KB] Evaluated 3 state(s).
[t=0.016023s, 12516 KB] Evaluations: 6
[t=0.016023s, 12516 KB] Generated 6 state(s).
[t=0.016023s, 12516 KB] Dead ends: 0 state(s).
[t=0.016023s, 12516 KB] Number of registered states: 3
[t=0.016023s, 12516 KB] Int hash set load factor: 3/4 = 0.750000
[t=0.016023s, 12516 KB] Int hash set resizes: 2
[t=0.016023s, 12516 KB] Search time: 0.000000s
[t=0.016023s, 12516 KB] Total time: 0.016023s
[t=0.011972s, 12120 KB] reading input...
[t=0.012843s, 12120 KB] done reading input!
[t=0.017844s, 12384 KB] Initializing landmark sum heuristic...
[t=0.017844s, 12384 KB] Generating landmark graph...
[t=0.017844s, 12384 KB] Building a landmark graph with reasonable orders.
[t=0.017844s, 12384 KB] Initializing Exploration...
[t=0.017844s, 12384 KB] Generating landmarks using the RPG/SAS+ approach
[t=0.017844s, 12384 KB] Landmarks generation time: 0.000000s
[t=0.017844s, 12384 KB] Discovered 2 landmarks, of which 0 are disjunctive and 0 are conjunctive.
[t=0.017844s, 12384 KB] 1 edges
[t=0.017844s, 12384 KB] approx. reasonable orders
[t=0.017844s, 12384 KB] Landmarks generation time: 0.000000s
[t=0.017844s, 12384 KB] Discovered 2 landmarks, of which 0 are disjunctive and 0 are conjunctive.
[t=0.017844s, 12384 KB] 1 edges
[t=0.017844s, 12384 KB] Landmark graph generation time: 0.000000s
[t=0.017844s, 12384 KB] Landmark graph contains 2 landmarks, of which 0 are disjunctive and 0 are conjunctive.
[t=0.017844s, 12384 KB] Landmark graph contains 1 orderings.
[t=0.017844s, 12384 KB] Simplifying 10 unary operators... done! [10 unary operators]
[t=0.017844s, 12384 KB] time to simplify: 0.000000s
[t=0.017844s, 12384 KB] Initializing additive heuristic...
[t=0.017844s, 12384 KB] Initializing FF heuristic...
[t=0.017844s, 12384 KB] Building successor generator...done!
[t=0.017844s, 12384 KB] peak memory difference for successor generator creation: 0 KB
[t=0.017844s, 12384 KB] time for successor generation creation: 0.000000s
[t=0.017844s, 12384 KB] Variables: 5
[t=0.017844s, 12384 KB] FactPairs: 10
[t=0.017844s, 12384 KB] Bytes per state: 4
[t=0.017844s, 12384 KB] Conducting lazy best first search, (real) bound = 2147483647
[t=0.017844s, 12520 KB] New best heuristic value for landmark_sum_heuristic: 1
[t=0.017844s, 12520 KB] New best heuristic value for ff: 2
[t=0.017844s, 12520 KB] g=0, 1 evaluated, 0 expanded
[t=0.017844s, 12520 KB] Initial heuristic value for landmark_sum_heuristic: 1
[t=0.017844s, 12520 KB] Initial heuristic value for ff: 2
[t=0.017844s, 12520 KB] New best heuristic value for ff: 1
[t=0.017844s, 12520 KB] g=1, 2 evaluated, 1 expanded
[t=0.017844s, 12520 KB] Solution found!
[t=0.017844s, 12520 KB] Actual search time: 0.000000s
move_bob_l2_l1 (1)
share_bob_bob_l1 (1)
[t=0.017844s, 12520 KB] Plan length: 2 step(s).
[t=0.017844s, 12520 KB] Plan cost: 2
[t=0.017844s, 12520 KB] Expanded 2 state(s).
[t=0.017844s, 12520 KB] Reopened 0 state(s).
[t=0.017844s, 12520 KB] Evaluated 3 state(s).
[t=0.017844s, 12520 KB] Evaluations: 6
[t=0.017844s, 12520 KB] Generated 6 state(s).
[t=0.017844s, 12520 KB] Dead ends: 0 state(s).
[t=0.017844s, 12520 KB] Number of registered states: 3
[t=0.017844s, 12520 KB] Int hash set load factor: 3/4 = 0.750000
[t=0.017844s, 12520 KB] Int hash set resizes: 2
[t=0.017844s, 12520 KB] Search time: 0.000000s
[t=0.017844s, 12520 KB] Total time: 0.017844s
Solution found.
Peak memory: 12516 KB
Peak memory: 12520 KB
Remove intermediate file output.sas
search exit code: 0

INFO Planner time: 0.36s
INFO Planner time: 7.59s
140 changes: 134 additions & 6 deletions bdi_extension/bdi-grapevine/output_10.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,138 @@ INFO translator time limit: None
INFO translator memory limit: None
INFO translator command line string: /usr/bin/python3 /workspace/downward/builds/release/bin/translate/translate.py bdi_extension/bdi-grapevine/pdkb-domain.pddl bdi_extension/bdi-grapevine/pdkb-problem.pddl --invariant-generation-max-time 10 --sas-file output.sas
Parsing...
Parsing domain
Expected a non-empty block starting with any of the following words: :requirements, :types, :constants, :predicates, :functions, :derived, :action
Got: [':agents', 'alice', 'bob', 'cindy', 'derek', 'evelyn']
translate exit code: 31
Parsing: [26.140s CPU, 26.121s wall-clock]
Normalizing task... [1.490s CPU, 1.483s wall-clock]
Instantiating...
Generating Datalog program... [1.050s CPU, 1.067s wall-clock]
Normalizing Datalog program...
Normalizing Datalog program: [0.370s CPU, 0.377s wall-clock]
Preparing model... [1.420s CPU, 1.420s wall-clock]
Generated 54916 rules.
Computing model... [0.190s CPU, 0.192s wall-clock]
140078 relevant atoms
0 auxiliary atoms
140078 final queue length
150674 total queue pushes
Completing instantiation... [1.010s CPU, 1.016s wall-clock]
Instantiating: [4.130s CPU, 4.155s wall-clock]
Computing fact groups...
Finding invariants...
7315 initial candidates
Time limit reached, aborting invariant generation
Finding invariants: [10.150s CPU, 10.146s wall-clock]
Checking invariant weight... [0.030s CPU, 0.032s wall-clock]
Instantiating groups... [0.000s CPU, 0.002s wall-clock]
Collecting mutex groups... [0.000s CPU, 0.002s wall-clock]
Choosing groups...
4029 uncovered facts
Choosing groups: [0.000s CPU, 0.003s wall-clock]
Building translation key... [0.010s CPU, 0.006s wall-clock]
Computing fact groups: [10.220s CPU, 10.215s wall-clock]
Building STRIPS to SAS dictionary... [0.000s CPU, 0.003s wall-clock]
Building dictionary for full mutex groups... [0.000s CPU, 0.002s wall-clock]
Building mutex information...
Building mutex information: [0.000s CPU, 0.003s wall-clock]
Translating task...
Processing axioms...
Simplifying axioms... [0.000s CPU, 0.000s wall-clock]
Translator axioms removed by simplifying: 0
Processing axioms: [0.010s CPU, 0.007s wall-clock]
Translating task: [0.210s CPU, 0.202s wall-clock]
5480 effect conditions simplified
0 implied preconditions added
Detecting unreachable propositions...
0 operators removed
0 axioms removed
6572 propositions removed
Detecting unreachable propositions: [0.050s CPU, 0.049s wall-clock]
Reordering and filtering variables...
20 of 743 variables necessary.
0 of 0 mutex groups necessary.
35 of 35 operators necessary.
0 of 0 axiom rules necessary.
Reordering and filtering variables: [0.010s CPU, 0.019s wall-clock]
Translator variables: 20
Translator derived variables: 0
Translator facts: 40
Translator goal facts: 1
Translator mutex groups: 0
Translator total mutex groups size: 0
Translator operators: 35
Translator axioms: 0
Translator task size: 330
Translator peak memory: 398584 KB
Writing output... [0.000s CPU, 0.001s wall-clock]
Done! [42.260s CPU, 42.263s wall-clock]
translate exit code: 0

Driver aborting after translate
INFO Planner time: 0.23s
INFO Running search (release).
INFO search stdin: output.sas
INFO search time limit: 1800s
INFO search memory limit: None
INFO search command line string: /workspace/downward/builds/release/bin/downward --search 'let(hlm,landmark_sum(lm_factory=lm_reasonable_orders_hps(lm_rhw()),transform=adapt_costs(one),pref=false),let(hff,ff(transform=adapt_costs(one)),lazy_greedy([hff,hlm],preferred=[hff,hlm],cost_type=one,reopen_closed=false)))' --internal-plan-file sas_plan < output.sas
[t=0.011114s, 12120 KB] reading input...
[t=0.011986s, 12120 KB] done reading input!
[t=0.016994s, 12384 KB] Initializing landmark sum heuristic...
[t=0.016994s, 12384 KB] Generating landmark graph...
[t=0.016994s, 12384 KB] Building a landmark graph with reasonable orders.
[t=0.016994s, 12384 KB] Initializing Exploration...
[t=0.016994s, 12384 KB] Generating landmarks using the RPG/SAS+ approach
[t=0.016994s, 12384 KB] Landmarks generation time: 0.000000s
[t=0.016994s, 12384 KB] Discovered 2 landmarks, of which 0 are disjunctive and 0 are conjunctive.
[t=0.016994s, 12384 KB] 1 edges
[t=0.016994s, 12384 KB] approx. reasonable orders
[t=0.016994s, 12384 KB] Landmarks generation time: 0.000000s
[t=0.016994s, 12384 KB] Discovered 2 landmarks, of which 0 are disjunctive and 0 are conjunctive.
[t=0.016994s, 12384 KB] 1 edges
[t=0.016994s, 12384 KB] Landmark graph generation time: 0.000000s
[t=0.016994s, 12384 KB] Landmark graph contains 2 landmarks, of which 0 are disjunctive and 0 are conjunctive.
[t=0.016994s, 12384 KB] Landmark graph contains 1 orderings.
[t=0.016994s, 12384 KB] Simplifying 103 unary operators... done! [98 unary operators]
[t=0.016994s, 12384 KB] time to simplify: 0.000000s
[t=0.016994s, 12384 KB] Initializing additive heuristic...
[t=0.016994s, 12384 KB] Initializing FF heuristic...
[t=0.016994s, 12384 KB] Building successor generator...done!
[t=0.016994s, 12384 KB] peak memory difference for successor generator creation: 0 KB
[t=0.016994s, 12384 KB] time for successor generation creation: 0.000000s
[t=0.016994s, 12384 KB] Variables: 20
[t=0.016994s, 12384 KB] FactPairs: 40
[t=0.016994s, 12384 KB] Bytes per state: 4
[t=0.016994s, 12384 KB] Conducting lazy best first search, (real) bound = 2147483647
[t=0.016994s, 12520 KB] New best heuristic value for landmark_sum_heuristic: 1
[t=0.016994s, 12520 KB] New best heuristic value for ff: 4
[t=0.016994s, 12520 KB] g=0, 1 evaluated, 0 expanded
[t=0.016994s, 12520 KB] Initial heuristic value for landmark_sum_heuristic: 1
[t=0.016994s, 12520 KB] Initial heuristic value for ff: 4
[t=0.016994s, 12520 KB] New best heuristic value for ff: 3
[t=0.016994s, 12520 KB] g=1, 2 evaluated, 1 expanded
[t=0.016994s, 12520 KB] New best heuristic value for ff: 2
[t=0.016994s, 12520 KB] g=2, 3 evaluated, 2 expanded
[t=0.016994s, 12520 KB] New best heuristic value for ff: 1
[t=0.016994s, 12520 KB] g=3, 4 evaluated, 3 expanded
[t=0.016994s, 12520 KB] Solution found!
[t=0.016994s, 12520 KB] Actual search time: 0.000000s
move_evelyn_l1_l2 (1)
move_cindy_l3_l2 (1)
move_alice_l1_l2 (1)
share_alice_alice_l2 (1)
[t=0.016994s, 12520 KB] Plan length: 4 step(s).
[t=0.016994s, 12520 KB] Plan cost: 4
[t=0.016994s, 12520 KB] Expanded 5 state(s).
[t=0.016994s, 12520 KB] Reopened 0 state(s).
[t=0.016994s, 12520 KB] Evaluated 6 state(s).
[t=0.016994s, 12520 KB] Evaluations: 12
[t=0.016994s, 12520 KB] Generated 42 state(s).
[t=0.016994s, 12520 KB] Dead ends: 0 state(s).
[t=0.016994s, 12520 KB] Number of registered states: 6
[t=0.016994s, 12520 KB] Int hash set load factor: 6/8 = 0.750000
[t=0.016994s, 12520 KB] Int hash set resizes: 3
[t=0.016994s, 12520 KB] Search time: 0.000000s
[t=0.016994s, 12520 KB] Total time: 0.016994s
Solution found.
Peak memory: 12520 KB
Remove intermediate file output.sas
search exit code: 0

INFO Planner time: 42.69s
Oh,
Loading