Skip to content

Commit

Permalink
rename get_identifier to get_index
Browse files Browse the repository at this point in the history
  • Loading branch information
drexlerd committed Aug 11, 2024
1 parent 0adf2d0 commit a94296a
Show file tree
Hide file tree
Showing 49 changed files with 129 additions and 129 deletions.
2 changes: 1 addition & 1 deletion benchmarks/iterate_atoms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ struct AtomAccessResult

static AtomAccessResult access_atom_data(const loki::Atom& atom)
{
const auto atom_identifier = atom->get_identifier();
const auto atom_identifier = atom->get_index();
const auto atom_predicate = atom->get_predicate();
auto atom_terms = loki::TermList();
for (const auto& term : atom->get_terms())
Expand Down
2 changes: 1 addition & 1 deletion include/loki/details/pddl/action.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class ActionImpl : public Base<ActionImpl>
std::optional<Condition> m_condition;
std::optional<Effect> m_effect;

ActionImpl(size_t identifier,
ActionImpl(size_t index,
std::string name,
size_t original_arity,
ParameterList parameters,
Expand Down
2 changes: 1 addition & 1 deletion include/loki/details/pddl/atom.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class AtomImpl : public Base<AtomImpl>
Predicate m_predicate;
TermList m_terms;

AtomImpl(size_t identifier, Predicate predicate, TermList terms);
AtomImpl(size_t index, Predicate predicate, TermList terms);

// Give access to the constructor.
friend class UniqueValueTypeFactory<AtomImpl, Hash<const AtomImpl*, true>, EqualTo<const AtomImpl*, true>>;
Expand Down
2 changes: 1 addition & 1 deletion include/loki/details/pddl/axiom.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class AxiomImpl : public Base<AxiomImpl>
Condition m_condition;
size_t m_num_parameters_to_ground_head;

AxiomImpl(size_t identifier, std::string derived_predicate_name, ParameterList parameters, Condition condition, size_t num_parameters_to_ground_head);
AxiomImpl(size_t index, std::string derived_predicate_name, ParameterList parameters, Condition condition, size_t num_parameters_to_ground_head);

// Give access to the constructor.
friend class UniqueValueTypeFactory<AxiomImpl, Hash<const AxiomImpl*, true>, EqualTo<const AxiomImpl*, true>>;
Expand Down
10 changes: 5 additions & 5 deletions include/loki/details/pddl/base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ template<typename Derived>
class Base
{
protected:
size_t m_identifier;
size_t m_index;

explicit Base(size_t identifier) : m_identifier(identifier) {}
explicit Base(size_t index) : m_index(index) {}
friend Derived;

public:
Expand All @@ -72,9 +72,9 @@ class Base

bool operator!=(const Base& other) const { return !(*this == other); }

bool operator<(const Base& other) const { return m_identifier < other.m_identifier; }
bool operator<(const Base& other) const { return m_index < other.m_index; }

bool operator>(const Base& other) const { return m_identifier > other.m_identifier; }
bool operator>(const Base& other) const { return m_index > other.m_index; }

size_t hash() const { return self().hash_impl(); }

Expand All @@ -98,7 +98,7 @@ class Base
}

/// @brief Returns the identifier
size_t get_identifier() const { return m_identifier; }
size_t get_index() const { return m_index; }
};

}
Expand Down
14 changes: 7 additions & 7 deletions include/loki/details/pddl/conditions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class ConditionLiteralImpl : public Base<ConditionLiteralImpl>
private:
Literal m_literal;

ConditionLiteralImpl(size_t identifier, Literal literal);
ConditionLiteralImpl(size_t index, Literal literal);

// Give access to the constructor.
friend class UniqueValueTypeFactory<ConditionImpl, Hash<const ConditionImpl*, true>, EqualTo<const ConditionImpl*, true>>;
Expand All @@ -55,7 +55,7 @@ class ConditionAndImpl : public Base<ConditionAndImpl>
private:
ConditionList m_conditions;

ConditionAndImpl(size_t identifier, ConditionList conditions);
ConditionAndImpl(size_t index, ConditionList conditions);

// Give access to the constructor.
friend class UniqueValueTypeFactory<ConditionImpl, Hash<const ConditionImpl*, true>, EqualTo<const ConditionImpl*, true>>;
Expand All @@ -77,7 +77,7 @@ class ConditionOrImpl : public Base<ConditionOrImpl>
private:
ConditionList m_conditions;

ConditionOrImpl(size_t identifier, ConditionList conditions);
ConditionOrImpl(size_t index, ConditionList conditions);

// Give access to the constructor.
friend class UniqueValueTypeFactory<ConditionImpl, Hash<const ConditionImpl*, true>, EqualTo<const ConditionImpl*, true>>;
Expand All @@ -99,7 +99,7 @@ class ConditionNotImpl : public Base<ConditionNotImpl>
private:
Condition m_condition;

ConditionNotImpl(size_t identifier, Condition condition);
ConditionNotImpl(size_t index, Condition condition);

// Give access to the constructor.
friend class UniqueValueTypeFactory<ConditionImpl, Hash<const ConditionImpl*, true>, EqualTo<const ConditionImpl*, true>>;
Expand All @@ -122,7 +122,7 @@ class ConditionImplyImpl : public Base<ConditionImplyImpl>
Condition m_condition_left;
Condition m_condition_right;

ConditionImplyImpl(size_t identifier, Condition condition_left, Condition condition_right);
ConditionImplyImpl(size_t index, Condition condition_left, Condition condition_right);

// Give access to the constructor.
friend class UniqueValueTypeFactory<ConditionImpl, Hash<const ConditionImpl*, true>, EqualTo<const ConditionImpl*, true>>;
Expand All @@ -146,7 +146,7 @@ class ConditionExistsImpl : public Base<ConditionExistsImpl>
ParameterList m_parameters;
Condition m_condition;

ConditionExistsImpl(size_t identifier, ParameterList parameters, Condition condition);
ConditionExistsImpl(size_t index, ParameterList parameters, Condition condition);

// Give access to the constructor.
friend class UniqueValueTypeFactory<ConditionImpl, Hash<const ConditionImpl*, true>, EqualTo<const ConditionImpl*, true>>;
Expand All @@ -170,7 +170,7 @@ class ConditionForallImpl : public Base<ConditionForallImpl>
ParameterList m_parameters;
Condition m_condition;

ConditionForallImpl(size_t identifier, ParameterList parameters, Condition condition);
ConditionForallImpl(size_t index, ParameterList parameters, Condition condition);

// Give access to the constructor.
friend class UniqueValueTypeFactory<ConditionImpl, Hash<const ConditionImpl*, true>, EqualTo<const ConditionImpl*, true>>;
Expand Down
2 changes: 1 addition & 1 deletion include/loki/details/pddl/domain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class DomainImpl : public Base<DomainImpl>
ActionList m_actions;
AxiomList m_axioms;

DomainImpl(size_t identifier,
DomainImpl(size_t index,
std::optional<fs::path> filepath,
std::string name,
Requirements requirements,
Expand Down
10 changes: 5 additions & 5 deletions include/loki/details/pddl/effects.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class EffectLiteralImpl : public Base<EffectLiteralImpl>
private:
Literal m_literal;

EffectLiteralImpl(size_t identifier, Literal literal);
EffectLiteralImpl(size_t index, Literal literal);

// Give access to the constructor.
friend class UniqueValueTypeFactory<EffectImpl, Hash<const EffectImpl*, true>, EqualTo<const EffectImpl*, true>>;
Expand All @@ -66,7 +66,7 @@ class EffectAndImpl : public Base<EffectAndImpl>
private:
EffectList m_effects;

EffectAndImpl(size_t identifier, EffectList effects);
EffectAndImpl(size_t index, EffectList effects);

// Give access to the constructor.
friend class UniqueValueTypeFactory<EffectImpl, Hash<const EffectImpl*, true>, EqualTo<const EffectImpl*, true>>;
Expand All @@ -90,7 +90,7 @@ class EffectNumericImpl : public Base<EffectNumericImpl>
Function m_function;
FunctionExpression m_function_expression;

EffectNumericImpl(size_t identifier, AssignOperatorEnum assign_operator, Function function, FunctionExpression function_expression);
EffectNumericImpl(size_t index, AssignOperatorEnum assign_operator, Function function, FunctionExpression function_expression);

// Give access to the constructor.
friend class UniqueValueTypeFactory<EffectImpl, Hash<const EffectImpl*, true>, EqualTo<const EffectImpl*, true>>;
Expand All @@ -115,7 +115,7 @@ class EffectConditionalForallImpl : public Base<EffectConditionalForallImpl>
ParameterList m_parameters;
Effect m_effect;

EffectConditionalForallImpl(size_t identifier, ParameterList parameters, Effect effect);
EffectConditionalForallImpl(size_t index, ParameterList parameters, Effect effect);

// Give access to the constructor.
friend class UniqueValueTypeFactory<EffectImpl, Hash<const EffectImpl*, true>, EqualTo<const EffectImpl*, true>>;
Expand All @@ -139,7 +139,7 @@ class EffectConditionalWhenImpl : public Base<EffectConditionalWhenImpl>
Condition m_condition;
Effect m_effect;

EffectConditionalWhenImpl(size_t identifier, Condition condition, Effect effect);
EffectConditionalWhenImpl(size_t index, Condition condition, Effect effect);

// Give access to the constructor.
friend class UniqueValueTypeFactory<EffectImpl, Hash<const EffectImpl*, true>, EqualTo<const EffectImpl*, true>>;
Expand Down
2 changes: 1 addition & 1 deletion include/loki/details/pddl/function.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class FunctionImpl : public Base<FunctionImpl>
FunctionSkeleton m_function_skeleton;
TermList m_terms;

FunctionImpl(size_t identifier, FunctionSkeleton function_skeleton, TermList terms);
FunctionImpl(size_t index, FunctionSkeleton function_skeleton, TermList terms);

// Give access to the constructor.
friend class UniqueValueTypeFactory<FunctionImpl, Hash<const FunctionImpl*, true>, EqualTo<const FunctionImpl*, true>>;
Expand Down
10 changes: 5 additions & 5 deletions include/loki/details/pddl/function_expressions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class FunctionExpressionNumberImpl : public Base<FunctionExpressionNumberImpl>
private:
double m_number;

FunctionExpressionNumberImpl(size_t identifier, double number);
FunctionExpressionNumberImpl(size_t index, double number);

// Give access to the constructor.
friend class UniqueValueTypeFactory<FunctionExpressionImpl, Hash<const FunctionExpressionImpl*, true>, EqualTo<const FunctionExpressionImpl*, true>>;
Expand All @@ -76,7 +76,7 @@ class FunctionExpressionBinaryOperatorImpl : public Base<FunctionExpressionBinar
FunctionExpression m_left_function_expression;
FunctionExpression m_right_function_expression;

FunctionExpressionBinaryOperatorImpl(size_t identifier,
FunctionExpressionBinaryOperatorImpl(size_t index,
BinaryOperatorEnum binary_operator,
FunctionExpression left_function_expression,
FunctionExpression right_function_expression);
Expand Down Expand Up @@ -104,7 +104,7 @@ class FunctionExpressionMultiOperatorImpl : public Base<FunctionExpressionMultiO
MultiOperatorEnum m_multi_operator;
FunctionExpressionList m_function_expressions;

FunctionExpressionMultiOperatorImpl(size_t identifier, MultiOperatorEnum multi_operator, FunctionExpressionList function_expressions);
FunctionExpressionMultiOperatorImpl(size_t index, MultiOperatorEnum multi_operator, FunctionExpressionList function_expressions);

// Give access to the constructor.
friend class UniqueValueTypeFactory<FunctionExpressionImpl, Hash<const FunctionExpressionImpl*, true>, EqualTo<const FunctionExpressionImpl*, true>>;
Expand All @@ -127,7 +127,7 @@ class FunctionExpressionMinusImpl : public Base<FunctionExpressionMinusImpl>
private:
FunctionExpression m_function_expression;

FunctionExpressionMinusImpl(size_t identifier, FunctionExpression function_expression);
FunctionExpressionMinusImpl(size_t index, FunctionExpression function_expression);

// Give access to the constructor.
friend class UniqueValueTypeFactory<FunctionExpressionImpl, Hash<const FunctionExpressionImpl*, true>, EqualTo<const FunctionExpressionImpl*, true>>;
Expand All @@ -149,7 +149,7 @@ class FunctionExpressionFunctionImpl : public Base<FunctionExpressionFunctionImp
private:
Function m_function;

FunctionExpressionFunctionImpl(size_t identifier, Function function);
FunctionExpressionFunctionImpl(size_t index, Function function);

// Give access to the constructor.
friend class UniqueValueTypeFactory<FunctionExpressionImpl, Hash<const FunctionExpressionImpl*, true>, EqualTo<const FunctionExpressionImpl*, true>>;
Expand Down
2 changes: 1 addition & 1 deletion include/loki/details/pddl/function_skeleton.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class FunctionSkeletonImpl : public Base<FunctionSkeletonImpl>
ParameterList m_parameters;
Type m_type;

FunctionSkeletonImpl(size_t identifier, std::string name, ParameterList parameters, Type type);
FunctionSkeletonImpl(size_t index, std::string name, ParameterList parameters, Type type);

// Give access to the constructor.
friend class UniqueValueTypeFactory<FunctionSkeletonImpl, Hash<const FunctionSkeletonImpl*, true>, EqualTo<const FunctionSkeletonImpl*, true>>;
Expand Down
2 changes: 1 addition & 1 deletion include/loki/details/pddl/literal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class LiteralImpl : public Base<LiteralImpl>
bool m_is_negated;
Atom m_atom;

LiteralImpl(size_t identifier, bool is_negated, Atom atom);
LiteralImpl(size_t index, bool is_negated, Atom atom);

// Give access to the constructor.
friend class UniqueValueTypeFactory<LiteralImpl, Hash<const LiteralImpl*, true>, EqualTo<const LiteralImpl*, true>>;
Expand Down
2 changes: 1 addition & 1 deletion include/loki/details/pddl/metric.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class OptimizationMetricImpl : public Base<OptimizationMetricImpl>
OptimizationMetricEnum m_optimization_metric;
FunctionExpression m_function_expression;

OptimizationMetricImpl(size_t identifier, OptimizationMetricEnum optimization_metric, FunctionExpression function_expression);
OptimizationMetricImpl(size_t index, OptimizationMetricEnum optimization_metric, FunctionExpression function_expression);

// Give access to the constructor.
friend class UniqueValueTypeFactory<OptimizationMetricImpl, Hash<const OptimizationMetricImpl*, true>, EqualTo<const OptimizationMetricImpl*, true>>;
Expand Down
2 changes: 1 addition & 1 deletion include/loki/details/pddl/numeric_fluent.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class NumericFluentImpl : public Base<NumericFluentImpl>
// Give access to the constructor.
friend class UniqueValueTypeFactory<NumericFluentImpl, Hash<const NumericFluentImpl*, true>, EqualTo<const NumericFluentImpl*, true>>;

NumericFluentImpl(size_t identifier, Function function, double number);
NumericFluentImpl(size_t index, Function function, double number);

/// @brief Test for semantic equivalence
bool is_structurally_equivalent_to_impl(const NumericFluentImpl& other) const;
Expand Down
2 changes: 1 addition & 1 deletion include/loki/details/pddl/object.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class ObjectImpl : public Base<ObjectImpl>
std::string m_name;
TypeList m_types;

ObjectImpl(size_t identifier, std::string name, TypeList types = {});
ObjectImpl(size_t index, std::string name, TypeList types = {});

// Give access to the constructor.
friend class UniqueValueTypeFactory<ObjectImpl, Hash<const ObjectImpl*, true>, EqualTo<const ObjectImpl*, true>>;
Expand Down
2 changes: 1 addition & 1 deletion include/loki/details/pddl/parameter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class ParameterImpl : public Base<ParameterImpl>
Variable m_variable;
TypeList m_types;

ParameterImpl(size_t identifier, Variable variable, TypeList types);
ParameterImpl(size_t index, Variable variable, TypeList types);

// Give access to the constructor.
friend class UniqueValueTypeFactory<ParameterImpl, Hash<const ParameterImpl*, true>, EqualTo<const ParameterImpl*, true>>;
Expand Down
2 changes: 1 addition & 1 deletion include/loki/details/pddl/predicate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class PredicateImpl : public Base<PredicateImpl>
std::string m_name;
ParameterList m_parameters;

PredicateImpl(size_t identifier, std::string name, ParameterList parameters);
PredicateImpl(size_t index, std::string name, ParameterList parameters);

// Give access to the constructor.
friend class UniqueValueTypeFactory<PredicateImpl, Hash<const PredicateImpl*, true>, EqualTo<const PredicateImpl*, true>>;
Expand Down
2 changes: 1 addition & 1 deletion include/loki/details/pddl/problem.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class ProblemImpl : public Base<ProblemImpl>
std::optional<OptimizationMetric> m_optimization_metric;
AxiomList m_axioms;

ProblemImpl(size_t identifier,
ProblemImpl(size_t index,
std::optional<fs::path> filepath,
Domain domain,
std::string name,
Expand Down
2 changes: 1 addition & 1 deletion include/loki/details/pddl/requirements.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class RequirementsImpl : public Base<RequirementsImpl>
private:
RequirementEnumSet m_requirements;

RequirementsImpl(size_t identifier, RequirementEnumSet requirements);
RequirementsImpl(size_t index, RequirementEnumSet requirements);

// Give access to the constructor.
friend class UniqueValueTypeFactory<RequirementsImpl, Hash<const RequirementsImpl*, true>, EqualTo<const RequirementsImpl*, true>>;
Expand Down
4 changes: 2 additions & 2 deletions include/loki/details/pddl/term.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class TermObjectImpl : public Base<TermObjectImpl>
private:
Object m_object;

TermObjectImpl(size_t identifier, Object object);
TermObjectImpl(size_t index, Object object);

// Give access to the constructor.
friend class UniqueValueTypeFactory<TermImpl, Hash<const TermImpl*, true>, EqualTo<const TermImpl*, true>>;
Expand All @@ -53,7 +53,7 @@ class TermVariableImpl : public Base<TermVariableImpl>
private:
Variable m_variable;

TermVariableImpl(size_t identifier, Variable variable);
TermVariableImpl(size_t index, Variable variable);

// Give access to the constructor.
friend class UniqueValueTypeFactory<TermImpl, Hash<const TermImpl*, true>, EqualTo<const TermImpl*, true>>;
Expand Down
2 changes: 1 addition & 1 deletion include/loki/details/pddl/type.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class TypeImpl : public Base<TypeImpl>
std::string m_name;
TypeList m_bases;

TypeImpl(size_t identifier, std::string name, TypeList bases = {});
TypeImpl(size_t index, std::string name, TypeList bases = {});

// Give access to the constructor.
friend class UniqueValueTypeFactory<TypeImpl, Hash<const TypeImpl*, true>, EqualTo<const TypeImpl*, true>>;
Expand Down
2 changes: 1 addition & 1 deletion include/loki/details/pddl/variable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class VariableImpl : public Base<VariableImpl>
private:
std::string m_name;

VariableImpl(size_t identifier, std::string name);
VariableImpl(size_t index, std::string name);

// Give access to the constructor.
friend class UniqueValueTypeFactory<VariableImpl, Hash<const VariableImpl*, true>, EqualTo<const VariableImpl*, true>>;
Expand Down
2 changes: 1 addition & 1 deletion include/loki/details/pddl/visitors.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ struct LessComparatorVisitor
template<typename T1, typename T2>
bool operator()(const T1& object_left, const T2& object_right) const
{
return object_left.get_identifier() < object_right.get_identifier();
return object_left.get_index() < object_right.get_index();
}
};

Expand Down
Loading

0 comments on commit a94296a

Please sign in to comment.