Skip to content

Commit

Permalink
fixing blogic graffiti when using rdf:first, rdf:rest and rdf:nil (ob…
Browse files Browse the repository at this point in the history
…s from Patrick Hochstenbach)
  • Loading branch information
josd committed Feb 22, 2023
1 parent 10b51df commit 0f20ae5
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 26 deletions.
1 change: 1 addition & 0 deletions RELEASE
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
EYE release

[v3.0.1] fixing blogic graffiti when using rdf:first, rdf:rest and rdf:nil (obs from Patrick Hochstenbach)
[v3.0.0] core blogic metarules and new list:sort, log:callWithCut and log:callWithOptional built-ins
[v2.13.2] simplifying extended unifier for blogic
[v2.13.1] work around for issue https://github.com/eyereasoner/eye-js/issues/129 by adding extra newline
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.0
3.0.1
54 changes: 35 additions & 19 deletions eye.pl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
:- use_module(library(semweb/turtle)).
:- catch(use_module(library(http/http_open)), _, true).

version_info('EYE v3.0.0 josd').
version_info('EYE v3.0.1 josd').

license_info('MIT License

Expand Down Expand Up @@ -708,41 +708,49 @@
% assert positive surface
assertz(implies('<http://www.w3.org/2000/10/swap/log#onPositiveSurface>'(_, G), G, '<>')),
% blow inference fuse
assertz(implies(('<http://www.w3.org/2000/10/swap/log#onNegativeSurface>'(V, G),
assertz(implies(('<http://www.w3.org/2000/10/swap/log#onNegativeSurface>'(X, G),
getlist(X, V),
makevars(G, H, beta(V)),
call(H)
), false, '<>')),
% resolve positive surface
assertz(implies(('<http://www.w3.org/2000/10/swap/log#onNegativeSurface>'(V, G),
assertz(implies(('<http://www.w3.org/2000/10/swap/log#onNegativeSurface>'(X, G),
getlist(X, V),
conj_list(G, L),
select('<http://www.w3.org/2000/10/swap/log#onPositiveSurface>'([], H), L, K),
select('<http://www.w3.org/2000/10/swap/log#onPositiveSurface>'(Y, H), L, K),
getlist(Y, []),
conj_list(H, D),
append(K, D, E),
conj_list(F, E)
), '<http://www.w3.org/2000/10/swap/log#onNegativeSurface>'(V, F), '<>')),
% erase at even level
assertz(implies(('<http://www.w3.org/2000/10/swap/log#onNegativeSurface>'(V, G),
assertz(implies(('<http://www.w3.org/2000/10/swap/log#onNegativeSurface>'(X, G),
getlist(X, V),
conj_list(G, L),
select('<http://www.w3.org/2000/10/swap/log#onNegativeSurface>'(W, H), L, K),
select('<http://www.w3.org/2000/10/swap/log#onNegativeSurface>'(Y, H), L, K),
getlist(Y, W),
conj_list(C, K),
conj_list(H, M),
select('<http://www.w3.org/2000/10/swap/log#onNegativeSurface>'(W, C), M, _)
select('<http://www.w3.org/2000/10/swap/log#onNegativeSurface>'(Y, C), M, _)
), '<http://www.w3.org/2000/10/swap/log#onNegativeSurface>'(W, C), '<>')),
% non-unit resolution
assertz(implies(('<http://www.w3.org/2000/10/swap/log#onNegativeSurface>'(V, G),
assertz(implies(('<http://www.w3.org/2000/10/swap/log#onNegativeSurface>'(X, G),
getlist(X, V),
conj_list(G, L),
\+member('<http://www.w3.org/2000/10/swap/log#onPositiveSurface>'(_, _), L),
\+member('<http://www.w3.org/2000/10/swap/log#onQuerySurface>'(_, _), L),
length(L, E),
E < 4,
'<http://www.w3.org/2000/10/swap/log#onNegativeSurface>'(W, F),
'<http://www.w3.org/2000/10/swap/log#onNegativeSurface>'(Y, F),
getlist(Y, W),
conj_list(F, K),
length(K, 2),
\+ (member('<http://www.w3.org/2000/10/swap/log#onNegativeSurface>'(_, I), K), atomic(I)),
makevars(K, J, beta(W)),
select('<http://www.w3.org/2000/10/swap/log#onNegativeSurface>'(U, C), J, [P]),
select('<http://www.w3.org/2000/10/swap/log#onNegativeSurface>'(Z, C), J, [P]),
getlist(Z, U),
( select('<http://www.w3.org/2000/10/swap/log#onNegativeSurface>'(_, P), L,
'<http://www.w3.org/2000/10/swap/log#onNegativeSurface>'(U, C), M),
'<http://www.w3.org/2000/10/swap/log#onNegativeSurface>'(Z, C), M),
conj_list(H, M)
; select(C, L, P, M),
conj_list(H, M)
Expand All @@ -753,7 +761,8 @@
; true
)), true, '<>')),
% negative surface factoring
assertz(implies(('<http://www.w3.org/2000/10/swap/log#onNegativeSurface>'(V, G),
assertz(implies(('<http://www.w3.org/2000/10/swap/log#onNegativeSurface>'(X, G),
getlist(X, V),
conj_list(G, L),
list_to_set(L, M),
conj_list(H, M),
Expand All @@ -762,9 +771,11 @@
; true
)), true, '<>')),
% negative surface disjunction
assertz(implies(('<http://www.w3.org/2000/10/swap/log#onNegativeSurface>'(V, G),
assertz(implies(('<http://www.w3.org/2000/10/swap/log#onNegativeSurface>'(X, G),
getlist(X, V),
conj_list(G, L),
select('<http://www.w3.org/2000/10/swap/log#onNegativeSurface>'(W, H), L, K),
select('<http://www.w3.org/2000/10/swap/log#onNegativeSurface>'(Y, H), L, K),
getlist(Y, W),
conj_list(H, M),
length(M, I),
I > 1,
Expand All @@ -781,7 +792,8 @@
; true
)), true, '<>')),
% adjust graffiti
assertz(implies(('<http://www.w3.org/2000/10/swap/log#onNegativeSurface>'(V, G),
assertz(implies(('<http://www.w3.org/2000/10/swap/log#onNegativeSurface>'(X, G),
getlist(X, V),
findvars(G, U, beta),
findall(M,
( member(M, V),
Expand All @@ -792,15 +804,17 @@
W \= V
), '<http://www.w3.org/2000/10/swap/log#onNegativeSurface>'(W, G), '<>')),
% forward rule
assertz(implies(('<http://www.w3.org/2000/10/swap/log#onNegativeSurface>'(V, G),
assertz(implies(('<http://www.w3.org/2000/10/swap/log#onNegativeSurface>'(X, G),
getlist(X, V),
conj_list(G, L),
select('<http://www.w3.org/2000/10/swap/log#onNegativeSurface>'(_, H), L, K),
conj_list(R, K),
domain(V, R, P),
makevars('<http://www.w3.org/2000/10/swap/log#implies>'(P, H), B, beta(V))
), B, '<>')),
% forward rule contrapositive
assertz(implies(('<http://www.w3.org/2000/10/swap/log#onNegativeSurface>'(V, G),
assertz(implies(('<http://www.w3.org/2000/10/swap/log#onNegativeSurface>'(X, G),
getlist(X, V),
conj_list(G, L),
\+member('<http://www.w3.org/2000/10/swap/log#onPositiveSurface>'(_, _), L),
\+member('<http://www.w3.org/2000/10/swap/log#onNegativeSurface>'(_, _), L),
Expand All @@ -812,7 +826,8 @@
makevars('<http://www.w3.org/2000/10/swap/log#implies>'(P, E), B, beta(V))
), B, '<>')),
% backward rule
assertz(implies(('<http://www.w3.org/2000/10/swap/log#onNegativeSurface>'(V, G),
assertz(implies(('<http://www.w3.org/2000/10/swap/log#onNegativeSurface>'(X, G),
getlist(X, V),
conj_list(G, L),
select('<http://www.w3.org/2000/10/swap/log#onQuerySurface>'(_, H), L, K),
conj_list(R, K),
Expand All @@ -825,7 +840,8 @@
; true
)), true, '<>')),
% query surface
assertz(implies(('<http://www.w3.org/2000/10/swap/log#onQuerySurface>'(V, G),
assertz(implies(('<http://www.w3.org/2000/10/swap/log#onQuerySurface>'(X, G),
getlist(X, V),
conj_list(G, L),
( select('<http://www.w3.org/2000/10/swap/log#onQuerySurface>'(_, H), L, K)
-> conj_list(I, K)
Expand Down
Binary file modified eye.zip
Binary file not shown.
6 changes: 0 additions & 6 deletions reasoning/allen/answer.n3
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#Processed by EYE v3.0.0 josd
#eye --nope token.n3 logic.n3 population.n3 allen.n3 eventTime_rules.n3 --query query.n3 --output answer.n3

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.
Expand Down Expand Up @@ -42,6 +39,3 @@
(token:interval1 token:interval2) logic:strongest (allen:equals).
(token:interval2 token:interval1) logic:strongest (allen:equals).

#2023-02-22T11:25:54.772Z in=346 out=24 ent=244 step=995 brake=6 inf=1082541 sec=0.136 inf/sec=7959860
#ENDS

0 comments on commit 0f20ae5

Please sign in to comment.