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

[functionality] add functionality field to program #280

Merged
merged 9 commits into from
Nov 6, 2024
Prev Previous commit
Next Next commit
[functionality] test heads rename
FissoreD authored and gares committed Nov 6, 2024
commit 2a4d00d484ab46fae02eebc748fb5f7033cadda5
11 changes: 11 additions & 0 deletions tests/sources/functionality/heads/heads01.elpi
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
:functional pred q.

:functional pred p i:(:functional pred).

% THIS IS OK:
% functionality relation of q is (Functional [])
% functionality of first arg of p is (Functional [])
% Functional [] ⊆ Functional []
p q.

main.
11 changes: 11 additions & 0 deletions tests/sources/functionality/heads/heads02.elpi
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
pred q.

:functional pred p i:(:functional pred).

% THIS FAILS:
% functionality relation of q is (Relational [])
% functionality of first arg of p is (Functional [])
% Relational [] ⊈ Functional []
p q.

main.
13 changes: 13 additions & 0 deletions tests/sources/functionality/heads/heads03.elpi
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
:functional pred p i:(:functional pred i:(pred)).
:functional pred r i:(:functional pred).

% THIS IS OK:
% functionality relation of p is (Functional [Functional [Relational []]])
% functionality of r is (Functional [Functional []])
% (p r) is GOOD since first arg of p is `Functional [Relational []]`
% and Functional [Functional []] ⊆ Functional [Relational []]
% r (p r) is GOOD is first arg of r is `Functional []` and
% Functional [Functional [Relational []] ⊆ Functional []
r (p r).

main.
11 changes: 11 additions & 0 deletions tests/sources/functionality/heads/heads04.elpi
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
:functional pred p i:(:functional pred i:(:functional pred)).
:functional pred r i:(pred).

% THIS FAILS:
% functionality relation of p is (Functional [Functional [Relational []]])
% functionality of r is (Functional [Functional []])
% (p r) is WRONG since first arg of p is `Functional [Functional []]`
% and Functional [Relational []] ⊈ Functional [Functional []]
r (p r).

main.
7 changes: 7 additions & 0 deletions tests/sources/functionality/heads/heads05.elpi
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
:functional pred p i:(pred i:(pred)) i:(:functional pred i:(pred)) .

% THIS FAILS: first A is relational. The second A is functional.
% However relational ⊈ functional
p A A.

main.
7 changes: 7 additions & 0 deletions tests/sources/functionality/heads/heads06.elpi
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
:functional pred p i:(:functional pred i:(pred)) i:(pred i:(pred)).

% THIS IS OK: first A is functional. The second A is relation.
% functional ⊆ relational
p A A.

main.
10 changes: 10 additions & 0 deletions tests/sources/functionality/heads/heads07.elpi
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
:functional pred p i:(int -> (:functional pred) -> prop).

pred q i:int, o:(:functional pred).

% THIS IS OK:
% functionality relation of q is
% (Relational [NoProp, Functional[]]) ⊆ (Relational [NoProp, Functional[]])
p q.

main.
9 changes: 9 additions & 0 deletions tests/sources/functionality/heads/heads08.elpi
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
:functional pred p i:((:functional pred) -> prop).

pred q o:(pred).

% functionality relation of q is
% (Relational [Relational]) ⊈ (Relational [Functional])
p q.

main.
7 changes: 0 additions & 7 deletions tests/sources/functionality/heads/heads1.elpi

This file was deleted.

7 changes: 0 additions & 7 deletions tests/sources/functionality/heads/heads2.elpi

This file was deleted.

6 changes: 0 additions & 6 deletions tests/sources/functionality/heads/heads3_0.elpi

This file was deleted.

6 changes: 0 additions & 6 deletions tests/sources/functionality/heads/heads3_1.elpi

This file was deleted.

5 changes: 0 additions & 5 deletions tests/sources/functionality/heads/heads4.elpi

This file was deleted.

5 changes: 0 additions & 5 deletions tests/sources/functionality/heads/heads5.elpi

This file was deleted.