Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue454 - move computation of negated axioms to search component #220

Merged
merged 40 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
851dd3f
Remove negating axioms from translator.
salome-eriksson Feb 6, 2024
83e073a
Add (incomplete) implementation of NegatedAxiomsTask; negating single…
salome-eriksson Feb 6, 2024
f2b0cdb
[issue454] Finished implementation of NegatedAxiomsTask, integrate in…
salome-eriksson Feb 6, 2024
811a226
Reimplement multiplying out negated axioms, including dominance detec…
salome-eriksson Feb 7, 2024
24b6bb3
Remove hardcoded derived variable default value, removed debug output.
salome-eriksson Feb 8, 2024
bff7398
Minor improvements to how datastructures like maps are used, no Proxy…
salome-eriksson Feb 8, 2024
3ff3274
Address small code review comments.
salome-eriksson Feb 8, 2024
6125d3e
Use positive dependencies for sccs as well, explain in comment positi…
salome-eriksson Feb 8, 2024
4242dcc
Try to keep within line length.
salome-eriksson Feb 8, 2024
db05197
[issue454] Restructure and slightly refactor NegatedAxiomsTask code.
salome-eriksson Feb 9, 2024
6911c46
[issue454] uncrustify
salome-eriksson Feb 9, 2024
34fe5d0
[issue454] Fix error in computation of needed negative.
salome-eriksson Feb 9, 2024
69c1872
[issue454] fix style
salome-eriksson Feb 9, 2024
7216ab4
[issue454] Move condition in NegatedAxiom constructor.
salome-eriksson Feb 9, 2024
b774f9e
Address review comments round 1.
salome-eriksson Jul 3, 2024
085d636
Fix bug.
salome-eriksson Jul 4, 2024
c6e2d17
Add option to NegatedAxiomsTask for usnig the trivial overapproximati…
salome-eriksson Jul 4, 2024
5497057
Address review comments round 2.
salome-eriksson Jul 4, 2024
2a7ba56
Small round of cleanup while going over the review comments once more.
salome-eriksson Jul 4, 2024
97c819a
Fix style and extend one comment.
salome-eriksson Jul 4, 2024
ce974b9
Rename positive/negative to nondefault/default.
salome-eriksson Jul 5, 2024
ad93a1b
Renamed file for DefaultValueAxiomsTask.
salome-eriksson Jul 5, 2024
a9e4833
uncrustify
salome-eriksson Jul 5, 2024
edeca8d
special case for negative axiom head no longer necessary
roeger Jul 10, 2024
616f968
needed_negatively and distinction of pos. and neg. necessary literals…
roeger Jul 10, 2024
1c52ef3
simplify verify_layering_condition
roeger Jul 10, 2024
7337db8
merge central main into issue branch
roeger Jul 12, 2024
d193c40
Reinstate const for transform field of heuristic.
salome-eriksson Jul 12, 2024
e650216
Make default value axioms tasks its own cmake library.
salome-eriksson Jul 12, 2024
0f6de99
uncrustify
salome-eriksson Jul 12, 2024
2068ea6
Remove unnecessary std.
salome-eriksson Jul 12, 2024
262e2b2
Change test if axiom sets default value to assert that it does not (a…
salome-eriksson Jul 15, 2024
90b8f2c
Address code review, change option for overapproximating default valu…
salome-eriksson Jul 16, 2024
63188c7
uncrustify
salome-eriksson Jul 16, 2024
896b57e
Add warning about combinatorial explosion to documentation.
salome-eriksson Jul 16, 2024
91a0836
Change variable name to match command line argument name.
salome-eriksson Jul 16, 2024
3206332
remove std
salome-eriksson Jul 16, 2024
0e236a5
Adjust comment in default_value_axioms_task.h
salome-eriksson Jul 17, 2024
93c89da
Move help documentation in CMakeLists on one line.
salome-eriksson Jul 17, 2024
b734bbf
Address code review comments.
salome-eriksson Jul 19, 2024
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
1 change: 1 addition & 0 deletions src/search/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,7 @@ create_fast_downward_library(
SOURCES
tasks/cost_adapted_task
tasks/delegating_task
tasks/negated_axioms_task
salome-eriksson marked this conversation as resolved.
Show resolved Hide resolved
tasks/root_task
CORE_LIBRARY
)
Expand Down
3 changes: 2 additions & 1 deletion src/search/heuristic.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ class Heuristic : public Evaluator {
bool cache_evaluator_values;

// Hold a reference to the task implementation and pass it to objects that need it.
const std::shared_ptr<AbstractTask> task;
// TODO: reinstate const if possible
std::shared_ptr<AbstractTask> task;
salome-eriksson marked this conversation as resolved.
Show resolved Hide resolved
// Use task_proxy to access task information.
TaskProxy task_proxy;

Expand Down
6 changes: 6 additions & 0 deletions src/search/heuristics/cea_heuristic.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "../plugins/plugin.h"

#include "../task_utils/task_properties.h"
#include "../tasks/negated_axioms_task.h"
#include "../utils/logging.h"

#include <cassert>
Expand Down Expand Up @@ -412,6 +413,11 @@ ContextEnhancedAdditiveHeuristic::ContextEnhancedAdditiveHeuristic(
const plugins::Options &opts)
: Heuristic(opts),
min_action_cost(task_properties::get_min_operator_cost(task_proxy)) {
if (task_properties::has_axioms(task_proxy)) {
task = make_shared<tasks::NegatedAxiomsTask>(tasks::NegatedAxiomsTask(task));
task_proxy = TaskProxy(*task);
}
salome-eriksson marked this conversation as resolved.
Show resolved Hide resolved

if (log.is_at_least_normal()) {
log << "Initializing context-enhanced additive heuristic..." << endl;
}
Expand Down
6 changes: 6 additions & 0 deletions src/search/heuristics/cg_heuristic.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#include "../plugins/plugin.h"
#include "../task_utils/task_properties.h"
#include "../tasks/negated_axioms_task.h"
#include "../utils/logging.h"

#include <algorithm>
Expand All @@ -22,6 +23,11 @@ CGHeuristic::CGHeuristic(const plugins::Options &opts)
cache_misses(0),
helpful_transition_extraction_counter(0),
min_action_cost(task_properties::get_min_operator_cost(task_proxy)) {
if (task_properties::has_axioms(task_proxy)) {
task = make_shared<tasks::NegatedAxiomsTask>(tasks::NegatedAxiomsTask(task));
task_proxy = TaskProxy(*task);
}

if (log.is_at_least_normal()) {
log << "Initializing causal graph heuristic..." << endl;
}
Expand Down
6 changes: 6 additions & 0 deletions src/search/heuristics/relaxation_heuristic.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "relaxation_heuristic.h"

#include "../task_utils/task_properties.h"
#include "../tasks/negated_axioms_task.h"
#include "../utils/collections.h"
#include "../utils/logging.h"
#include "../utils/timer.h"
Expand Down Expand Up @@ -37,6 +38,11 @@ UnaryOperator::UnaryOperator(
// construction and destruction
RelaxationHeuristic::RelaxationHeuristic(const plugins::Options &opts)
: Heuristic(opts) {
if (task_properties::has_axioms(task_proxy)) {
task = make_shared<tasks::NegatedAxiomsTask>(tasks::NegatedAxiomsTask(task));
task_proxy = TaskProxy(*task);
}

// Build propositions.
propositions.resize(task_properties::get_num_facts(task_proxy));

Expand Down
10 changes: 9 additions & 1 deletion src/search/landmarks/landmark_heuristic.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
#include "../plugins/plugin.h"
#include "../task_utils/successor_generator.h"
#include "../tasks/cost_adapted_task.h"
#include "../tasks/negated_axioms_task.h"
#include "../tasks/root_task.h"
#include "../task_utils/task_properties.h"
#include "../utils/markup.h"

using namespace std;
Expand All @@ -18,6 +20,10 @@ LandmarkHeuristic::LandmarkHeuristic(
: Heuristic(opts),
use_preferred_operators(opts.get<bool>("pref")),
successor_generator(nullptr) {
if (task_properties::has_axioms(task_proxy)) {
task = make_shared<tasks::NegatedAxiomsTask>(tasks::NegatedAxiomsTask(task));
task_proxy = TaskProxy(*task);
}
}

void LandmarkHeuristic::initialize(const plugins::Options &opts) {
Expand All @@ -26,8 +32,10 @@ void LandmarkHeuristic::initialize(const plugins::Options &opts) {
CostAdaptedTask *of the root task*, but there is currently no good
way to do this, so we use this incomplete, slightly less safe test.
*/
// TODO: update comment and cerr message
salome-eriksson marked this conversation as resolved.
Show resolved Hide resolved
if (task != tasks::g_root_task
&& dynamic_cast<tasks::CostAdaptedTask *>(task.get()) == nullptr) {
&& dynamic_cast<tasks::CostAdaptedTask *>(task.get()) == nullptr
&& dynamic_cast<tasks::NegatedAxiomsTask *>(task.get()) == nullptr) {
cerr << "The landmark heuristics currently only support "
<< "task transformations that modify the operator costs. "
<< "See issues 845 and 686 for details." << endl;
Expand Down
Loading
Loading