eyeprolog 0.5.13 → 0.5.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -45,6 +45,32 @@
45
45
  %% goal: checkC10Text(X0, X1)
46
46
 
47
47
 
48
+ :- discontiguous(policyUid/2).
49
+ :- discontiguous(purposeAllowed/2).
50
+ :- discontiguous(requireEnvironment/2).
51
+ :- discontiguous(allowAnyCategory/2).
52
+ :- discontiguous(duty/2).
53
+ :- discontiguous(scenario/1).
54
+ :- discontiguous(outputKey/2).
55
+ :- discontiguous(scenario_label/2).
56
+ :- discontiguous(scenario_description/2).
57
+ :- discontiguous(requester/2).
58
+ :- discontiguous(requesterRole/2).
59
+ :- discontiguous(subject/2).
60
+ :- discontiguous(purpose/2).
61
+ :- discontiguous(environment/2).
62
+ :- discontiguous(category/2).
63
+ :- discontiguous(checkC1/2).
64
+ :- discontiguous(checkC2/2).
65
+ :- discontiguous(checkC3/2).
66
+ :- discontiguous(checkC4/2).
67
+ :- discontiguous(checkC5/2).
68
+ :- discontiguous(checkC6/2).
69
+ :- discontiguous(checkC7/2).
70
+ :- discontiguous(checkC8/2).
71
+ :- discontiguous(checkC9/2).
72
+ :- discontiguous(checkC10Text/2).
73
+
48
74
  % Program structure: facts set up the scenario, and rules derive the queried conclusions.
49
75
  caseName(case, "auroracare").
50
76
  question(case, "For each AuroraCare scenario, should the PDP permit or deny the requested use of health data, and why?").
package/examples/bmi.pl CHANGED
@@ -71,6 +71,15 @@
71
71
  %% goal: checkPassed(X0, X1)
72
72
 
73
73
 
74
+ :- discontiguous(weightKg/2).
75
+ :- discontiguous(heightM/2).
76
+ :- discontiguous(units/2).
77
+ :- discontiguous(bmi/2).
78
+ :- discontiguous(category/2).
79
+ :- discontiguous(healthyMinKg/2).
80
+ :- discontiguous(healthyMaxKg/2).
81
+ :- discontiguous(heightCm/2).
82
+
74
83
  % Program structure: facts set up the scenario, and rules derive the queried conclusions.
75
84
  unitSystem(input, metric).
76
85
  weight(input, 72.0).
@@ -260,4 +269,14 @@ heightCm(report, Height) :-
260
269
  heightCm(answer, Height).
261
270
 
262
271
  checkPassed(report, Check) :-
263
- statement(check, Check, _message).
272
+ statement(check, Check, _Message).
273
+
274
+ statement(check, c1, Message) :- c1(check, Message).
275
+ statement(check, c2, Message) :- c2(check, Message).
276
+ statement(check, c3, Message) :- c3(check, Message).
277
+ statement(check, c4, Message) :- c4(check, Message).
278
+ statement(check, c5, Message) :- c5(check, Message).
279
+ statement(check, c6, Message) :- c6(check, Message).
280
+ statement(check, c7, Message) :- c7(check, Message).
281
+ statement(check, c8, Message) :- c8(check, Message).
282
+ statement(check, c9, Message) :- c9(check, Message).
@@ -17,9 +17,9 @@
17
17
  %% goal: cdclAnswer(X0, X1)
18
18
 
19
19
 
20
- clause(c1, [neg(a), pos(c)]).
21
- clause(c2, [neg(c)]).
22
- clause(c3, [pos(a), pos(b)]).
20
+ sat_clause(c1, [neg(a), pos(c)]).
21
+ sat_clause(c2, [neg(c)]).
22
+ sat_clause(c3, [pos(a), pos(b)]).
23
23
 
24
24
  % Initial trail before conflict analysis.
25
25
  initial_value(a, true, decision(level1)).
@@ -38,7 +38,7 @@ call_value(final, Var, Value, Reason) :- final_value(Var, Value, Reason).
38
38
 
39
39
  % A clause is conflicting when all of its literals are false under a trail.
40
40
  conflict(Trail, Clause) :-
41
- clause(Clause, Literals),
41
+ sat_clause(Clause, Literals),
42
42
  \+ nonfalse_literal(Trail, Literals).
43
43
  nonfalse_literal(Trail, Literals) :-
44
44
  member(Literal, Literals),
@@ -56,13 +56,13 @@ final_value(c, false, unit(c2)).
56
56
  final_value(b, true, unit(c3)).
57
57
 
58
58
  model_satisfies_clause(Trail, Clause) :-
59
- clause(Clause, Literals),
59
+ sat_clause(Clause, Literals),
60
60
  member(Literal, Literals),
61
61
  lit_true(Literal, Trail).
62
62
 
63
63
  final_model_ok(ok) :- \+ unsatisfied_final_clause.
64
64
  unsatisfied_final_clause :-
65
- clause(Name, _),
65
+ sat_clause(Name, _),
66
66
  \+ model_satisfies_clause(final, Name).
67
67
 
68
68
  cdclAnswer(conflict_clause, Clause) :- conflict(initial, Clause).
@@ -8,6 +8,9 @@
8
8
  %% goal: sameInputByCompositeInjectivity(X0, X1, X2)
9
9
 
10
10
 
11
+ :- discontiguous(app/3).
12
+ :- discontiguous(sameTerm/2).
13
+
11
14
  % Program structure: facts set up the scenario, and rules derive the queried conclusions.
12
15
  inX(a).
13
16
  inX(b).
@@ -19,7 +22,7 @@ inZ(e).
19
22
  sameTerm(X, X) :- inX(X).
20
23
  sameTerm(X, X) :- inY(X).
21
24
  sameTerm(X, X) :- inZ(X).
22
- sameTerm(Y, X) :- sameTerm(X, Y).
25
+ sameTerm(Y, X) :- Y @< X, sameTerm(X, Y).
23
26
 
24
27
  app(f, a, c).
25
28
  app(f, b, d).
@@ -19,6 +19,8 @@
19
19
  %% goal: arc(X0, X1)
20
20
 
21
21
 
22
+ :- discontiguous(a/2).
23
+
22
24
  % Program structure: facts set up the scenario, and rules derive the queried conclusions.
23
25
  % fact
24
26
 
@@ -19,6 +19,8 @@
19
19
  %% goal: arc(X0, X1)
20
20
 
21
21
 
22
+ :- discontiguous(a/2).
23
+
22
24
  % Program structure: facts set up the scenario, and rules derive the queried conclusions.
23
25
  % fact
24
26
 
@@ -19,6 +19,8 @@
19
19
  %% goal: arc(X0, X1)
20
20
 
21
21
 
22
+ :- discontiguous(a/2).
23
+
22
24
  % Program structure: facts set up the scenario, and rules derive the queried conclusions.
23
25
  % fact
24
26
 
@@ -19,6 +19,8 @@
19
19
  %% goal: arc(X0, X1)
20
20
 
21
21
 
22
+ :- discontiguous(a/2).
23
+
22
24
  % Program structure: facts set up the scenario, and rules derive the queried conclusions.
23
25
  % fact
24
26
 
@@ -18,6 +18,9 @@
18
18
  %% goal: reason(X0, X1)
19
19
 
20
20
 
21
+ :- discontiguous(confirms_in_world/2).
22
+ :- discontiguous(rejects_in_world/2).
23
+
21
24
  % candidate/4 stores occurrence rate, sensitivity, and specificity. world/2
22
25
  % names the alternative validation policies applied to the same signals.
23
26
  candidate(rare_wide_orbit, 0.001, 0.99, 0.99).
@@ -8,6 +8,8 @@
8
8
  %% goal: cousin(X0, X1)
9
9
 
10
10
 
11
+ :- discontiguous(branch/2).
12
+
11
13
  % The family tree is scoped inside family_graph/2. family_statement/3 projects
12
14
  % only the parent and seedBranch facts that the cousin rules need.
13
15
 
@@ -20,20 +20,20 @@
20
20
 
21
21
  % Base case and parity split for exponentiation by squaring. Even exponents
22
22
  % square the half-power; odd exponents peel off one base factor.
23
- (1 is _base ** 0).
23
+ fast_power(_Base, 0, 1).
24
24
  % Recursive even/odd clauses reduce the exponent quickly rather than counting
25
25
  % down one multiplication at a time.
26
- (Value is Base ** Exp) :-
26
+ fast_power(Base, Exp, Value) :-
27
27
  (Exp > 0),
28
28
  (0 is Exp mod 2),
29
29
  (Half is Exp // 2),
30
- (Halfvalue is Base ** Half),
30
+ fast_power(Base, Half, Halfvalue),
31
31
  (Value is Halfvalue * Halfvalue).
32
- (Value is Base ** Exp) :-
32
+ fast_power(Base, Exp, Value) :-
33
33
  (Exp > 0),
34
34
  (1 is Exp mod 2),
35
35
  (Evenexp is Exp - 1),
36
- (Evenvalue is Base ** Evenexp),
36
+ fast_power(Base, Evenexp, Evenvalue),
37
37
  (Value is Base * Evenvalue).
38
38
 
39
39
  % pow_mod/4 applies the modulus at each multiplication to keep values small.
@@ -58,7 +58,7 @@ pow_mod(Base, Exp, Mod, Value) :-
58
58
  tower(2, 4, 65536).
59
59
  tower_mod(2, 5, 1000000, 156736).
60
60
 
61
- pow([2, 10], Value) :- (Value is 2 ** 10).
61
+ pow([2, 10], Value) :- fast_power(2, 10, Power), (Value is Power + 0.0).
62
62
  powSlow([2, 10], Value) :- (Value is 2 ** 10).
63
63
  powMod1e6([2, 10000], Value) :- pow_mod(2, 10000, 1000000, Value).
64
64
  powMod1e6([3, 10000], Value) :- pow_mod(3, 10000, 1000000, Value).
@@ -81,6 +81,20 @@
81
81
  %% goal: lowestCostEligiblePackageChosen(X0, X1)
82
82
 
83
83
 
84
+ :- discontiguous(industrialCluster/1).
85
+ :- discontiguous(clusterName/2).
86
+ :- discontiguous(exportOrdersIndex/2).
87
+ :- discontiguous(energyIntensity/2).
88
+ :- discontiguous(policyPackage/1).
89
+ :- discontiguous(packageId/2).
90
+ :- discontiguous(packageName/2).
91
+ :- discontiguous(costMEUR/2).
92
+ :- discontiguous(worker_coverage/2).
93
+ :- discontiguous(grid_relief_mw/2).
94
+ :- discontiguous(coversExportWeakness/2).
95
+ :- discontiguous(coversSkillsStrain/2).
96
+ :- discontiguous(coversGridStress/2).
97
+
84
98
  % Program structure: facts set up the scenario, and rules derive the queried conclusions.
85
99
  % Case metadata describes the request, audit window, and expected file writes.
86
100
  case_name(case, "flandor").
@@ -24,6 +24,9 @@
24
24
  %% goal: widthContractsAt(X0, X1)
25
25
 
26
26
 
27
+ :- discontiguous(x_bounds/3).
28
+ :- discontiguous(width/2).
29
+
27
30
  % Program structure: facts set up the scenario, and rules derive the queried conclusions.
28
31
 
29
32
  % Adapted from Eyeling's gd-step-certified.n3.
@@ -14,21 +14,21 @@ element(x).
14
14
  element(i).
15
15
  element(j).
16
16
 
17
- % leftInverse/2 and rightInverse/2 are proved from op/3. sameInverse/3
17
+ % leftInverse/2 and rightInverse/2 are proved from group_op/3. sameInverse/3
18
18
  % then derives uniqueness by combining both inverse directions with sameTerm/2.
19
- op(e, X, X) :- element(X).
20
- op(X, e, X) :- element(X).
21
- op(i, x, e).
22
- op(x, j, e).
23
- op(j, x, e).
24
- op(x, i, e).
19
+ group_op(e, X, X) :- element(X).
20
+ group_op(X, e, X) :- element(X).
21
+ group_op(i, x, e).
22
+ group_op(x, j, e).
23
+ group_op(j, x, e).
24
+ group_op(x, i, e).
25
25
 
26
26
  sameTerm(X, X) :- element(X).
27
27
  sameTerm(i, j).
28
28
  sameTerm(j, i).
29
29
 
30
- leftInverse(A, B) :- op(B, A, e).
31
- rightInverse(A, B) :- op(A, B, e).
30
+ leftInverse(A, B) :- group_op(B, A, e).
31
+ rightInverse(A, B) :- group_op(A, B, e).
32
32
 
33
33
  sameInverse(A, B, C) :-
34
34
  leftInverse(A, B),
@@ -23,6 +23,12 @@
23
23
  %% goal: omittedAlternative(X0, X1)
24
24
 
25
25
 
26
+ :- discontiguous(argument/1).
27
+ :- discontiguous(implication/3).
28
+ :- discontiguous(observed/2).
29
+ :- discontiguous(concludes/2).
30
+ :- discontiguous(reason/2).
31
+
26
32
  % Program structure: facts set up the scenario, and rules derive the queried conclusions.
27
33
  argument(arg_affirming_consequent).
28
34
  implication(arg_affirming_consequent, rain, street_wet).
@@ -65,16 +65,10 @@ rdf_number(Subject, Predicate, Number) :-
65
65
  iri_term(Subject, SubjectIri),
66
66
  iri_term(Predicate, PredicateIri),
67
67
  rdf(iri(SubjectIri), iri(PredicateIri), literal(Text, datatype(_Datatype)), default_graph),
68
- number_string(Number, Text).
68
+ atom_chars(Text, Chars),
69
+ number_chars(Number, Chars).
69
70
 
70
71
  iri_term(ex(Name), Iri) :- namespace_iri('https://example.org/', Name, Iri).
71
72
  iri_term(odrl(Name), Iri) :- namespace_iri('http://www.w3.org/ns/odrl/2/', Name, Iri).
72
73
 
73
- namespace_iri(Prefix, Name, Iri) :-
74
- atom(Name),
75
- !,
76
- atom_string(Name, Local),
77
- string_concat(Prefix, Local, Iri).
78
- namespace_iri(Prefix, Name, Iri) :-
79
- string_concat(Prefix, Local, Iri),
80
- atom_string(Name, Local).
74
+ namespace_iri(Prefix, Name, Iri) :- atom_concat(Prefix, Name, Iri).
@@ -2,11 +2,11 @@
2
2
  % Demonstrates list literals, member/2, length/2, append/3, and [Head|Tail].
3
3
  % Each queried relation demonstrates one list operation.
4
4
  % Output declarations: host-supplied goals select the relations written to this example's golden output.
5
- %% goal: length(X0, X1)
5
+ %% goal: collectionLength(X0, X1)
6
6
 
7
- %% goal: member(X0, X1)
7
+ %% goal: collectionMember(X0, X1)
8
8
 
9
- %% goal: append(X0, X1)
9
+ %% goal: collectionAppend(X0, X1)
10
10
 
11
11
  %% goal: head(X0, X1)
12
12
 
@@ -21,15 +21,15 @@ collection(letters, [a, b]).
21
21
 
22
22
  % The derived predicates show list length, membership, append, and pattern
23
23
  % matching with [Head|Tail] in the smallest possible setting.
24
- length(numbers, N) :-
24
+ collectionLength(numbers, N) :-
25
25
  collection(numbers, List),
26
26
  length(List, N).
27
27
 
28
- member(numbers, X) :-
28
+ collectionMember(numbers, X) :-
29
29
  collection(numbers, List),
30
30
  member(X, List).
31
31
 
32
- append(letters, Extended) :-
32
+ collectionAppend(letters, Extended) :-
33
33
  collection(letters, List),
34
34
  append(List, [c], Extended).
35
35
 
package/examples/lldm.pl CHANGED
@@ -18,6 +18,8 @@
18
18
  %% goal: lld_reason(X0, X1)
19
19
 
20
20
 
21
+ :- discontiguous(val/3).
22
+
21
23
  % val/3 stores raw landmark coordinates, derived deltas, line coefficients,
22
24
  % projected landmarks, lengths, and alarm values in one measurement namespace.
23
25
  measurement(meas47).
@@ -100,16 +100,10 @@ rdf_number(Subject, Predicate, Number) :-
100
100
  iri_term(Subject, SubjectIri),
101
101
  iri_term(Predicate, PredicateIri),
102
102
  rdf(iri(SubjectIri), iri(PredicateIri), literal(Text, datatype(_Datatype)), default_graph),
103
- number_string(Number, Text).
103
+ atom_chars(Text, Chars),
104
+ number_chars(Number, Chars).
104
105
 
105
106
  iri_term(ex(Name), Iri) :- namespace_iri('https://example.org/', Name, Iri).
106
107
  iri_term(odrl(Name), Iri) :- namespace_iri('http://www.w3.org/ns/odrl/2/', Name, Iri).
107
108
 
108
- namespace_iri(Prefix, Name, Iri) :-
109
- atom(Name),
110
- !,
111
- atom_string(Name, Local),
112
- string_concat(Prefix, Local, Iri).
113
- namespace_iri(Prefix, Name, Iri) :-
114
- string_concat(Prefix, Local, Iri),
115
- atom_string(Name, Local).
109
+ namespace_iri(Prefix, Name, Iri) :- atom_concat(Prefix, Name, Iri).
@@ -30,3 +30,12 @@ c8(check, "OK - classification behavior is monotonic across representative BMI v
30
30
  c9(check, "OK - the healthy-weight band was reconstructed from BMI 18.5 to 24.9 at the same height.").
31
31
  result(report, bmi(22.72, "Normal")).
32
32
  healthyWeightRangeKg(report, range(58.6, 78.9)).
33
+ checkPassed(report, c1).
34
+ checkPassed(report, c2).
35
+ checkPassed(report, c3).
36
+ checkPassed(report, c4).
37
+ checkPassed(report, c5).
38
+ checkPassed(report, c6).
39
+ checkPassed(report, c7).
40
+ checkPassed(report, c8).
41
+ checkPassed(report, c9).
@@ -1,7 +1,7 @@
1
- length(numbers, 3).
2
- member(numbers, 1).
3
- member(numbers, 2).
4
- member(numbers, 3).
5
- append(letters, [a, b, c]).
1
+ collectionLength(numbers, 3).
2
+ collectionMember(numbers, 1).
3
+ collectionMember(numbers, 2).
4
+ collectionMember(numbers, 3).
5
+ collectionAppend(letters, [a, b, c]).
6
6
  head(letters, a).
7
7
  tail(letters, [b]).
@@ -15,6 +15,9 @@
15
15
 
16
16
 
17
17
 
18
+ :- discontiguous(assign/2).
19
+ :- discontiguous(points_to/2).
20
+
18
21
  % Source-program statements:
19
22
  % x = &object_a
20
23
  % z = &object_b