From d60d4d64eea0633d52f36dd4fb9ec0132dde2497 Mon Sep 17 00:00:00 2001 From: josd Date: Wed, 6 Mar 2024 00:52:17 +0100 Subject: [PATCH] running top 20 lingua cases --- VERSION | 2 +- lingua/output/ackermann.trig | 2 +- lingua/output/acp.trig | 8 ++--- lingua/output/backward.trig | 2 +- lingua/output/complement.trig | 2 +- lingua/output/complex.trig | 2 +- lingua/output/derived.trig | 2 +- lingua/output/fibonacci.trig | 2 +- lingua/output/filter.trig | 4 +-- lingua/output/gps.trig | 2 +- lingua/output/graph.trig | 2 +- lingua/output/mi.trig | 2 +- lingua/output/patch.trig | 2 +- lingua/output/pi.trig | 2 +- lingua/output/restdesc.trig | 2 +- lingua/output/sha512.trig | 2 +- lingua/output/socrates.trig | 2 +- lingua/output/turing.trig | 2 +- lingua/output/union.trig | 2 +- lingua/output/universal.trig | 2 +- lingua/test | 2 +- see.pl | 58 ++++++++++++++++------------------- 22 files changed, 51 insertions(+), 57 deletions(-) diff --git a/VERSION b/VERSION index 1750564..5a5831a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.0.6 +0.0.7 diff --git a/lingua/output/ackermann.trig b/lingua/output/ackermann.trig index 2f39766..0b0687e 100644 --- a/lingua/output/ackermann.trig +++ b/lingua/output/ackermann.trig @@ -1,4 +1,4 @@ -@prefix : . +@prefix : . @prefix lingua: . @prefix var: . @prefix log: . diff --git a/lingua/output/acp.trig b/lingua/output/acp.trig index 2df74d5..3807786 100644 --- a/lingua/output/acp.trig +++ b/lingua/output/acp.trig @@ -1,4 +1,4 @@ -@prefix : . +@prefix : . @prefix lingua: . @prefix var: . @prefix log: . @@ -6,13 +6,13 @@ :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 (() 1))). +:acp_rule1 lingua:bindings ((var:Test :test1) (var:Pol :PolicyX) (var:Field var:U_0) (var:X (() 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 (() 1)) (var:L 1)). +:acp_rule2 lingua:bindings ((var:Test :test1) (var:Pol :PolicyX) (var:Field var:U_1) (var:List (:C)) (var:X (() 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 (() 1)) (var:L 0)). +:acp_rule3 lingua:bindings ((var:Test :test1) (var:Pol :PolicyX) (var:Field var:U_2) (var:List ()) (var:X (() 1)) (var:L 0)). :acp_query lingua:question _:node_19. :acp_query lingua:answer _:node_20. :acp_query lingua:bindings ((var:Pol :PolicyX)). diff --git a/lingua/output/backward.trig b/lingua/output/backward.trig index 64d4d3c..51245a9 100644 --- a/lingua/output/backward.trig +++ b/lingua/output/backward.trig @@ -1,4 +1,4 @@ -@prefix : . +@prefix : . @prefix lingua: . @prefix var: . @prefix math: . diff --git a/lingua/output/complement.trig b/lingua/output/complement.trig index f72378b..5cd3b0f 100644 --- a/lingua/output/complement.trig +++ b/lingua/output/complement.trig @@ -1,4 +1,4 @@ -@prefix : . +@prefix : . @prefix lingua: . @prefix var: . @prefix log: . diff --git a/lingua/output/complex.trig b/lingua/output/complex.trig index 96f65e0..105817d 100644 --- a/lingua/output/complex.trig +++ b/lingua/output/complex.trig @@ -1,4 +1,4 @@ -@prefix : . +@prefix : . @prefix lingua: . @prefix var: . @prefix complex: . diff --git a/lingua/output/derived.trig b/lingua/output/derived.trig index 40674dd..34f23f7 100644 --- a/lingua/output/derived.trig +++ b/lingua/output/derived.trig @@ -1,4 +1,4 @@ -@prefix : . +@prefix : . @prefix lingua: . @prefix var: . diff --git a/lingua/output/fibonacci.trig b/lingua/output/fibonacci.trig index 5d630ed..0398308 100644 --- a/lingua/output/fibonacci.trig +++ b/lingua/output/fibonacci.trig @@ -1,4 +1,4 @@ -@prefix : . +@prefix : . @prefix lingua: . @prefix var: . @prefix math: . diff --git a/lingua/output/filter.trig b/lingua/output/filter.trig index 1bc463f..b0d6fa2 100644 --- a/lingua/output/filter.trig +++ b/lingua/output/filter.trig @@ -1,4 +1,4 @@ -@prefix : . +@prefix : . @prefix lingua: . @prefix var: . @prefix log: . @@ -6,7 +6,7 @@ :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 (() 1))). +:filter_query lingua:bindings ((var:param var:U_1) (var:filteredParams ("Huey" "Dewey")) (var:scope (() 1))). :result :is ("Huey" "Dewey"). _:gn_1 { (var:param _:node_5 var:filteredParams) log:collectAllIn var:scope. diff --git a/lingua/output/gps.trig b/lingua/output/gps.trig index 2f0cefc..97ce6fe 100644 --- a/lingua/output/gps.trig +++ b/lingua/output/gps.trig @@ -1,4 +1,4 @@ -@prefix : . +@prefix : . @prefix lingua: . @prefix var: . @prefix gps: . diff --git a/lingua/output/graph.trig b/lingua/output/graph.trig index 24db7cf..c175102 100644 --- a/lingua/output/graph.trig +++ b/lingua/output/graph.trig @@ -1,4 +1,4 @@ -@prefix : . +@prefix : . @prefix lingua: . @prefix var: . diff --git a/lingua/output/mi.trig b/lingua/output/mi.trig index ec6405d..837176d 100644 --- a/lingua/output/mi.trig +++ b/lingua/output/mi.trig @@ -1,4 +1,4 @@ -@prefix : . +@prefix : . @prefix lingua: . @prefix var: . @prefix list: . diff --git a/lingua/output/patch.trig b/lingua/output/patch.trig index 9498419..25c6213 100644 --- a/lingua/output/patch.trig +++ b/lingua/output/patch.trig @@ -1,4 +1,4 @@ -@prefix : . +@prefix : . @prefix lingua: . @prefix var: . @prefix log: . diff --git a/lingua/output/pi.trig b/lingua/output/pi.trig index 949d8ed..656d8b9 100644 --- a/lingua/output/pi.trig +++ b/lingua/output/pi.trig @@ -1,4 +1,4 @@ -@prefix : . +@prefix : . @prefix lingua: . @prefix var: . @prefix math: . diff --git a/lingua/output/restdesc.trig b/lingua/output/restdesc.trig index 8494732..a06aefb 100644 --- a/lingua/output/restdesc.trig +++ b/lingua/output/restdesc.trig @@ -1,4 +1,4 @@ -@prefix : . +@prefix : . @prefix lingua: . @prefix var: . @prefix http: . diff --git a/lingua/output/sha512.trig b/lingua/output/sha512.trig index a5ae69a..a0bd10e 100644 --- a/lingua/output/sha512.trig +++ b/lingua/output/sha512.trig @@ -1,4 +1,4 @@ -@prefix : . +@prefix : . @prefix lingua: . @prefix var: . @prefix crypto: . diff --git a/lingua/output/socrates.trig b/lingua/output/socrates.trig index afd531e..6fbfdf7 100644 --- a/lingua/output/socrates.trig +++ b/lingua/output/socrates.trig @@ -1,4 +1,4 @@ -@prefix : . +@prefix : . @prefix lingua: . @prefix var: . @prefix rdfs: . diff --git a/lingua/output/turing.trig b/lingua/output/turing.trig index ee87707..3aa2bab 100644 --- a/lingua/output/turing.trig +++ b/lingua/output/turing.trig @@ -1,4 +1,4 @@ -@prefix : . +@prefix : . @prefix lingua: . @prefix var: . @prefix list: . diff --git a/lingua/output/union.trig b/lingua/output/union.trig index 276fa61..5c35f3c 100644 --- a/lingua/output/union.trig +++ b/lingua/output/union.trig @@ -1,4 +1,4 @@ -@prefix : . +@prefix : . @prefix lingua: . @prefix var: . @prefix graph: . diff --git a/lingua/output/universal.trig b/lingua/output/universal.trig index 128c4f3..3a18096 100644 --- a/lingua/output/universal.trig +++ b/lingua/output/universal.trig @@ -1,4 +1,4 @@ -@prefix : . +@prefix : . @prefix lingua: . @prefix var: . @prefix rdfs: . diff --git a/lingua/test b/lingua/test index 8765cb6..4d8f338 100755 --- a/lingua/test +++ b/lingua/test @@ -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++)) diff --git a/see.pl b/see.pl index ec65184..88426d6 100644 --- a/see.pl +++ b/see.pl @@ -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 * * see swipl -g main see.pl -- - --help show help info - --output write reasoner output to - --skolem-genid use in Skolem IRIs - --version show version info - --wcache to tell that is cached as + --genid use in Skolem IRIs + --help show help info + --output write reasoner output to + --version show version info + --wcache to tell that is cached as - TriG data'). + 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). @@ -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). @@ -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). @@ -172,7 +171,7 @@ -> opts(['--help'], _) ; true ), - ( flag('skolem-genid', Genid) + ( flag('genid', Genid) -> true ; uuid(Genid) ), @@ -231,7 +230,7 @@ conj_append(D, remember(answer('', R, B)), E), conj_append(E, remember(answer('', R, W)), F) ; F = I - )), ''(Q, F), '<>')), + )), ''(Q, F))), % create backward rules assertz(implies(( ''(R, A), @@ -251,7 +250,7 @@ assertz(C), retractall(brake) ; true - )), true, '<>')), + )), true)), % create queries assertz(implies(( ''(R, A), @@ -267,7 +266,7 @@ conj_append(Q, remember(answer('', R, A)), D), conj_append(D, remember(answer('', R, B)), E), conj_append(E, remember(answer('', R, W)), F), - C = implies(F, I, '<>'), + C = implies(F, I), copy_term_nat(C, CC), labelvars(CC, 0, _, avar), ( \+cc(CC) @@ -275,7 +274,7 @@ assertz(C), retractall(brake) ; true - )), true, '<>')), + )), true)), % set scope findall(Sc, ( scope(Sc) @@ -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), @@ -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), @@ -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, _), _) @@ -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( @@ -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). @@ -1639,8 +1634,7 @@ forall( member(E, D), ( ( E = ''(Prem, Conc) - -> retract(implies(Prem, Conc, Src)), - assertz(retwist(Prem, Conc, Src)) + -> retract(implies(Prem, Conc)) ; ( E = ':-'(Ci, Pi), Pi \= true -> retract(':-'(Ci, Pi)) @@ -1774,7 +1768,7 @@ ). ''(A, B) :- - implies(U, V, _), + implies(U, V), unify(U, A), unify(V, B), ( commonvars(A, B, [])