Skip to content

Commit

Permalink
reach: simpler encoding when right is an observation
Browse files Browse the repository at this point in the history
  • Loading branch information
pauleve committed Mar 6, 2024
1 parent 40d74bf commit 9367d4a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bonesis/asp_encoding.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,8 +525,9 @@ def encode_reach(self, cfg1, right, mutant=None,
f":- {pred}({Y},N,V), ext({Z},N,-V), not ext({Z},N,V)",
] + self.apply_mutant_to_mcfg(mutant, Z)
if not monotone:
compl = f"cfg({Y},N,-V)" if pred == "cfg" else f"not obs({Y},N,V)"
rules += [
f"{{ext({Z},N,V)}} :- eval({Z},N,V), {pred}({Y},N,-V)"
f"{{ext({Z},N,V)}} :- eval({Z},N,V), {compl}"
]
if isinstance(max_changes, int) and max_changes > 0:
rules += [
Expand Down

0 comments on commit 9367d4a

Please sign in to comment.