-
Notifications
You must be signed in to change notification settings - Fork 2
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
Implement unambiguous mapping for deterministic compiler #265
base: main
Are you sure you want to change the base?
Conversation
To reproduce the problem in 25bacb0: this is the
This is the problem file:
This is the goal formula:
Run:
This produces:
and problem:
The planner cannot find the plan:
However, when running it for the old compilation, it works:
Note that the new mapping with a smaller problem works well:
where
|
25bacb0
to
78d697e
Compare
solved offline with @francescofuggitti |
plan4past/compiler.py
Outdated
result: Set[When] = set() | ||
for p in predicates: | ||
if p.name.startswith("Y-"): | ||
present_predicate = Predicate( | ||
add_val_prefix(remove_yesterday_prefix(p.name)) | ||
) | ||
past_predicate = p | ||
else: | ||
formula = mapping.inverse_mapping[p] | ||
if isinstance(formula, Before): | ||
arg_predicate = mapping.mapping[formula.argument] | ||
present_predicate = Predicate(add_val_prefix(arg_predicate.name)) | ||
past_predicate = p | ||
else: | ||
present_predicate = Predicate(add_val_prefix(p.name)) | ||
past_predicate = p | ||
|
||
positive_when = When(present_predicate, past_predicate) | ||
negative_when = When(Not(present_predicate), Not(past_predicate)) | ||
result.update({positive_when, negative_when}) | ||
return result |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we cannot just remove the "Y-" prefix since now we have quoted
.
However, we still have some predicates as Y-quoted_0
, which must be handled with the old approach.
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #265 +/- ##
==========================================
- Coverage 90.95% 90.83% -0.12%
==========================================
Files 22 22
Lines 984 1037 +53
==========================================
+ Hits 895 942 +47
- Misses 89 95 +6
Flags with carried forward coverage won't be shown. Click here to find out more.
|
78d697e
to
611899e
Compare
Since the mapping from predicate to formula now uses an incremental id with the "quoted_" prefix, the "Y-" prefix to denote yesterday formulas is not needed anymore.
Proposed changes
Continuation of #262 from the new tip of the project (i.e. after #264).