1#ifndef LANDMARKS_LANDMARK_FACTORY_ZHU_GIVAN_H
2#define LANDMARKS_LANDMARK_FACTORY_ZHU_GIVAN_H
4#include "downward/landmarks/landmark_factory_relaxation.h"
6#include "downward/utils/hash.h"
8#include <unordered_set>
13using lm_set = utils::HashSet<FactPair>;
15class LandmarkFactoryZhuGivan :
public LandmarkFactoryRelaxation {
16 class plan_graph_node {
19 inline bool reached()
const
23 return !labels.empty();
27 using PropositionLayer = std::vector<std::vector<plan_graph_node>>;
29 const bool use_orders;
33 std::vector<std::vector<std::vector<int>>> triggers;
35 void compute_triggers(
const TaskProxy& task_proxy);
38 std::vector<int> operators_without_preconditions;
40 bool operator_applicable(
41 const AxiomOrOperatorProxy& op,
42 const PropositionLayer& state)
const;
44 bool operator_cond_effect_fires(
45 const EffectConditionsProxy& effect_conditions,
46 const PropositionLayer& layer)
const;
52 lm_set apply_operator_and_propagate_labels(
53 const AxiomOrOperatorProxy& op,
54 const PropositionLayer& current,
55 PropositionLayer& next)
const;
59 lm_set union_of_precondition_labels(
60 const AxiomOrOperatorProxy& op,
61 const PropositionLayer& current)
const;
65 lm_set union_of_condition_labels(
66 const EffectConditionsProxy& effect_conditions,
67 const PropositionLayer& current)
const;
72 build_relaxed_plan_graph_with_labels(
const TaskProxy& task_proxy)
const;
76 void extract_landmarks(
77 const TaskProxy& task_proxy,
78 const PropositionLayer& last_prop_layer);
81 void add_operator_to_triggers(
const AxiomOrOperatorProxy& op);
83 virtual void generate_relaxed_landmarks(
84 const std::shared_ptr<AbstractTask>& task,
85 Exploration& exploration)
override;
88 LandmarkFactoryZhuGivan(
bool use_orders, utils::Verbosity verbosity);
90 virtual bool supports_conditional_effects()
const override;