eyelang 1.1.18 → 1.1.20

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.
package/docs/guide.md CHANGED
@@ -385,6 +385,7 @@ Each example has a checked golden output in `examples/output`.
385
385
  | [`gdpr-compliance.pl`](../examples/gdpr-compliance.pl) | Checks GDPR-style processing compliance. | [`output/gdpr-compliance.pl`](../examples/output/gdpr-compliance.pl) |
386
386
  | [`good-cobbler.pl`](../examples/good-cobbler.pl) | Demonstrates term-level structure with a good-cobbler statement. | [`output/good-cobbler.pl`](../examples/output/good-cobbler.pl) |
387
387
  | [`gps.pl`](../examples/gps.pl) | Finds and verifies route paths. | [`output/gps.pl`](../examples/output/gps.pl) |
388
+ | [`graph.pl`](../examples/graph.pl) | Derives transitive paths over French-city road links while showing the productive recursive rule order. | [`output/graph.pl`](../examples/output/graph.pl) |
388
389
  | [`graph-reachability.pl`](../examples/graph-reachability.pl) | Derives reachable nodes in a graph. | [`output/graph-reachability.pl`](../examples/output/graph-reachability.pl) |
389
390
  | [`gray-code-counter.pl`](../examples/gray-code-counter.pl) | Generates Gray-code counter states. | [`output/gray-code-counter.pl`](../examples/output/gray-code-counter.pl) |
390
391
  | [`greatest-lower-bound-uniqueness.pl`](../examples/greatest-lower-bound-uniqueness.pl) | Shows uniqueness of greatest lower bounds in a finite order instance. | [`output/greatest-lower-bound-uniqueness.pl`](../examples/output/greatest-lower-bound-uniqueness.pl) |
@@ -0,0 +1,35 @@
1
+ % Transitive graph paths over a small map of French cities.
2
+ %
3
+ % The base relation is directed: oneway(A, B) means there is a road from A
4
+ % to B. The derived relation path(A, B) is the transitive closure: B is
5
+ % reachable from A by one or more directed legs.
6
+ %
7
+ % The recursive rule is written in a productive, right-recursive form:
8
+ %
9
+ % path(A, C) :- oneway(A, B), path(B, C).
10
+ %
11
+ % That order matters in a goal-directed reasoner. A left-recursive closure
12
+ % rule such as `path(A, C) :- path(A, B), path(B, C).` starts by asking for
13
+ % the same open relation it is currently proving, so eyelang's recursion guard
14
+ % must stop it to avoid an infinite loop. The result is under-generation: only
15
+ % direct edges are printed. Starting with the concrete generator `oneway/2`
16
+ % first makes each recursive step smaller and yields the complete closure.
17
+
18
+ materialize(path, 2).
19
+
20
+ oneway(paris, orleans).
21
+ oneway(paris, chartres).
22
+ oneway(paris, amiens).
23
+ oneway(orleans, blois).
24
+ oneway(orleans, bourges).
25
+ oneway(blois, tours).
26
+ oneway(chartres, lemans).
27
+ oneway(lemans, angers).
28
+ oneway(lemans, tours).
29
+ oneway(angers, nantes).
30
+
31
+ path(A, B) :-
32
+ oneway(A, B).
33
+ path(A, C) :-
34
+ oneway(A, B),
35
+ path(B, C).
@@ -0,0 +1,21 @@
1
+ path(paris, orleans).
2
+ path(paris, chartres).
3
+ path(paris, amiens).
4
+ path(orleans, blois).
5
+ path(orleans, bourges).
6
+ path(blois, tours).
7
+ path(chartres, lemans).
8
+ path(lemans, angers).
9
+ path(lemans, tours).
10
+ path(angers, nantes).
11
+ path(paris, blois).
12
+ path(paris, bourges).
13
+ path(paris, tours).
14
+ path(paris, lemans).
15
+ path(paris, angers).
16
+ path(paris, nantes).
17
+ path(orleans, tours).
18
+ path(chartres, angers).
19
+ path(chartres, tours).
20
+ path(chartres, nantes).
21
+ path(lemans, nantes).
@@ -0,0 +1,227 @@
1
+ type(beam1, cantilever_beam).
2
+ why(
3
+ type(beam1, cantilever_beam),
4
+ proof(
5
+ goal(type(beam1, cantilever_beam)),
6
+ by(rule("beam-deflection.pl", clause(13))),
7
+ bindings([binding("Beam", beam1), binding("_Force", 1200.0)]),
8
+ uses([
9
+ proof(
10
+ goal(beam(beam1, force_N, 1200.0)),
11
+ by(fact("beam-deflection.pl", clause(6)))
12
+ )
13
+ ])
14
+ )
15
+ ).
16
+
17
+ tipDeflection_m(beam1, 0.00390625).
18
+ why(
19
+ tipDeflection_m(beam1, 0.00390625),
20
+ proof(
21
+ goal(tipDeflection_m(beam1, 0.00390625)),
22
+ by(rule("beam-deflection.pl", clause(14))),
23
+ bindings([binding("Beam", beam1), binding("DeflectionM", 0.00390625)]),
24
+ uses([
25
+ proof(
26
+ goal(tip_deflection_m(beam1, 0.00390625)),
27
+ by(rule("beam-deflection.pl", clause(11))),
28
+ bindings([binding("Beam", beam1), binding("Deflection", 0.00390625), binding("Force", 1200.0), binding("Length", 2.5), binding("ElasticModulus", 200000000000.0), binding("SecondMoment", 0.000008), binding("LengthCubed", 15.625), binding("Numerator", 18750.0), binding("ThreeE", 600000000000.0), binding("Denominator", 4800000.0)]),
29
+ uses([
30
+ proof(
31
+ goal(beam(beam1, force_N, 1200.0)),
32
+ by(fact("beam-deflection.pl", clause(6)))
33
+ ),
34
+ proof(
35
+ goal(beam(beam1, length_m, 2.5)),
36
+ by(fact("beam-deflection.pl", clause(7)))
37
+ ),
38
+ proof(
39
+ goal(beam(beam1, elasticModulus_Pa, 200000000000.0)),
40
+ by(fact("beam-deflection.pl", clause(8)))
41
+ ),
42
+ proof(
43
+ goal(beam(beam1, secondMoment_m4, 0.000008)),
44
+ by(fact("beam-deflection.pl", clause(9)))
45
+ ),
46
+ proof(
47
+ goal(pow(2.5, 3.0, 15.625)),
48
+ by(builtin(pow, 3))
49
+ ),
50
+ proof(
51
+ goal(mul(1200.0, 15.625, 18750.0)),
52
+ by(builtin(mul, 3))
53
+ ),
54
+ proof(
55
+ goal(mul(3.0, 200000000000.0, 600000000000.0)),
56
+ by(builtin(mul, 3))
57
+ ),
58
+ proof(
59
+ goal(mul(600000000000.0, 0.000008, 4800000.0)),
60
+ by(builtin(mul, 3))
61
+ ),
62
+ proof(
63
+ goal(div(18750.0, 4800000.0, 0.00390625)),
64
+ by(builtin(div, 3))
65
+ )
66
+ ])
67
+ )
68
+ ])
69
+ )
70
+ ).
71
+
72
+ tipDeflection_mm(beam1, 3.90625).
73
+ why(
74
+ tipDeflection_mm(beam1, 3.90625),
75
+ proof(
76
+ goal(tipDeflection_mm(beam1, 3.90625)),
77
+ by(rule("beam-deflection.pl", clause(15))),
78
+ bindings([binding("Beam", beam1), binding("DeflectionMm", 3.90625)]),
79
+ uses([
80
+ proof(
81
+ goal(tip_deflection_mm(beam1, 3.90625)),
82
+ by(rule("beam-deflection.pl", clause(12))),
83
+ bindings([binding("Beam", beam1), binding("DeflectionMm", 3.90625), binding("DeflectionM", 0.00390625)]),
84
+ uses([
85
+ proof(
86
+ goal(tip_deflection_m(beam1, 0.00390625)),
87
+ by(rule("beam-deflection.pl", clause(11))),
88
+ bindings([binding("Beam", beam1), binding("Deflection", 0.00390625), binding("Force", 1200.0), binding("Length", 2.5), binding("ElasticModulus", 200000000000.0), binding("SecondMoment", 0.000008), binding("LengthCubed", 15.625), binding("Numerator", 18750.0), binding("ThreeE", 600000000000.0), binding("Denominator", 4800000.0)]),
89
+ uses([
90
+ proof(
91
+ goal(beam(beam1, force_N, 1200.0)),
92
+ by(fact("beam-deflection.pl", clause(6)))
93
+ ),
94
+ proof(
95
+ goal(beam(beam1, length_m, 2.5)),
96
+ by(fact("beam-deflection.pl", clause(7)))
97
+ ),
98
+ proof(
99
+ goal(beam(beam1, elasticModulus_Pa, 200000000000.0)),
100
+ by(fact("beam-deflection.pl", clause(8)))
101
+ ),
102
+ proof(
103
+ goal(beam(beam1, secondMoment_m4, 0.000008)),
104
+ by(fact("beam-deflection.pl", clause(9)))
105
+ ),
106
+ proof(
107
+ goal(pow(2.5, 3.0, 15.625)),
108
+ by(builtin(pow, 3))
109
+ ),
110
+ proof(
111
+ goal(mul(1200.0, 15.625, 18750.0)),
112
+ by(builtin(mul, 3))
113
+ ),
114
+ proof(
115
+ goal(mul(3.0, 200000000000.0, 600000000000.0)),
116
+ by(builtin(mul, 3))
117
+ ),
118
+ proof(
119
+ goal(mul(600000000000.0, 0.000008, 4800000.0)),
120
+ by(builtin(mul, 3))
121
+ ),
122
+ proof(
123
+ goal(div(18750.0, 4800000.0, 0.00390625)),
124
+ by(builtin(div, 3))
125
+ )
126
+ ])
127
+ ),
128
+ proof(
129
+ goal(mul(0.00390625, 1000.0, 3.90625)),
130
+ by(builtin(mul, 3))
131
+ )
132
+ ])
133
+ )
134
+ ])
135
+ )
136
+ ).
137
+
138
+ limit_mm(beam1, 5.0).
139
+ why(
140
+ limit_mm(beam1, 5.0),
141
+ proof(
142
+ goal(limit_mm(beam1, 5.0)),
143
+ by(rule("beam-deflection.pl", clause(16))),
144
+ bindings([binding("Beam", beam1), binding("Limit", 5.0)]),
145
+ uses([
146
+ proof(
147
+ goal(limit(beam1, maxDeflection_mm, 5.0)),
148
+ by(fact("beam-deflection.pl", clause(10)))
149
+ )
150
+ ])
151
+ )
152
+ ).
153
+
154
+ status(beam1, within_deflection_limit).
155
+ why(
156
+ status(beam1, within_deflection_limit),
157
+ proof(
158
+ goal(status(beam1, within_deflection_limit)),
159
+ by(rule("beam-deflection.pl", clause(17))),
160
+ bindings([binding("Beam", beam1), binding("DeflectionMm", 3.90625), binding("Limit", 5.0)]),
161
+ uses([
162
+ proof(
163
+ goal(tip_deflection_mm(beam1, 3.90625)),
164
+ by(rule("beam-deflection.pl", clause(12))),
165
+ bindings([binding("Beam", beam1), binding("DeflectionMm", 3.90625), binding("DeflectionM", 0.00390625)]),
166
+ uses([
167
+ proof(
168
+ goal(tip_deflection_m(beam1, 0.00390625)),
169
+ by(rule("beam-deflection.pl", clause(11))),
170
+ bindings([binding("Beam", beam1), binding("Deflection", 0.00390625), binding("Force", 1200.0), binding("Length", 2.5), binding("ElasticModulus", 200000000000.0), binding("SecondMoment", 0.000008), binding("LengthCubed", 15.625), binding("Numerator", 18750.0), binding("ThreeE", 600000000000.0), binding("Denominator", 4800000.0)]),
171
+ uses([
172
+ proof(
173
+ goal(beam(beam1, force_N, 1200.0)),
174
+ by(fact("beam-deflection.pl", clause(6)))
175
+ ),
176
+ proof(
177
+ goal(beam(beam1, length_m, 2.5)),
178
+ by(fact("beam-deflection.pl", clause(7)))
179
+ ),
180
+ proof(
181
+ goal(beam(beam1, elasticModulus_Pa, 200000000000.0)),
182
+ by(fact("beam-deflection.pl", clause(8)))
183
+ ),
184
+ proof(
185
+ goal(beam(beam1, secondMoment_m4, 0.000008)),
186
+ by(fact("beam-deflection.pl", clause(9)))
187
+ ),
188
+ proof(
189
+ goal(pow(2.5, 3.0, 15.625)),
190
+ by(builtin(pow, 3))
191
+ ),
192
+ proof(
193
+ goal(mul(1200.0, 15.625, 18750.0)),
194
+ by(builtin(mul, 3))
195
+ ),
196
+ proof(
197
+ goal(mul(3.0, 200000000000.0, 600000000000.0)),
198
+ by(builtin(mul, 3))
199
+ ),
200
+ proof(
201
+ goal(mul(600000000000.0, 0.000008, 4800000.0)),
202
+ by(builtin(mul, 3))
203
+ ),
204
+ proof(
205
+ goal(div(18750.0, 4800000.0, 0.00390625)),
206
+ by(builtin(div, 3))
207
+ )
208
+ ])
209
+ ),
210
+ proof(
211
+ goal(mul(0.00390625, 1000.0, 3.90625)),
212
+ by(builtin(mul, 3))
213
+ )
214
+ ])
215
+ ),
216
+ proof(
217
+ goal(limit(beam1, maxDeflection_mm, 5.0)),
218
+ by(fact("beam-deflection.pl", clause(10)))
219
+ ),
220
+ proof(
221
+ goal(le(3.90625, 5.0)),
222
+ by(builtin(le, 2))
223
+ )
224
+ ])
225
+ )
226
+ ).
227
+
@@ -0,0 +1,310 @@
1
+ hitRate(api_cache, 0.85999999999999999).
2
+ why(
3
+ hitRate(api_cache, 0.85999999999999999),
4
+ proof(
5
+ goal(hitRate(api_cache, 0.85999999999999999)),
6
+ by(rule("cache-performance.pl", clause(12))),
7
+ bindings([binding("Cache", api_cache), binding("Rate", 0.85999999999999999)]),
8
+ uses([
9
+ proof(
10
+ goal(hit_rate(api_cache, 0.85999999999999999)),
11
+ by(rule("cache-performance.pl", clause(9))),
12
+ bindings([binding("Cache", api_cache), binding("Rate", 0.85999999999999999), binding("Hits", 8600.0), binding("_Misses", 1400.0), binding("_HitLatency", 5.0), binding("_MissLatency", 80.0), binding("Total", 10000.0)]),
13
+ uses([
14
+ proof(
15
+ goal(cache_sample(api_cache, 8600.0, 1400.0, 5.0, 80.0)),
16
+ by(fact("cache-performance.pl", clause(5)))
17
+ ),
18
+ proof(
19
+ goal(total_requests(api_cache, 10000.0)),
20
+ by(rule("cache-performance.pl", clause(8))),
21
+ bindings([binding("Cache", api_cache), binding("Total", 10000.0), binding("Hits", 8600.0), binding("Misses", 1400.0), binding("_HitLatency", 5.0), binding("_MissLatency", 80.0)]),
22
+ uses([
23
+ proof(
24
+ goal(cache_sample(api_cache, 8600.0, 1400.0, 5.0, 80.0)),
25
+ by(fact("cache-performance.pl", clause(5)))
26
+ ),
27
+ proof(
28
+ goal(add(8600.0, 1400.0, 10000.0)),
29
+ by(builtin(add, 3))
30
+ )
31
+ ])
32
+ ),
33
+ proof(
34
+ goal(div(8600.0, 10000.0, 0.85999999999999999)),
35
+ by(builtin(div, 3))
36
+ )
37
+ ])
38
+ )
39
+ ])
40
+ )
41
+ ).
42
+
43
+ averageLatency_ms(api_cache, 15.5).
44
+ why(
45
+ averageLatency_ms(api_cache, 15.5),
46
+ proof(
47
+ goal(averageLatency_ms(api_cache, 15.5)),
48
+ by(rule("cache-performance.pl", clause(13))),
49
+ bindings([binding("Cache", api_cache), binding("Average", 15.5)]),
50
+ uses([
51
+ proof(
52
+ goal(average_latency(api_cache, 15.5)),
53
+ by(rule("cache-performance.pl", clause(10))),
54
+ bindings([binding("Cache", api_cache), binding("Average", 15.5), binding("Hits", 8600.0), binding("Misses", 1400.0), binding("HitLatency", 5.0), binding("MissLatency", 80.0), binding("HitCost", 43000.0), binding("MissCost", 112000.0), binding("TotalCost", 155000.0), binding("Total", 10000.0)]),
55
+ uses([
56
+ proof(
57
+ goal(cache_sample(api_cache, 8600.0, 1400.0, 5.0, 80.0)),
58
+ by(fact("cache-performance.pl", clause(5)))
59
+ ),
60
+ proof(
61
+ goal(mul(8600.0, 5.0, 43000.0)),
62
+ by(builtin(mul, 3))
63
+ ),
64
+ proof(
65
+ goal(mul(1400.0, 80.0, 112000.0)),
66
+ by(builtin(mul, 3))
67
+ ),
68
+ proof(
69
+ goal(add(43000.0, 112000.0, 155000.0)),
70
+ by(builtin(add, 3))
71
+ ),
72
+ proof(
73
+ goal(total_requests(api_cache, 10000.0)),
74
+ by(rule("cache-performance.pl", clause(8))),
75
+ bindings([binding("Cache", api_cache), binding("Total", 10000.0), binding("Hits", 8600.0), binding("Misses", 1400.0), binding("_HitLatency", 5.0), binding("_MissLatency", 80.0)]),
76
+ uses([
77
+ proof(
78
+ goal(cache_sample(api_cache, 8600.0, 1400.0, 5.0, 80.0)),
79
+ by(fact("cache-performance.pl", clause(5)))
80
+ ),
81
+ proof(
82
+ goal(add(8600.0, 1400.0, 10000.0)),
83
+ by(builtin(add, 3))
84
+ )
85
+ ])
86
+ ),
87
+ proof(
88
+ goal(div(155000.0, 10000.0, 15.5)),
89
+ by(builtin(div, 3))
90
+ )
91
+ ])
92
+ )
93
+ ])
94
+ )
95
+ ).
96
+
97
+ status(api_cache, cache_effective).
98
+ why(
99
+ status(api_cache, cache_effective),
100
+ proof(
101
+ goal(status(api_cache, cache_effective)),
102
+ by(rule("cache-performance.pl", clause(14))),
103
+ bindings([binding("Cache", api_cache)]),
104
+ uses([
105
+ proof(
106
+ goal(cache_effective(api_cache)),
107
+ by(rule("cache-performance.pl", clause(11))),
108
+ bindings([binding("Cache", api_cache), binding("Rate", 0.85999999999999999), binding("MinimumRate", 0.80), binding("Average", 15.5), binding("MaximumLatency", 20.0)]),
109
+ uses([
110
+ proof(
111
+ goal(hit_rate(api_cache, 0.85999999999999999)),
112
+ by(rule("cache-performance.pl", clause(9))),
113
+ bindings([binding("Cache", api_cache), binding("Rate", 0.85999999999999999), binding("Hits", 8600.0), binding("_Misses", 1400.0), binding("_HitLatency", 5.0), binding("_MissLatency", 80.0), binding("Total", 10000.0)]),
114
+ uses([
115
+ proof(
116
+ goal(cache_sample(api_cache, 8600.0, 1400.0, 5.0, 80.0)),
117
+ by(fact("cache-performance.pl", clause(5)))
118
+ ),
119
+ proof(
120
+ goal(total_requests(api_cache, 10000.0)),
121
+ by(rule("cache-performance.pl", clause(8))),
122
+ bindings([binding("Cache", api_cache), binding("Total", 10000.0), binding("Hits", 8600.0), binding("Misses", 1400.0), binding("_HitLatency", 5.0), binding("_MissLatency", 80.0)]),
123
+ uses([
124
+ proof(
125
+ goal(cache_sample(api_cache, 8600.0, 1400.0, 5.0, 80.0)),
126
+ by(fact("cache-performance.pl", clause(5)))
127
+ ),
128
+ proof(
129
+ goal(add(8600.0, 1400.0, 10000.0)),
130
+ by(builtin(add, 3))
131
+ )
132
+ ])
133
+ ),
134
+ proof(
135
+ goal(div(8600.0, 10000.0, 0.85999999999999999)),
136
+ by(builtin(div, 3))
137
+ )
138
+ ])
139
+ ),
140
+ proof(
141
+ goal(threshold(api_cache, minimum_hit_rate, 0.80)),
142
+ by(fact("cache-performance.pl", clause(6)))
143
+ ),
144
+ proof(
145
+ goal(gt(0.85999999999999999, 0.80)),
146
+ by(builtin(gt, 2))
147
+ ),
148
+ proof(
149
+ goal(average_latency(api_cache, 15.5)),
150
+ by(rule("cache-performance.pl", clause(10))),
151
+ bindings([binding("Cache", api_cache), binding("Average", 15.5), binding("Hits", 8600.0), binding("Misses", 1400.0), binding("HitLatency", 5.0), binding("MissLatency", 80.0), binding("HitCost", 43000.0), binding("MissCost", 112000.0), binding("TotalCost", 155000.0), binding("Total", 10000.0)]),
152
+ uses([
153
+ proof(
154
+ goal(cache_sample(api_cache, 8600.0, 1400.0, 5.0, 80.0)),
155
+ by(fact("cache-performance.pl", clause(5)))
156
+ ),
157
+ proof(
158
+ goal(mul(8600.0, 5.0, 43000.0)),
159
+ by(builtin(mul, 3))
160
+ ),
161
+ proof(
162
+ goal(mul(1400.0, 80.0, 112000.0)),
163
+ by(builtin(mul, 3))
164
+ ),
165
+ proof(
166
+ goal(add(43000.0, 112000.0, 155000.0)),
167
+ by(builtin(add, 3))
168
+ ),
169
+ proof(
170
+ goal(total_requests(api_cache, 10000.0)),
171
+ by(rule("cache-performance.pl", clause(8))),
172
+ bindings([binding("Cache", api_cache), binding("Total", 10000.0), binding("Hits", 8600.0), binding("Misses", 1400.0), binding("_HitLatency", 5.0), binding("_MissLatency", 80.0)]),
173
+ uses([
174
+ proof(
175
+ goal(cache_sample(api_cache, 8600.0, 1400.0, 5.0, 80.0)),
176
+ by(fact("cache-performance.pl", clause(5)))
177
+ ),
178
+ proof(
179
+ goal(add(8600.0, 1400.0, 10000.0)),
180
+ by(builtin(add, 3))
181
+ )
182
+ ])
183
+ ),
184
+ proof(
185
+ goal(div(155000.0, 10000.0, 15.5)),
186
+ by(builtin(div, 3))
187
+ )
188
+ ])
189
+ ),
190
+ proof(
191
+ goal(threshold(api_cache, maximum_average_latency_ms, 20.0)),
192
+ by(fact("cache-performance.pl", clause(7)))
193
+ ),
194
+ proof(
195
+ goal(lt(15.5, 20.0)),
196
+ by(builtin(lt, 2))
197
+ )
198
+ ])
199
+ )
200
+ ])
201
+ )
202
+ ).
203
+
204
+ reason(api_cache, "hit rate is above target and average latency is below limit").
205
+ why(
206
+ reason(api_cache, "hit rate is above target and average latency is below limit"),
207
+ proof(
208
+ goal(reason(api_cache, "hit rate is above target and average latency is below limit")),
209
+ by(rule("cache-performance.pl", clause(15))),
210
+ bindings([binding("Cache", api_cache)]),
211
+ uses([
212
+ proof(
213
+ goal(cache_effective(api_cache)),
214
+ by(rule("cache-performance.pl", clause(11))),
215
+ bindings([binding("Cache", api_cache), binding("Rate", 0.85999999999999999), binding("MinimumRate", 0.80), binding("Average", 15.5), binding("MaximumLatency", 20.0)]),
216
+ uses([
217
+ proof(
218
+ goal(hit_rate(api_cache, 0.85999999999999999)),
219
+ by(rule("cache-performance.pl", clause(9))),
220
+ bindings([binding("Cache", api_cache), binding("Rate", 0.85999999999999999), binding("Hits", 8600.0), binding("_Misses", 1400.0), binding("_HitLatency", 5.0), binding("_MissLatency", 80.0), binding("Total", 10000.0)]),
221
+ uses([
222
+ proof(
223
+ goal(cache_sample(api_cache, 8600.0, 1400.0, 5.0, 80.0)),
224
+ by(fact("cache-performance.pl", clause(5)))
225
+ ),
226
+ proof(
227
+ goal(total_requests(api_cache, 10000.0)),
228
+ by(rule("cache-performance.pl", clause(8))),
229
+ bindings([binding("Cache", api_cache), binding("Total", 10000.0), binding("Hits", 8600.0), binding("Misses", 1400.0), binding("_HitLatency", 5.0), binding("_MissLatency", 80.0)]),
230
+ uses([
231
+ proof(
232
+ goal(cache_sample(api_cache, 8600.0, 1400.0, 5.0, 80.0)),
233
+ by(fact("cache-performance.pl", clause(5)))
234
+ ),
235
+ proof(
236
+ goal(add(8600.0, 1400.0, 10000.0)),
237
+ by(builtin(add, 3))
238
+ )
239
+ ])
240
+ ),
241
+ proof(
242
+ goal(div(8600.0, 10000.0, 0.85999999999999999)),
243
+ by(builtin(div, 3))
244
+ )
245
+ ])
246
+ ),
247
+ proof(
248
+ goal(threshold(api_cache, minimum_hit_rate, 0.80)),
249
+ by(fact("cache-performance.pl", clause(6)))
250
+ ),
251
+ proof(
252
+ goal(gt(0.85999999999999999, 0.80)),
253
+ by(builtin(gt, 2))
254
+ ),
255
+ proof(
256
+ goal(average_latency(api_cache, 15.5)),
257
+ by(rule("cache-performance.pl", clause(10))),
258
+ bindings([binding("Cache", api_cache), binding("Average", 15.5), binding("Hits", 8600.0), binding("Misses", 1400.0), binding("HitLatency", 5.0), binding("MissLatency", 80.0), binding("HitCost", 43000.0), binding("MissCost", 112000.0), binding("TotalCost", 155000.0), binding("Total", 10000.0)]),
259
+ uses([
260
+ proof(
261
+ goal(cache_sample(api_cache, 8600.0, 1400.0, 5.0, 80.0)),
262
+ by(fact("cache-performance.pl", clause(5)))
263
+ ),
264
+ proof(
265
+ goal(mul(8600.0, 5.0, 43000.0)),
266
+ by(builtin(mul, 3))
267
+ ),
268
+ proof(
269
+ goal(mul(1400.0, 80.0, 112000.0)),
270
+ by(builtin(mul, 3))
271
+ ),
272
+ proof(
273
+ goal(add(43000.0, 112000.0, 155000.0)),
274
+ by(builtin(add, 3))
275
+ ),
276
+ proof(
277
+ goal(total_requests(api_cache, 10000.0)),
278
+ by(rule("cache-performance.pl", clause(8))),
279
+ bindings([binding("Cache", api_cache), binding("Total", 10000.0), binding("Hits", 8600.0), binding("Misses", 1400.0), binding("_HitLatency", 5.0), binding("_MissLatency", 80.0)]),
280
+ uses([
281
+ proof(
282
+ goal(cache_sample(api_cache, 8600.0, 1400.0, 5.0, 80.0)),
283
+ by(fact("cache-performance.pl", clause(5)))
284
+ ),
285
+ proof(
286
+ goal(add(8600.0, 1400.0, 10000.0)),
287
+ by(builtin(add, 3))
288
+ )
289
+ ])
290
+ ),
291
+ proof(
292
+ goal(div(155000.0, 10000.0, 15.5)),
293
+ by(builtin(div, 3))
294
+ )
295
+ ])
296
+ ),
297
+ proof(
298
+ goal(threshold(api_cache, maximum_average_latency_ms, 20.0)),
299
+ by(fact("cache-performance.pl", clause(7)))
300
+ ),
301
+ proof(
302
+ goal(lt(15.5, 20.0)),
303
+ by(builtin(lt, 2))
304
+ )
305
+ ])
306
+ )
307
+ ])
308
+ )
309
+ ).
310
+