Fixed incorrect derived predicate IDs in problems.
The IDs of derived predicates within problems were accidentally starting with 1 again, colliding with the IDs of derived predicates in the domain. With this fix, the IDs are continuously incremented, even after switching from domain to problem.
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
|
||||
#include <pddl/ASTForward.h>
|
||||
#include <pddl/Context.h>
|
||||
#include <pddl/NormalizedASTForward.h>
|
||||
#include <pddl/detail/normalization/NormalizationContext.h>
|
||||
|
||||
namespace pddl
|
||||
{
|
||||
@@ -16,7 +16,7 @@ namespace detail
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
normalizedAST::ActionPointer normalize(ast::ActionPointer &&domain, normalizedAST::DerivedPredicateDeclarations &derivedPredicates);
|
||||
normalizedAST::ActionPointer normalize(ast::ActionPointer &&domain, NormalizationContext &normalizationContext);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
@@ -3,7 +3,7 @@
|
||||
|
||||
#include <pddl/ASTForward.h>
|
||||
#include <pddl/Context.h>
|
||||
#include <pddl/NormalizedASTForward.h>
|
||||
#include <pddl/detail/normalization/NormalizationContext.h>
|
||||
|
||||
namespace pddl
|
||||
{
|
||||
@@ -16,7 +16,7 @@ namespace detail
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
normalizedAST::Effect normalize(ast::Effect &&effect, normalizedAST::DerivedPredicateDeclarations &derivedPredicates);
|
||||
normalizedAST::Effect normalize(ast::Effect &&effect, detail::NormalizationContext &normalizationContext);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
@@ -0,0 +1,33 @@
|
||||
#ifndef __PDDL__DETAIL__NORMALIZATION__NORMALIZATION_CONTEXT_H
|
||||
#define __PDDL__DETAIL__NORMALIZATION__NORMALIZATION_CONTEXT_H
|
||||
|
||||
#include <pddl/NormalizedASTForward.h>
|
||||
|
||||
namespace pddl
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// NormalizationContext
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
struct NormalizationContext
|
||||
{
|
||||
NormalizationContext(normalizedAST::DerivedPredicateDeclarations &derivedPredicates)
|
||||
: derivedPredicates{derivedPredicates}
|
||||
{
|
||||
}
|
||||
|
||||
normalizedAST::DerivedPredicateDeclarations &derivedPredicates;
|
||||
size_t derivedPredicateIDStart = 1;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
@@ -3,7 +3,7 @@
|
||||
|
||||
#include <pddl/ASTForward.h>
|
||||
#include <pddl/Context.h>
|
||||
#include <pddl/NormalizedASTForward.h>
|
||||
#include <pddl/detail/normalization/NormalizationContext.h>
|
||||
|
||||
namespace pddl
|
||||
{
|
||||
@@ -16,7 +16,7 @@ namespace detail
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
normalizedAST::Precondition normalize(ast::Precondition &&precondition, normalizedAST::DerivedPredicateDeclarations &derivedPredicates);
|
||||
normalizedAST::Precondition normalize(ast::Precondition &&precondition, detail::NormalizationContext &normalizationContext);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
Reference in New Issue
Block a user