Skip to content

Commit

Permalink
using rule:vars and rule:bindings for rdflingua
Browse files Browse the repository at this point in the history
  • Loading branch information
josd committed Nov 26, 2023
1 parent 0467381 commit b4bf232
Show file tree
Hide file tree
Showing 44 changed files with 867 additions and 866 deletions.
1 change: 1 addition & 0 deletions RELEASE
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
EYE release

v8.7.2 (2023-11-27) using rule:vars and rule:bindings for rdflingua
v8.7.1 (2023-11-26) improving rule:binding ad rdflingua proof explanation
v8.7.0 (2023-11-26) introducing rule:binding as rdflingua proof
v8.6.23 (2023-11-26) using rule:graffiti instead of rule:vars in rdflingua
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.7.1
8.7.2
14 changes: 7 additions & 7 deletions eye.pl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
:- use_module(library(pcre)).
:- catch(use_module(library(http/http_open)), _, true).

version_info('EYE v8.7.1 (2023-11-26)').
version_info('EYE v8.7.2 (2023-11-27)').

license_info('MIT License

Expand Down Expand Up @@ -645,30 +645,30 @@
% forward rule
assertz(implies((
'<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>'(R, '<http://eyereasoner.github.io/rule#ForwardRule>'),
'<http://eyereasoner.github.io/rule#graffiti>'(R, U),
'<http://eyereasoner.github.io/rule#vars>'(R, U),
getlist(U, V),
'<http://eyereasoner.github.io/rule#premise>'(R, K),
getconj(K, A),
'<http://eyereasoner.github.io/rule#conclusion>'(R, H),
getconj(H, B),
( flag(explain),
B \= false
-> conj_append(B, remember(answer('<http://eyereasoner.github.io/rule#binding>', R, U)), D)
-> conj_append(B, remember(answer('<http://eyereasoner.github.io/rule#bindings>', R, U)), D)
; D = B
),
makevars([A, D], [Q, I], beta(V))
), '<http://www.w3.org/2000/10/swap/log#implies>'(Q, I), '<>')),
% backward rule
assertz(implies((
'<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>'(R, '<http://eyereasoner.github.io/rule#BackwardRule>'),
'<http://eyereasoner.github.io/rule#graffiti>'(R, U),
'<http://eyereasoner.github.io/rule#vars>'(R, U),
getlist(U, V),
'<http://eyereasoner.github.io/rule#premise>'(R, K),
getconj(K, A),
'<http://eyereasoner.github.io/rule#conclusion>'(R, [[S, P, O]]),
B =.. [P, S, O],
( flag(explain)
-> conj_append(A, remember(answer('<http://eyereasoner.github.io/rule#binding>', R, U)), D)
-> conj_append(A, remember(answer('<http://eyereasoner.github.io/rule#bindings>', R, U)), D)
; D = A
),
makevars(':-'(B, D), C, beta(V)),
Expand All @@ -683,15 +683,15 @@
% query rule
assertz(implies((
'<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>'(R, '<http://eyereasoner.github.io/rule#QueryRule>'),
'<http://eyereasoner.github.io/rule#graffiti>'(R, U),
'<http://eyereasoner.github.io/rule#vars>'(R, U),
getlist(U, V),
'<http://eyereasoner.github.io/rule#premise>'(R, K),
getconj(K, A),
'<http://eyereasoner.github.io/rule#conclusion>'(R, H),
getconj(H, B),
djiti_answer(answer(B), J),
( flag(explain)
-> conj_append(A, remember(answer('<http://eyereasoner.github.io/rule#binding>', R, U)), D)
-> conj_append(A, remember(answer('<http://eyereasoner.github.io/rule#bindings>', R, U)), D)
; D = A
),
makevars(implies(D, J, '<>'), C, beta(V)),
Expand Down
Binary file modified eye.zip
Binary file not shown.
8 changes: 4 additions & 4 deletions rdflingua/acp/acp.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
:noneOf :D.

:acp_rule1 a rule:BackwardRule;
rule:graffiti (
rule:vars (
_:Pol
_:Test
_:Field
Expand All @@ -31,7 +31,7 @@
).

:acp_rule2 a rule:BackwardRule;
rule:graffiti (
rule:vars (
_:Pol
_:Test
_:Field
Expand All @@ -50,7 +50,7 @@
).

:acp_rule3 a rule:BackwardRule;
rule:graffiti (
rule:vars (
_:Pol
_:Test
_:Field
Expand All @@ -71,7 +71,7 @@

# query
:acp_query a rule:QueryRule;
rule:graffiti (
rule:vars (
_:Pol
);
rule:premise (
Expand Down
8 changes: 4 additions & 4 deletions rdflingua/acp/out/acp.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
@prefix rule: <http://eyereasoner.github.io/rule#>.
@prefix var: <http://eyereasoner.github.io/var#>.

:acp_rule1 rule:binding (:PolicyX :test1 var:all_0 ((<file:///home/jdroo/github.com/eyereasoner/eye/rdflingua/acp/acp.ttl>) 1)).
:acp_rule2 rule:binding (:PolicyX :test1 var:all_1 (:C) ((<file:///home/jdroo/github.com/eyereasoner/eye/rdflingua/acp/acp.ttl>) 1) 1).
:acp_rule3 rule:binding (:PolicyX :test1 var:all_2 () ((<file:///home/jdroo/github.com/eyereasoner/eye/rdflingua/acp/acp.ttl>) 1) 0).
:acp_query rule:binding (:PolicyX).
:acp_rule1 rule:bindings (:PolicyX :test1 var:all_0 ((<file:///home/jdroo/github.com/eyereasoner/eye/rdflingua/acp/acp.ttl>) 1)).
:acp_rule2 rule:bindings (:PolicyX :test1 var:all_1 (:C) ((<file:///home/jdroo/github.com/eyereasoner/eye/rdflingua/acp/acp.ttl>) 1) 1).
:acp_rule3 rule:bindings (:PolicyX :test1 var:all_2 () ((<file:///home/jdroo/github.com/eyereasoner/eye/rdflingua/acp/acp.ttl>) 1) 0).
:acp_query rule:bindings (:PolicyX).
:test :for :PolicyX.
:test :is true.
18 changes: 9 additions & 9 deletions rdflingua/complex-numbers/complex-numbers.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

# exponentiation
:complex_numbers_exponentiation_rule a rule:BackwardRule;
rule:graffiti (
rule:vars (
_:A
_:B
_:C
Expand Down Expand Up @@ -46,7 +46,7 @@

# asin
:complex_numbers_asin_rule a rule:BackwardRule;
rule:graffiti (
rule:vars (
_:A
_:B
_:C
Expand Down Expand Up @@ -96,7 +96,7 @@

# acos
:complex_numbers_acos_rule a rule:BackwardRule;
rule:graffiti (
rule:vars (
_:A
_:B
_:C
Expand Down Expand Up @@ -148,7 +148,7 @@

# polar
:complex_numbers_polar_rule a rule:BackwardRule;
rule:graffiti (
rule:vars (
_:X
_:Y
_:R
Expand Down Expand Up @@ -176,7 +176,7 @@

# dial
:complex_numbers_dial_rule1 a rule:BackwardRule;
rule:graffiti (
rule:vars (
_:X
_:Y
_:T
Expand All @@ -192,7 +192,7 @@
).

:complex_numbers_dial_rule2 a rule:BackwardRule;
rule:graffiti (
rule:vars (
_:X
_:Y
_:T
Expand All @@ -208,7 +208,7 @@
).

:complex_numbers_dial_rule3 a rule:BackwardRule;
rule:graffiti (
rule:vars (
_:X
_:Y
_:T
Expand All @@ -224,7 +224,7 @@
).

:complex_numbers_dial_rule4 a rule:BackwardRule;
rule:graffiti (
rule:vars (
_:X
_:Y
_:T
Expand All @@ -243,7 +243,7 @@

# query
:complex_numbers_query a rule:QueryRule;
rule:graffiti (
rule:vars (
_:C1
_:C2
_:C3
Expand Down
26 changes: 13 additions & 13 deletions rdflingua/complex-numbers/out/complex-numbers.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
@prefix rule: <http://eyereasoner.github.io/rule#>.
@prefix complex: <http://eyereasoner.github.io/complex#>.

:complex_numbers_dial_rule2 rule:binding (-1 0 0.0 3.141592653589793).
:complex_numbers_polar_rule rule:binding (-1 0 1 3.141592653589793 1 0 1 1 1 0.0).
:complex_numbers_exponentiation_rule rule:binding (-1 0 0.5 0 6.123233995736766e-17 1.0 1 3.141592653589793 1 0 0.0 1 0.0 0.0 1.5707963267948966 1.5707963267948966 6.123233995736766e-17 1.0).
:complex_numbers_dial_rule1 rule:binding (2.718281828459045 0 0.0 0.0).
:complex_numbers_polar_rule rule:binding (2.718281828459045 0 2.718281828459045 0.0 7.3890560989306495 0 7.3890560989306495 2.718281828459045 1.0 0.0).
:complex_numbers_exponentiation_rule rule:binding (2.718281828459045 0 0 3.141592653589793 -1.0 1.2246467991473532e-16 2.718281828459045 0.0 1 -3.141592653589793 -0.0 1 1.0 3.141592653589793 0.0 3.141592653589793 -1.0 1.2246467991473532e-16).
:complex_numbers_dial_rule1 rule:binding (0 1 1.5707963267948966 1.5707963267948966).
:complex_numbers_polar_rule rule:binding (0 1 1 1.5707963267948966 0 1 1 0 0 1.5707963267948966).
:complex_numbers_exponentiation_rule rule:binding (0 1 0 1 0.20787957635076193 0.0 1 1.5707963267948966 1 -1 -1.5707963267948966 0.20787957635076193 0.0 0.0 0.0 0.0 1.0 0.0).
:complex_numbers_exponentiation_rule rule:binding (2.718281828459045 0 -1.57079632679 0 0.20787957635177984 0.0 2.718281828459045 0.0 0.20787957635177984 0 0.0 1 1.0 0.0 -0.0 0.0 1.0 0.0).
:complex_numbers_asin_rule rule:binding (2 0 1.5707963267948966 1.3169578969248166 1.0 2.0 3 9 0 9 3.0 -1 1 1 1 2.0 4.0 4.0 3.0 1.7320508075688772 3.732050807568877).
:complex_numbers_acos_rule rule:binding (2 0 0.0 -1.3169578969248166 1.0 2.0 3 9 0 9 3.0 -1 1 1 1 2.0 4.0 4.0 3.0 1.7320508075688772 3.732050807568877 1.3169578969248166).
:complex_numbers_query rule:binding ((6.123233995736766e-17 1.0) (-1.0 1.2246467991473532e-16) (0.20787957635076193 0.0) (0.20787957635177984 0.0) (1.5707963267948966 1.3169578969248166) (0.0 -1.3169578969248166)).
:complex_numbers_dial_rule2 rule:bindings (-1 0 0.0 3.141592653589793).
:complex_numbers_polar_rule rule:bindings (-1 0 1 3.141592653589793 1 0 1 1 1 0.0).
:complex_numbers_exponentiation_rule rule:bindings (-1 0 0.5 0 6.123233995736766e-17 1.0 1 3.141592653589793 1 0 0.0 1 0.0 0.0 1.5707963267948966 1.5707963267948966 6.123233995736766e-17 1.0).
:complex_numbers_dial_rule1 rule:bindings (2.718281828459045 0 0.0 0.0).
:complex_numbers_polar_rule rule:bindings (2.718281828459045 0 2.718281828459045 0.0 7.3890560989306495 0 7.3890560989306495 2.718281828459045 1.0 0.0).
:complex_numbers_exponentiation_rule rule:bindings (2.718281828459045 0 0 3.141592653589793 -1.0 1.2246467991473532e-16 2.718281828459045 0.0 1 -3.141592653589793 -0.0 1 1.0 3.141592653589793 0.0 3.141592653589793 -1.0 1.2246467991473532e-16).
:complex_numbers_dial_rule1 rule:bindings (0 1 1.5707963267948966 1.5707963267948966).
:complex_numbers_polar_rule rule:bindings (0 1 1 1.5707963267948966 0 1 1 0 0 1.5707963267948966).
:complex_numbers_exponentiation_rule rule:bindings (0 1 0 1 0.20787957635076193 0.0 1 1.5707963267948966 1 -1 -1.5707963267948966 0.20787957635076193 0.0 0.0 0.0 0.0 1.0 0.0).
:complex_numbers_exponentiation_rule rule:bindings (2.718281828459045 0 -1.57079632679 0 0.20787957635177984 0.0 2.718281828459045 0.0 0.20787957635177984 0 0.0 1 1.0 0.0 -0.0 0.0 1.0 0.0).
:complex_numbers_asin_rule rule:bindings (2 0 1.5707963267948966 1.3169578969248166 1.0 2.0 3 9 0 9 3.0 -1 1 1 1 2.0 4.0 4.0 3.0 1.7320508075688772 3.732050807568877).
:complex_numbers_acos_rule rule:bindings (2 0 0.0 -1.3169578969248166 1.0 2.0 3 9 0 9 3.0 -1 1 1 1 2.0 4.0 4.0 3.0 1.7320508075688772 3.732050807568877 1.3169578969248166).
:complex_numbers_query rule:bindings ((6.123233995736766e-17 1.0) (-1.0 1.2246467991473532e-16) (0.20787957635076193 0.0) (0.20787957635177984 0.0) (1.5707963267948966 1.3169578969248166) (0.0 -1.3169578969248166)).
((-1 0) (0.5 0)) complex:exponentiation (6.123233995736766e-17 1.0).
((2.718281828459045 0) (0 3.141592653589793)) complex:exponentiation (-1.0 1.2246467991473532e-16).
((0 1) (0 1)) complex:exponentiation (0.20787957635076193 0.0).
Expand Down
10 changes: 5 additions & 5 deletions rdflingua/fibonacci/fibonacci.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# backward rules
:fibonacci_rule1 a rule:BackwardRule;
rule:graffiti (
rule:vars (
_:X
_:Y
);
Expand All @@ -16,7 +16,7 @@
).

:fibonacci_rule2 a rule:BackwardRule;
rule:graffiti (
rule:vars (
_:A
_:B
);
Expand All @@ -26,7 +26,7 @@
rule:premise ().

:fibonacci_rule3 a rule:BackwardRule;
rule:graffiti (
rule:vars (
_:A
_:B
);
Expand All @@ -36,7 +36,7 @@
rule:premise ().

:fibonacci_rule4 a rule:BackwardRule;
rule:graffiti (
rule:vars (
_:X
_:A
_:B
Expand All @@ -56,7 +56,7 @@

# query
:fibonacci_query a rule:QueryRule;
rule:graffiti (
rule:vars (
_:F1
_:F2
_:F3
Expand Down
Loading

0 comments on commit b4bf232

Please sign in to comment.