Skip to content

Commit

Permalink
experimental (functor; args) compound terms
Browse files Browse the repository at this point in the history
  • Loading branch information
josd committed Nov 22, 2024
1 parent 7ad6994 commit aa72b21
Show file tree
Hide file tree
Showing 10 changed files with 642 additions and 623 deletions.
1 change: 1 addition & 0 deletions RELEASE
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
EYE release

v10.30.5 (2024-11-22) experimental (functor; args) compound terms
v10.30.4 (2024-11-19) simplify negative answer surfaces
v10.30.3 (2024-11-13) solving issue https://github.com/eyereasoner/eye/issues/121
v10.30.2 (2024-11-11) adjusting to https://eyereasoner.github.io/eye/#eye-color
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10.30.4
10.30.5
20 changes: 19 additions & 1 deletion eye.pl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
:- catch(use_module(library(process)), _, true).
:- catch(use_module(library(http/http_open)), _, true).

version_info('EYE v10.30.4 (2024-11-19)').
version_info('EYE v10.30.5 (2024-11-22)').

license_info('MIT License

Expand Down Expand Up @@ -2145,6 +2145,15 @@
{ sort(List, Distinct)
},
['$', ')'].
pathitem(compound_term(Functor, Args), Triples) -->
['('],
expression(Functor, T1),
[';'],
!,
pathlist(Args, T2),
[')'],
{ append(T1, T2, Triples)
}.
pathitem(List, Triples) -->
['('],
!,
Expand Down Expand Up @@ -4179,6 +4188,13 @@
write(' true')
).

wt2(compound_term(X, Y)) :-
!,
write('('),
wt(X),
write(';'),
wl(Y),
write(')').
wt2((X, Y)) :-
!,
( atomic(X),
Expand Down Expand Up @@ -12703,6 +12719,8 @@
!.
raw_type(set(_), '<http://www.w3.org/2000/10/swap/log#Set>') :-
!.
raw_type(compound_term(_, _), '<http://www.w3.org/2000/10/swap/log#Compound>') :-
!.
raw_type(A, '<http://www.w3.org/2000/10/swap/log#Formula>') :-
functor(A, B, C),
B \= ':',
Expand Down
Binary file modified eye.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion reasoning/good-cobbler/cobbler-query.n3
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# is there some x which is good at some y
{
?x a (:good ?y).
?x :is (:good; ?y).
} => {
:test :is true.
}.
2 changes: 1 addition & 1 deletion reasoning/good-cobbler/cobbler.n3
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
@prefix : <urn:example:>.

# some x is a good cobbler
_:x a (:good :Cobbler).
_:x :is (:good; :Cobbler).
2 changes: 1 addition & 1 deletion reasoning/peano/peano-answer.n3
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@prefix : <http://example.org/#>.

(:s (:s (:s (:s (:s 0))))) :factorial (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s (:s 0)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))).
(:s; (:s; (:s; (:s; (:s; 0))))) :factorial (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; (:s; 0)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))).
1,222 changes: 611 additions & 611 deletions reasoning/peano/peano-proof.n3

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions reasoning/peano/peano-query.n3
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

# query
{
((:s 0) (:s (:s 0))) :multiply ?A.
(?A (:s (:s (:s 0)))) :add ?B.
((:s; 0) (:s; (:s; 0))) :multiply ?A.
(?A (:s; (:s; (:s; 0)))) :add ?B.
?B :factorial ?C.
} => {
?B :factorial ?C.
Expand Down
10 changes: 5 additions & 5 deletions reasoning/peano/peano.n3
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,26 @@
# add
{(?A 0) :add ?A} <= true.

{(?A (:s ?B)) :add (:s ?C)} <= {
{(?A (:s; ?B)) :add (:s; ?C)} <= {
(?A ?B) :add ?C.
}.

# multiply
{(?A 0) :multiply 0} <= true.

{(?A (:s ?B)) :multiply ?C} <= {
{(?A (:s; ?B)) :multiply ?C} <= {
(?A ?B) :multiply ?D.
(?A ?D) :add ?C.
}.

# factorial
{?A :factorial ?B} <= {
(?A (:s 0)) :fac ?B.
(?A (:s; 0)) :fac ?B.
}.

{(0 ?A) :fac ?A} <= true.

{((:s ?A) ?B) :fac ?C} <= {
(?B (:s ?A)) :multiply ?D.
{((:s; ?A) ?B) :fac ?C} <= {
(?B (:s; ?A)) :multiply ?D.
(?A ?D) :fac ?C.
}.

0 comments on commit aa72b21

Please sign in to comment.