Skip to content

Commit

Permalink
fixing log:notIncludes and log:notEqualTo for existential rules per i…
Browse files Browse the repository at this point in the history
…ssue #25 (obs from Doerthe Arndt)
  • Loading branch information
josd committed Dec 3, 2021
1 parent cdf168e commit 3dc112f
Show file tree
Hide file tree
Showing 18 changed files with 131 additions and 5 deletions.
1 change: 1 addition & 0 deletions RELEASE
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
EYE release

[v21.1203.1050] fixing log:notIncludes and log:notEqualTo for existential rules per issue https://github.com/josd/eye/issues/25 (obs from Doerthe Arndt)
[v21.1125.2043] fixing floundering issue with log:notIncludes
[v21.1124.2208] fixing log:notIncludes issues/25 (obs from Pierre-Antoine Champin)
[v21.1123.1419] adding ?SCOPE e:find (?SELECT ?WHERE ?ANSWER) built-in which binds the free variables in ?WHERE except those that occur in ?SELECT
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
EYE v21.1125.2043 josd
EYE v21.1203.1050 josd
10 changes: 6 additions & 4 deletions eye.pl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
:- use_module(library(prolog_jiti)).
:- use_module(library(http/http_open)).

version_info('EYE v21.1125.2043 josd').
version_info('EYE v21.1203.1050 josd').

license_info('MIT License

Expand Down Expand Up @@ -5318,7 +5318,8 @@
C = B.

'<http://www.w3.org/2000/10/swap/log#notEqualTo>'(X, Y) :-
\+'<http://www.w3.org/2000/10/swap/log#equalTo>'(X, Y).
makevars([X, Y], [U, V], zeta),
\+unify(U, V).

'<http://www.w3.org/2000/10/swap/log#notIncludes>'(X, Y) :-
within_scope(X),
Expand All @@ -5335,8 +5336,9 @@
( nonvar(X),
ground(Y)
),
( conj_list(X, A),
conj_list(Y, B),
( makevars([X, Y], [U, V], zeta),
conj_list(U, A),
conj_list(V, B),
\+includes(A, B)
)
).
Expand Down
Binary file modified eye.zip
Binary file not shown.
5 changes: 5 additions & 0 deletions reasoning/issue25/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
--------
Issue 25
--------

See https://github.com/josd/eye/issues/25
7 changes: 7 additions & 0 deletions reasoning/issue25/test
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
eye "$@" --wcache http://josd.github.io/eye/reasoning .. --nope http://josd.github.io/eye/reasoning/issue25/test1.n3 --pass-only-new > test1-pass-only-new.n3
eye "$@" --wcache http://josd.github.io/eye/reasoning .. --nope http://josd.github.io/eye/reasoning/issue25/test2.n3 --pass-only-new > test2-pass-only-new.n3
eye "$@" --wcache http://josd.github.io/eye/reasoning .. --nope http://josd.github.io/eye/reasoning/issue25/test3.n3 --pass-only-new > test3-pass-only-new.n3
eye "$@" --wcache http://josd.github.io/eye/reasoning .. --nope http://josd.github.io/eye/reasoning/issue25/test4.n3 --pass-only-new > test4-pass-only-new.n3
eye "$@" --wcache http://josd.github.io/eye/reasoning .. --nope http://josd.github.io/eye/reasoning/issue25/test5.n3 --pass-only-new > test5-pass-only-new.n3
eye "$@" --wcache http://josd.github.io/eye/reasoning .. --nope http://josd.github.io/eye/reasoning/issue25/test6.n3 --pass-only-new > test6-pass-only-new.n3
6 changes: 6 additions & 0 deletions reasoning/issue25/test1-pass-only-new.n3
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
PREFIX log: <http://www.w3.org/2000/10/swap/log#>
PREFIX : <http://example.org/test#>

:test :pass 1 .
:test :pass 2 .

20 changes: 20 additions & 0 deletions reasoning/issue25/test1.n3
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
PREFIX log: <http://www.w3.org/2000/10/swap/log#>
PREFIX : <http://example.org/test#>

:alice :name "alice".
:bob :name "bob".
:charlie :name "charlie".

:alice :says { :bob a :NiceGuy }.

@forAll :y.

{ :alice :says ?x.
:y :name "charlie".
?x log:notIncludes { :y a :NiceGuy }.
} => { :test :pass 1 }.

{ :alice :says ?x.
?x log:notIncludes { :y a :NiceGuy }.
:y :name "charlie".
} => { :test :pass 2 }.
4 changes: 4 additions & 0 deletions reasoning/issue25/test2-pass-only-new.n3
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
PREFIX log: <http://www.w3.org/2000/10/swap/log#>
PREFIX : <http://example.org/test#>


13 changes: 13 additions & 0 deletions reasoning/issue25/test2.n3
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
PREFIX log: <http://www.w3.org/2000/10/swap/log#>
PREFIX : <http://example.org/test#>

#G1
:gang :contains :bob, :charlie.
:alice :says { :bob :name "bob" }.
{
:alice :says _:g.
_:g log:notIncludes { _:s _:p _:o }
:gang :contains _:s.
} => {
:alice :ignores _:s.
}.
10 changes: 10 additions & 0 deletions reasoning/issue25/test3-pass-only-new.n3
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
PREFIX log: <http://www.w3.org/2000/10/swap/log#>
PREFIX : <http://example.org/test#>

:bob :father _:sk_0.
_:sk_0 a :Man.
:my :graph {:bob :father :ted. :bob :father :ted}.
:my :graph {:bob :father :ted. :bob :father _:sk_0}.
:my :graph {:bob :father _:sk_0. :bob :father _:sk_0}.
:ted a :Man.

11 changes: 11 additions & 0 deletions reasoning/issue25/test3.n3
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
PREFIX log: <http://www.w3.org/2000/10/swap/log#>
PREFIX : <http://example.org/test#>

:bob a :Person.
:bob :father :ted.

{?x a :Person}=>{?x :father _:y. _:y a :Man}.
{?x :father ?y. ?x :father ?z. ({?x :father ?y. ?x :father ?z.}) log:conjunction ?u}=>{:my :graph ?u}.
{ :bob :father ?y. :bob :father ?z. :my :graph ?u. ?u log:notIncludes {:bob :father ?y. :bob :father ?z.} }=>{:o :o :o}.

{?x :father ?y}=>{?y a :Man}.
6 changes: 6 additions & 0 deletions reasoning/issue25/test4-pass-only-new.n3
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
PREFIX log: <http://www.w3.org/2000/10/swap/log#>
PREFIX : <http://example.org/test#>

:my :graph {:bob :father :ted. :bob :father :ted}.
:ted a :Man.

11 changes: 11 additions & 0 deletions reasoning/issue25/test4.n3
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
PREFIX log: <http://www.w3.org/2000/10/swap/log#>
PREFIX : <http://example.org/test#>

:bob a :Person.
:bob :father :ted.

{?x :father ?y. ?x :father ?z. ({?x :father ?y. ?x :father ?z.}) log:conjunction ?u}=>{:my :graph ?u}.
{ :bob :father ?y. :bob :father ?z. :my :graph ?u. ?u log:notIncludes {:bob :father ?y. :bob :father ?z.} }=>{:o :o :o}.

{?x :father ?y}=>{?y a :Man}.
{?x a :Person}=>{?x :father _:y. _:y a :Man}.
5 changes: 5 additions & 0 deletions reasoning/issue25/test5-pass-only-new.n3
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
PREFIX log: <http://www.w3.org/2000/10/swap/log#>
PREFIX : <http://example.org/test#>

:ted a :Man.

9 changes: 9 additions & 0 deletions reasoning/issue25/test5.n3
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
PREFIX log: <http://www.w3.org/2000/10/swap/log#>
PREFIX : <http://example.org/test#>

:bob a :Person.
:bob :father :ted.

{?x :father ?y}=>{?y a :Man}.
{?x a :Person}=>{?x :father _:y. _:y a :Man}.
{?x :father ?y. ?x :father ?z. ?y log:notEqualTo ?z}=>{:here :I :am}.
7 changes: 7 additions & 0 deletions reasoning/issue25/test6-pass-only-new.n3
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
PREFIX log: <http://www.w3.org/2000/10/swap/log#>
PREFIX : <http://example.org/test#>

:bob :father _:sk_0.
_:sk_0 a :Man.
:ted a :Man.

9 changes: 9 additions & 0 deletions reasoning/issue25/test6.n3
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
PREFIX log: <http://www.w3.org/2000/10/swap/log#>
PREFIX : <http://example.org/test#>

:bob a :Person.
:bob :father :ted.

{?x a :Person}=>{?x :father _:y. _:y a :Man}.
{?x :father ?y. ?x :father ?z. ?y log:notEqualTo ?z}=>{:here :I :am}.
{?x :father ?y}=>{?y a :Man}.

0 comments on commit 3dc112f

Please sign in to comment.