Commit 40017327 authored by josd's avatar josd

adding e:ccdTransform built-in to transform case control datamodels

parent c2acde26
EYE release
[v18.1222.1845] adding e:ccdTransform built-in to transform case control datamodels
[v18.1214.1911] reintroducing --carl switch and original N3 parser
[v18.1130.1238] updating reasoning to always use PREFIX instead of @prefix
[v18.1123.1028] removing libgmp dependency
......
EYE v18.1214.1911 josd
EYE v18.1222.1845 josd
......@@ -25,6 +25,7 @@ e:binaryEntropy a e:Builtin.
e:calculate a e:Builtin.
e:call a e:Builtin.
e:cartesianProduct a e:Builtin.
e:ccdTransform a e:Builtin.
e:compoundTerm a e:Builtin.
e:cov a e:Builtin.
e:csvTuple a e:Builtin.
......
......@@ -36,7 +36,7 @@
:- set_prolog_flag(encoding, utf8).
:- endif.
version_info('EYE v18.1214.1911 josd').
version_info('EYE v18.1222.1845 josd').
license_info('MIT License
......@@ -5086,6 +5086,31 @@ djiti_assertz(A) :-
B
).
'<http://eulersharp.sourceforge.net/2003/03swap/log-rules#ccdTransform>'([A, B], [C, D]) :-
findall([E, F, G],
( member([E, F, H, I], A),
( H =:= 0
-> G is 1/(2*I)
; ( I =:= 0
-> G is 2*H
; G is H/I
)
)
),
C
),
findall(G,
( member([E, F, G], C)
),
J
),
product(J, K),
length(J, L),
( L > 0
-> D is B*K**(1/L)/(1+B*K**(1/L))
; D is 0.5
).
% DEPRECATED
'<http://eulersharp.sourceforge.net/2003/03swap/log-rules#closure>'(Sc, A) :-
within_scope(Sc),
......
No preview for this file type
......@@ -130,6 +130,11 @@ e:cartesianProduct a rdf:Property, e:Builtin;
rdfs:domain rdf:List;
rdfs:range rdf:List.
e:ccdTransform a rdf:Property, e:Builtin;
rdfs:comment "built-in to transform case control datamodels";
rdfs:domain rdf:List;
rdfs:range rdf:List.
e:clashesWith a rdf:Property;
rdfs:comment "to say that the graph is XSD-inconsistent or has a datatype clash";
rdfs:domain rdfs:Literal;
......
PREFIX : <http://josd.github.io/eye/reasoning#>
[] :input1 "xyz"; :input3 (0 1); :input4 :v4; :input5 "a"; :output1 1.
[] :input1 "xyz"; :input3 (0 1); :input4 :v4; :input5 "b"; :output1 1.
[] :input1 "abc"; :input2 60; :input4 :v3; :input5 "a"; :output1 0.
[] :input1 "xyz"; :input2 40; :input5 "a"; :output1 1.
[] :input1 "def"; :input2 50; :input3 (0 1); :input4 :v3; :output1 0.
......@@ -5,11 +5,11 @@ PREFIX e: <http://eulersharp.sourceforge.net/2003/03swap/log-rules#>
PREFIX : <http://josd.github.io/eye/reasoning#>
{
(?S ?IL) :answer (:output1 ?OV :expected ?U :belief ?B).
?S :answer (:expected ?U :predicted ?V :belief ?B :evidence ?E).
} <= {
?S :output1 ?U.
?SCOPE e:findall (
(?P ?O ?D)
(?P ?O ?C ?N)
{
(
:input1
......@@ -20,46 +20,16 @@ PREFIX : <http://josd.github.io/eye/reasoning#>
) list:member ?P.
?S ?P ?O.
(?P ?O) :ccd (?C ?N).
?SCOPE e:optional {
?C math:equalTo 0.
(?N 0.0001) math:product ?E.
(?C ?E) math:sum ?CH.
}.
?SCOPE e:optional {
?CH log:equalTo ?C.
}.
?SCOPE e:optional {
?N math:equalTo 0.
(?C 0.0001) math:product ?E.
(?N ?E) math:sum ?NH.
}.
?SCOPE e:optional {
?NH log:equalTo ?N.
}.
(?CH ?NH) math:quotient ?D.
}
?IL
?CL
).
?SCOPE e:findall (?D {?IL list:member (?P ?O ?D)} ?DL).
?DL math:product ?DP.
?DL math:memberCount ?DN.
?SCOPE e:optional {
?DN math:greaterThan 0.
(1 ?DN) math:quotient ?DQ.
(?DP ?DQ) math:exponentiation ?DE.
(?DE 0.95) math:product ?BN.
}.
?SCOPE e:optional {
?BN log:equalTo 1.
}.
(?BN 1) math:sum ?BD.
(?BN ?BD) math:quotient ?Q.
(?CL 0.64) e:ccdTransform (?E ?Q).
?SCOPE e:optional {
?Q math:greaterThan 0.5.
(?OV ?B) log:equalTo (1 ?Q).
(?V ?B) log:equalTo (1 ?Q).
}.
?SCOPE e:optional {
(1 ?Q) math:difference ?D.
(?OV ?B) log:equalTo (0 ?D).
(?V ?B) log:equalTo (0 ?D).
}.
}.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment