Skip to content

Commit

Permalink
running top 20 lingua cases
Browse files Browse the repository at this point in the history
  • Loading branch information
josd committed Mar 5, 2024
1 parent 556f653 commit d60d4d6
Show file tree
Hide file tree
Showing 22 changed files with 51 additions and 57 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.6
0.0.7
2 changes: 1 addition & 1 deletion lingua/output/ackermann.trig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@prefix : <https://eyereasoner.github.io/eye/lingua/ackermann.trig#>.
@prefix : <https://eyereasoner.github.io/see/lingua/ackermann.trig#>.
@prefix lingua: <http://www.w3.org/2000/10/swap/lingua#>.
@prefix var: <http://www.w3.org/2000/10/swap/var#>.
@prefix log: <http://www.w3.org/2000/10/swap/log#>.
Expand Down
8 changes: 4 additions & 4 deletions lingua/output/acp.trig
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
@prefix : <https://eyereasoner.github.io/eye/lingua/acp.trig#>.
@prefix : <https://eyereasoner.github.io/see/lingua/acp.trig#>.
@prefix lingua: <http://www.w3.org/2000/10/swap/lingua#>.
@prefix var: <http://www.w3.org/2000/10/swap/var#>.
@prefix log: <http://www.w3.org/2000/10/swap/log#>.
@prefix list: <http://www.w3.org/2000/10/swap/list#>.

:acp_rule1 lingua:body _:gn_1.
:acp_rule1 lingua:head _:node_1.
:acp_rule1 lingua:bindings ((var:Test :test1) (var:Pol :PolicyX) (var:Field var:U_0) (var:X ((<https://eyereasoner.github.io/eye/lingua/acp.trig>) 1))).
:acp_rule1 lingua:bindings ((var:Test :test1) (var:Pol :PolicyX) (var:Field var:U_0) (var:X ((<https://eyereasoner.github.io/see/lingua/acp.trig>) 1))).
:acp_rule2 lingua:body _:gn_2.
:acp_rule2 lingua:head _:node_7.
:acp_rule2 lingua:bindings ((var:Test :test1) (var:Pol :PolicyX) (var:Field var:U_1) (var:List (:C)) (var:X ((<https://eyereasoner.github.io/eye/lingua/acp.trig>) 1)) (var:L 1)).
:acp_rule2 lingua:bindings ((var:Test :test1) (var:Pol :PolicyX) (var:Field var:U_1) (var:List (:C)) (var:X ((<https://eyereasoner.github.io/see/lingua/acp.trig>) 1)) (var:L 1)).
:acp_rule3 lingua:body _:gn_3.
:acp_rule3 lingua:head _:node_13.
:acp_rule3 lingua:bindings ((var:Test :test1) (var:Pol :PolicyX) (var:Field var:U_2) (var:List ()) (var:X ((<https://eyereasoner.github.io/eye/lingua/acp.trig>) 1)) (var:L 0)).
:acp_rule3 lingua:bindings ((var:Test :test1) (var:Pol :PolicyX) (var:Field var:U_2) (var:List ()) (var:X ((<https://eyereasoner.github.io/see/lingua/acp.trig>) 1)) (var:L 0)).
:acp_query lingua:question _:node_19.
:acp_query lingua:answer _:node_20.
:acp_query lingua:bindings ((var:Pol :PolicyX)).
Expand Down
2 changes: 1 addition & 1 deletion lingua/output/backward.trig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@prefix : <https://eyereasoner.github.io/eye/lingua/backward.trig#>.
@prefix : <https://eyereasoner.github.io/see/lingua/backward.trig#>.
@prefix lingua: <http://www.w3.org/2000/10/swap/lingua#>.
@prefix var: <http://www.w3.org/2000/10/swap/var#>.
@prefix math: <http://www.w3.org/2000/10/swap/math#>.
Expand Down
2 changes: 1 addition & 1 deletion lingua/output/complement.trig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@prefix : <https://eyereasoner.github.io/eye/lingua/complement.trig#>.
@prefix : <https://eyereasoner.github.io/see/lingua/complement.trig#>.
@prefix lingua: <http://www.w3.org/2000/10/swap/lingua#>.
@prefix var: <http://www.w3.org/2000/10/swap/var#>.
@prefix log: <http://www.w3.org/2000/10/swap/log#>.
Expand Down
2 changes: 1 addition & 1 deletion lingua/output/complex.trig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@prefix : <https://eyereasoner.github.io/eye/lingua/complex.trig#>.
@prefix : <https://eyereasoner.github.io/see/lingua/complex.trig#>.
@prefix lingua: <http://www.w3.org/2000/10/swap/lingua#>.
@prefix var: <http://www.w3.org/2000/10/swap/var#>.
@prefix complex: <http://eyereasoner.github.io/complex#>.
Expand Down
2 changes: 1 addition & 1 deletion lingua/output/derived.trig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@prefix : <https://eyereasoner.github.io/eye/lingua/derived.trig#>.
@prefix : <https://eyereasoner.github.io/see/lingua/derived.trig#>.
@prefix lingua: <http://www.w3.org/2000/10/swap/lingua#>.
@prefix var: <http://www.w3.org/2000/10/swap/var#>.

Expand Down
2 changes: 1 addition & 1 deletion lingua/output/fibonacci.trig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@prefix : <https://eyereasoner.github.io/eye/lingua/fibonacci.trig#>.
@prefix : <https://eyereasoner.github.io/see/lingua/fibonacci.trig#>.
@prefix lingua: <http://www.w3.org/2000/10/swap/lingua#>.
@prefix var: <http://www.w3.org/2000/10/swap/var#>.
@prefix math: <http://www.w3.org/2000/10/swap/math#>.
Expand Down
4 changes: 2 additions & 2 deletions lingua/output/filter.trig
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
@prefix : <https://eyereasoner.github.io/eye/lingua/filter.trig#>.
@prefix : <https://eyereasoner.github.io/see/lingua/filter.trig#>.
@prefix lingua: <http://www.w3.org/2000/10/swap/lingua#>.
@prefix var: <http://www.w3.org/2000/10/swap/var#>.
@prefix log: <http://www.w3.org/2000/10/swap/log#>.
@prefix string: <http://www.w3.org/2000/10/swap/string#>.

:filter_query lingua:question _:gn_1.
:filter_query lingua:answer _:node_2.
:filter_query lingua:bindings ((var:param var:U_1) (var:filteredParams ("Huey" "Dewey")) (var:scope ((<https://eyereasoner.github.io/eye/lingua/filter.trig>) 1))).
:filter_query lingua:bindings ((var:param var:U_1) (var:filteredParams ("Huey" "Dewey")) (var:scope ((<https://eyereasoner.github.io/see/lingua/filter.trig>) 1))).
:result :is ("Huey" "Dewey").
_:gn_1 {
(var:param _:node_5 var:filteredParams) log:collectAllIn var:scope.
Expand Down
2 changes: 1 addition & 1 deletion lingua/output/gps.trig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@prefix : <https://eyereasoner.github.io/eye/lingua/gps.trig#>.
@prefix : <https://eyereasoner.github.io/see/lingua/gps.trig#>.
@prefix lingua: <http://www.w3.org/2000/10/swap/lingua#>.
@prefix var: <http://www.w3.org/2000/10/swap/var#>.
@prefix gps: <http://eyereasoner.github.io/eye/reasoning/gps/gps-schema#>.
Expand Down
2 changes: 1 addition & 1 deletion lingua/output/graph.trig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@prefix : <https://eyereasoner.github.io/eye/lingua/graph.trig#>.
@prefix : <https://eyereasoner.github.io/see/lingua/graph.trig#>.
@prefix lingua: <http://www.w3.org/2000/10/swap/lingua#>.
@prefix var: <http://www.w3.org/2000/10/swap/var#>.

Expand Down
2 changes: 1 addition & 1 deletion lingua/output/mi.trig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@prefix : <https://eyereasoner.github.io/eye/lingua/mi.trig#>.
@prefix : <https://eyereasoner.github.io/see/lingua/mi.trig#>.
@prefix lingua: <http://www.w3.org/2000/10/swap/lingua#>.
@prefix var: <http://www.w3.org/2000/10/swap/var#>.
@prefix list: <http://www.w3.org/2000/10/swap/list#>.
Expand Down
2 changes: 1 addition & 1 deletion lingua/output/patch.trig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@prefix : <https://eyereasoner.github.io/eye/lingua/patch.trig#>.
@prefix : <https://eyereasoner.github.io/see/lingua/patch.trig#>.
@prefix lingua: <http://www.w3.org/2000/10/swap/lingua#>.
@prefix var: <http://www.w3.org/2000/10/swap/var#>.
@prefix log: <http://www.w3.org/2000/10/swap/log#>.
Expand Down
2 changes: 1 addition & 1 deletion lingua/output/pi.trig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@prefix : <https://eyereasoner.github.io/eye/lingua/pi.trig#>.
@prefix : <https://eyereasoner.github.io/see/lingua/pi.trig#>.
@prefix lingua: <http://www.w3.org/2000/10/swap/lingua#>.
@prefix var: <http://www.w3.org/2000/10/swap/var#>.
@prefix math: <http://www.w3.org/2000/10/swap/math#>.
Expand Down
2 changes: 1 addition & 1 deletion lingua/output/restdesc.trig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@prefix : <https://eyereasoner.github.io/eye/lingua/restdesc.trig#>.
@prefix : <https://eyereasoner.github.io/see/lingua/restdesc.trig#>.
@prefix lingua: <http://www.w3.org/2000/10/swap/lingua#>.
@prefix var: <http://www.w3.org/2000/10/swap/var#>.
@prefix http: <http://www.w3.org/2011/http#>.
Expand Down
2 changes: 1 addition & 1 deletion lingua/output/sha512.trig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@prefix : <https://eyereasoner.github.io/eye/lingua/sha512.trig#>.
@prefix : <https://eyereasoner.github.io/see/lingua/sha512.trig#>.
@prefix lingua: <http://www.w3.org/2000/10/swap/lingua#>.
@prefix var: <http://www.w3.org/2000/10/swap/var#>.
@prefix crypto: <http://www.w3.org/2000/10/swap/crypto#>.
Expand Down
2 changes: 1 addition & 1 deletion lingua/output/socrates.trig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@prefix : <https://eyereasoner.github.io/eye/lingua/socrates.trig#>.
@prefix : <https://eyereasoner.github.io/see/lingua/socrates.trig#>.
@prefix lingua: <http://www.w3.org/2000/10/swap/lingua#>.
@prefix var: <http://www.w3.org/2000/10/swap/var#>.
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
Expand Down
2 changes: 1 addition & 1 deletion lingua/output/turing.trig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@prefix : <https://eyereasoner.github.io/eye/lingua/turing.trig#>.
@prefix : <https://eyereasoner.github.io/see/lingua/turing.trig#>.
@prefix lingua: <http://www.w3.org/2000/10/swap/lingua#>.
@prefix var: <http://www.w3.org/2000/10/swap/var#>.
@prefix list: <http://www.w3.org/2000/10/swap/list#>.
Expand Down
2 changes: 1 addition & 1 deletion lingua/output/union.trig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@prefix : <https://eyereasoner.github.io/eye/lingua/union.trig#>.
@prefix : <https://eyereasoner.github.io/see/lingua/union.trig#>.
@prefix lingua: <http://www.w3.org/2000/10/swap/lingua#>.
@prefix var: <http://www.w3.org/2000/10/swap/var#>.
@prefix graph: <http://www.w3.org/2000/10/swap/graph#>.
Expand Down
2 changes: 1 addition & 1 deletion lingua/output/universal.trig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@prefix : <https://eyereasoner.github.io/eye/lingua/universal.trig#>.
@prefix : <https://eyereasoner.github.io/see/lingua/universal.trig#>.
@prefix lingua: <http://www.w3.org/2000/10/swap/lingua#>.
@prefix var: <http://www.w3.org/2000/10/swap/var#>.
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
Expand Down
2 changes: 1 addition & 1 deletion lingua/test
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ echo ""
for file in *.trig
do
echo -en "${file} "
swipl -g main ../see.pl -- --skolem-genid 8b98b360-9a70-4845-b52c-c675af60ad01 --wcache https://eyereasoner.github.io/eye .. https://eyereasoner.github.io/eye/lingua/$file --output output/$file
swipl -g main ../see.pl -- --genid 8b98b360-9a70-4845-b52c-c675af60ad01 --wcache https://eyereasoner.github.io/see .. https://eyereasoner.github.io/see/lingua/$file --output output/$file
if [[ $(git diff */$file | wc -l) -eq 0 ]]; then
echo -e "${GREEN}OK${NORMAL}"
((OK++))
Expand Down
58 changes: 26 additions & 32 deletions see.pl
Original file line number Diff line number Diff line change
Expand Up @@ -19,32 +19,32 @@
:- use_module(library(semweb/turtle)).
:- catch(use_module(library(http/http_open)), _, true).

version_info('SEE v0.0.6 (2024-03-06)').
version_info('SEE v0.0.7 (2024-03-06)').

help_info('Usage: see <options>* <data>*
see
swipl -g main see.pl --
<options>
--help show help info
--output <file> write reasoner output to <file>
--skolem-genid <genid> use <genid> in Skolem IRIs
--version show version info
--wcache <uri> <file> to tell that <uri> is cached as <file>
--genid <genid> use <genid> in Skolem IRIs
--help show help info
--output <file> write reasoner output to <file>
--version show version info
--wcache <uri> <file> to tell that <uri> is cached as <file>
<data>
<uri> TriG data').
<uri> TriG data').

:- dynamic(answer/3). % answer(Predicate, Subject, Object)
:- dynamic(answer/3). % answer(Predicate, Subject, Object)
:- dynamic(apfx/2).
:- dynamic(base_uri/1).
:- dynamic(brake/0).
:- dynamic(cc/1).
:- dynamic(cpred/1).
:- dynamic(exopred/3). % exopred(Predicate, Subject, Object)
:- dynamic(exopred/3). % exopred(Predicate, Subject, Object)
:- dynamic(flag/2).
:- dynamic(fpred/1).
:- dynamic(graph/2).
:- dynamic(hash_value/2).
:- dynamic(implies/3). % implies(Premise, Conclusion, Source)
:- dynamic(implies/2). % implies(Premise, Conclusion)
:- dynamic(keep_ng/1).
:- dynamic(keep_skolem/1).
:- dynamic(mtime/2).
Expand All @@ -55,7 +55,6 @@
:- dynamic(quad/2).
:- dynamic(query/2).
:- dynamic(recursion/1).
:- dynamic(retwist/3).
:- dynamic(rule_uvar/1).
:- dynamic(scope/1).
:- dynamic(tuple/2).
Expand Down Expand Up @@ -145,7 +144,7 @@
argv([Arg|Argvs], [U, V|Argus]) :-
sub_atom(Arg, B, 1, E, '='),
sub_atom(Arg, 0, B, _, U),
memberchk(U, ['--output', '--skolem-genid']),
memberchk(U, ['--output', '--genid']),
!,
sub_atom(Arg, _, E, 0, V),
argv(Argvs, Argus).
Expand All @@ -172,7 +171,7 @@
-> opts(['--help'], _)
; true
),
( flag('skolem-genid', Genid)
( flag('genid', Genid)
-> true
; uuid(Genid)
),
Expand Down Expand Up @@ -231,7 +230,7 @@
conj_append(D, remember(answer('<http://www.w3.org/2000/10/swap/lingua#conclusion>', R, B)), E),
conj_append(E, remember(answer('<http://www.w3.org/2000/10/swap/lingua#bindings>', R, W)), F)
; F = I
)), '<http://www.w3.org/2000/10/swap/log#implies>'(Q, F), '<>')),
)), '<http://www.w3.org/2000/10/swap/log#implies>'(Q, F))),
% create backward rules
assertz(implies((
'<http://www.w3.org/2000/10/swap/lingua#body>'(R, A),
Expand All @@ -251,7 +250,7 @@
assertz(C),
retractall(brake)
; true
)), true, '<>')),
)), true)),
% create queries
assertz(implies((
'<http://www.w3.org/2000/10/swap/lingua#question>'(R, A),
Expand All @@ -267,15 +266,15 @@
conj_append(Q, remember(answer('<http://www.w3.org/2000/10/swap/lingua#question>', R, A)), D),
conj_append(D, remember(answer('<http://www.w3.org/2000/10/swap/lingua#answer>', R, B)), E),
conj_append(E, remember(answer('<http://www.w3.org/2000/10/swap/lingua#bindings>', R, W)), F),
C = implies(F, I, '<>'),
C = implies(F, I),
copy_term_nat(C, CC),
labelvars(CC, 0, _, avar),
( \+cc(CC)
-> assertz(cc(CC)),
assertz(C),
retractall(brake)
; true
)), true, '<>')),
)), true)),
% set scope
findall(Sc,
( scope(Sc)
Expand Down Expand Up @@ -314,6 +313,11 @@

opts([], []) :-
!.
opts(['--genid', Genid|Argus], Args) :-
!,
retractall(flag('genid', _)),
assertz(flag('genid', Genid)),
opts(Argus, Args).
opts(['--help'|_], _) :-
!,
help_info(Help),
Expand All @@ -327,11 +331,6 @@
tell(Out),
assertz(flag('output', Out)),
opts(Argus, Args).
opts(['--skolem-genid', Genid|Argus], Args) :-
!,
retractall(flag('skolem-genid', _)),
assertz(flag('skolem-genid', Genid)),
opts(Argus, Args).
opts(['--version'|_], _) :-
!,
version_info(Version),
Expand Down Expand Up @@ -1073,7 +1072,7 @@
% ----------------------------

eam(Recursion) :-
( implies(Prem, Conc, _),
( implies(Prem, Conc),
ignore(Prem = true),
catch(call_residue_vars(ucall(Prem), []), Exc,
( Exc = error(existence_error(procedure, _), _)
Expand Down Expand Up @@ -1242,7 +1241,7 @@
-> assertz(pred(P))
; true
).
djiti_fact(implies(A, B, C), implies(A, B, C)) :-
djiti_fact(implies(A, B), implies(A, B)) :-
nonvar(B),
conj_list(B, D),
forall(
Expand Down Expand Up @@ -1273,11 +1272,7 @@
)
),
!,
( retwist(A, B, Z)
-> true
; Z = '<>'
),
makevars(implies(A, B, Z), C, zeta).
makevars(implies(A, B), C, zeta).
djiti_fact(':-'(A, B), ':-'(C, D)) :-
!,
makevars((A, B), (C, D), eta).
Expand Down Expand Up @@ -1639,8 +1634,7 @@
forall(
member(E, D),
( ( E = '<http://www.w3.org/2000/10/swap/log#implies>'(Prem, Conc)
-> retract(implies(Prem, Conc, Src)),
assertz(retwist(Prem, Conc, Src))
-> retract(implies(Prem, Conc))
; ( E = ':-'(Ci, Pi),
Pi \= true
-> retract(':-'(Ci, Pi))
Expand Down Expand Up @@ -1774,7 +1768,7 @@
).

'<http://www.w3.org/2000/10/swap/log#implies>'(A, B) :-
implies(U, V, _),
implies(U, V),
unify(U, A),
unify(V, B),
( commonvars(A, B, [])
Expand Down

0 comments on commit d60d4d6

Please sign in to comment.