Skip to content
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

adding orphan example to external equivalence #183

Merged
merged 1 commit into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions res/examples/external_equivalence/orphan/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
out
16 changes: 16 additions & 0 deletions res/examples/external_equivalence/orphan/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# `orphan`

## Usage

Note that the programs are not externally equivalent under user guide `orphan.a.ug`,
but `orphan.b.ug` adds missing assumptions under which the programs are indeed externally equivalent.
```
anthem verify --equivalence external orphan.1.lp orphan.2.lp orphan.b.ug
```

## Origin
This example was taken from

> Jorge Fandinno, Zachary Hansen, Yuliya Lierler, Vladimir Lifschitz, Nathan Temple.
> External Behavior of a Logic Program and Verification of Refactoring. TPLP 23(4): 933-947 (2023).
> https://doi.org/10.1017/S1471068423000200
3 changes: 3 additions & 0 deletions res/examples/external_equivalence/orphan/orphan.1.lp
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
parent_living(X) :- father(Y,X), living(Y).
parent_living(X) :- mother(Y,X), living(Y).
orphan(X) :- living(X), not parent_living(X).
1 change: 1 addition & 0 deletions res/examples/external_equivalence/orphan/orphan.2.lp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
orphan(X) :- living(X), father(Y,X), mother(Z,X), not living(Y), not living(Z).
4 changes: 4 additions & 0 deletions res/examples/external_equivalence/orphan/orphan.a.ug
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
input: living/1.
input: father/2.
input: mother/2.
output: orphan/1.
7 changes: 7 additions & 0 deletions res/examples/external_equivalence/orphan/orphan.b.ug
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
input: living/1.
input: father/2.
input: mother/2.
output: orphan/1.

assumption: forall X exists Y forall Z (father(Z,X) <-> Y=Z).
assumption: forall X exists Y forall Z (mother(Z,X) <-> Y=Z).
Loading