Skip to content

Commit

Permalink
introducing ^(functor args) compound terms
Browse files Browse the repository at this point in the history
  • Loading branch information
josd committed Nov 5, 2024
1 parent 1da3f73 commit dec27ff
Show file tree
Hide file tree
Showing 8 changed files with 644 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.29.0 (2024-11-05) introducing ^(functor args) compound terms
v10.28.9 (2024-11-04) using RDF Proofs
v10.28.8 (2024-11-03) using proofpackets instead of reasongraphs
v10.28.7 (2024-11-02) using reasongraphs instead of rdfproof
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10.28.9
10.29.0
22 changes: 21 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.28.9 (2024-11-04)').
version_info('EYE v10.29.0 (2024-11-05)').

license_info('MIT License

Expand Down Expand Up @@ -2148,6 +2148,11 @@
{ sort(List, Distinct)
},
['$', ')'].
pathitem(compound_term(List), Triples) -->
[caret_lb],
!,
pathlist(List, Triples),
[')'].
pathitem(List, Triples) -->
['('],
!,
Expand Down Expand Up @@ -2824,6 +2829,11 @@
!,
get_code(In, _),
get_code(In, C).
token(0'^, In, C, caret_lb) :-
peek_code(In, 0'(),
!,
get_code(In, _),
get_code(In, C).
token(C0, In, C, Token) :-
name(C0, In, C1, Name),
!,
Expand Down Expand Up @@ -4169,6 +4179,12 @@
write('($'),
wl(X),
write(' $)').
wt1(compound_term([X|Y])) :-
!,
write('^('),
wt(X),
wl(Y),
write(')').
wt1('$VAR'(X)) :-
!,
write('?V'),
Expand Down Expand Up @@ -12676,6 +12692,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 Expand Up @@ -12774,6 +12792,8 @@
!.
getlist(set(A), A) :-
!.
getlist(compound_term(A), A) :-
!.
getlist([], []) :-
!.
getlist('<http://www.w3.org/1999/02/22-rdf-syntax-ns#nil>', []) :-
Expand Down
Binary file modified eye.zip
Binary file not shown.
4 changes: 2 additions & 2 deletions reasoning/good-cobbler/cobbler.n3
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
@prefix : <urn:example:>.

# some x is a good cobbler
_:x a (:good :Cobbler).
_:x a ^(:good :Cobbler).

# is there some x which is good at some y
{
?x a (:good ?y).
?x a ^(:good ?y).
} =^ {
:test :is true.
}.
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.

14 changes: 7 additions & 7 deletions reasoning/peano/peano.n3
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,34 @@
# 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.
}.

# 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

0 comments on commit dec27ff

Please sign in to comment.