eyeling 1.22.6 → 1.22.8

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.
Files changed (38) hide show
  1. package/HANDBOOK.md +245 -0
  2. package/dist/browser/eyeling.browser.js +188 -33
  3. package/examples/act-alarm-bit-interoperability.n3 +180 -0
  4. package/examples/act-barley-seed-lineage.n3 +565 -0
  5. package/examples/act-docking-abort.n3 +285 -0
  6. package/examples/act-gravity-mediator-witness.n3 +235 -0
  7. package/examples/act-isolation-breach.n3 +354 -0
  8. package/examples/act-photosynthetic-exciton-transfer.n3 +245 -0
  9. package/examples/act-sensor-memory-reset.n3 +190 -0
  10. package/examples/act-tunnel-junction-wake-switch.n3 +225 -0
  11. package/examples/act-yeast-self-reproduction.n3 +248 -0
  12. package/examples/complex-matrix-stability.n3 +288 -0
  13. package/examples/deck/act-barley-seed-lineage.md +593 -0
  14. package/examples/fundamental-theorem-arithmetic.n3 +244 -0
  15. package/examples/harborsmr.n3 +233 -0
  16. package/examples/meta-rule-audit.n3 +135 -0
  17. package/examples/output/act-alarm-bit-interoperability.txt +20 -0
  18. package/examples/output/act-barley-seed-lineage.txt +25 -0
  19. package/examples/output/act-docking-abort.txt +22 -0
  20. package/examples/output/act-gravity-mediator-witness.txt +24 -0
  21. package/examples/output/act-isolation-breach.txt +27 -0
  22. package/examples/output/act-photosynthetic-exciton-transfer.txt +20 -0
  23. package/examples/output/act-sensor-memory-reset.txt +20 -0
  24. package/examples/output/act-tunnel-junction-wake-switch.txt +21 -0
  25. package/examples/output/act-yeast-self-reproduction.txt +23 -0
  26. package/examples/output/complex-matrix-stability.txt +14 -0
  27. package/examples/output/fundamental-theorem-arithmetic.txt +15 -0
  28. package/examples/output/get-uuid.n3 +2 -2
  29. package/examples/output/harborsmr.txt +20 -0
  30. package/examples/output/meta-rule-audit.n3 +44 -0
  31. package/examples/output/theory-diff.n3 +22 -0
  32. package/examples/theory-diff.n3 +125 -0
  33. package/eyeling.js +188 -33
  34. package/lib/builtins.js +18 -1
  35. package/lib/cli.js +31 -5
  36. package/lib/engine.js +139 -27
  37. package/package.json +1 -1
  38. package/test/api.test.js +100 -0
@@ -0,0 +1,285 @@
1
+ # ============================================================================
2
+ # ACT docking abort token — broad constructor-theory coverage with can't-rules
3
+ #
4
+ # Concrete topic:
5
+ # A spacecraft docking bay has an emergency abort bit that must be propagated
6
+ # across unlike classical media and recorded for audit.
7
+ #
8
+ # This example therefore includes both sides:
9
+ # - CAN : the classical abort token can be permuted, copied, measured,
10
+ # cloned locally, and composed into serial and parallel networks
11
+ # - CAN'T : the quantum authenticity seal cannot be universally cloned and
12
+ # therefore cannot be used as an unrestricted fan-out audit token
13
+ # ============================================================================
14
+
15
+ @prefix : <http://example.org/docking-abort/> .
16
+ @prefix arc: <https://example.org/arc#> .
17
+ @prefix log: <http://www.w3.org/2000/10/swap/log#> .
18
+
19
+ :case a arc:Case ;
20
+ arc:question "Can a docking-abort token be propagated, permuted, measured and audited across unlike classical media, and what exactly can't be done with the quantum authenticity seal?" .
21
+
22
+ # --------------------------------------------------------
23
+ # Classical substrates carrying the same abstract variable
24
+ # --------------------------------------------------------
25
+
26
+ :abortLamp a :InformationMedium ;
27
+ :encodes :AbortBit ;
28
+ :zeroState :Green ;
29
+ :oneState :Red .
30
+
31
+ :flightPLC a :InformationMedium ;
32
+ :encodes :AbortBit ;
33
+ :zeroState :LowVoltage ;
34
+ :oneState :HighVoltage .
35
+
36
+ :radioFrame a :InformationMedium ;
37
+ :encodes :AbortBit ;
38
+ :zeroState :Frame0 ;
39
+ :oneState :Frame1 .
40
+
41
+ :auditDisplay a :InformationMedium ;
42
+ :encodes :AbortBit ;
43
+ :zeroState :DisplayOK ;
44
+ :oneState :DisplayABORT .
45
+
46
+ # ------------------------------------------------------
47
+ # Contrast substrate with superinformation-like behavior
48
+ # ------------------------------------------------------
49
+
50
+ :quantumSeal a :SuperinformationMedium ;
51
+ :encodes :SealVariable .
52
+
53
+ # ---------------------------------------------------------------
54
+ # CAN rules — what becomes possible for the classical abort token
55
+ # ---------------------------------------------------------------
56
+
57
+ # Information media are treated here as computation media for the same variable.
58
+ # They support permutation of the variable, local cloning, and distinguishability.
59
+ { ?M a :InformationMedium ;
60
+ :encodes ?V ;
61
+ :zeroState ?Z ;
62
+ :oneState ?O . }
63
+ =>
64
+ {
65
+ ?M a :ComputationMedium .
66
+ ?M :distinguishes ?V .
67
+ ?M :can :LocalPermutation .
68
+ ?M :can :LocalClone .
69
+
70
+ [ a :PossibleTask ;
71
+ :kind :Permute ;
72
+ :on ?M ;
73
+ :variable ?V ;
74
+ :fromState ?Z ;
75
+ :toState ?O ] .
76
+
77
+ [ a :PossibleTask ;
78
+ :kind :CloneLocal ;
79
+ :on ?M ;
80
+ :variable ?V ] .
81
+ } .
82
+
83
+ # Interoperability-like copying across unlike media carrying the same variable.
84
+ { ?A a :InformationMedium ; :encodes ?V .
85
+ ?B a :InformationMedium ; :encodes ?V . }
86
+ =>
87
+ {
88
+ [ a :PossibleTask ;
89
+ :kind :Copy ;
90
+ :from ?A ;
91
+ :to ?B ;
92
+ :variable ?V ] .
93
+ } .
94
+
95
+ # Measurement: if a substrate distinguishes a variable, it can be measured into
96
+ # an information medium carrying that same variable.
97
+ { ?A :distinguishes ?V .
98
+ ?B a :InformationMedium ; :encodes ?V . }
99
+ =>
100
+ {
101
+ [ a :PossibleTask ;
102
+ :kind :Measure ;
103
+ :from ?A ;
104
+ :to ?B ;
105
+ :variable ?V ] .
106
+ } .
107
+
108
+ # Serial composition: copy into an intermediate medium, then measure from there.
109
+ { [ a :PossibleTask ;
110
+ :kind :Copy ;
111
+ :from ?A ;
112
+ :to ?B ;
113
+ :variable ?V ] .
114
+ [ a :PossibleTask ;
115
+ :kind :Measure ;
116
+ :from ?B ;
117
+ :to ?C ;
118
+ :variable ?V ] . }
119
+ =>
120
+ {
121
+ [ a :PossibleTask ;
122
+ :kind :SerialNetwork ;
123
+ :from ?A ;
124
+ :via ?B ;
125
+ :to ?C ;
126
+ :variable ?V ] .
127
+ } .
128
+
129
+ # Parallel composition: fan out the same variable into two target media.
130
+ { [ a :PossibleTask ;
131
+ :kind :Copy ;
132
+ :from ?A ;
133
+ :to ?B ;
134
+ :variable ?V ] .
135
+ [ a :PossibleTask ;
136
+ :kind :Copy ;
137
+ :from ?A ;
138
+ :to ?C ;
139
+ :variable ?V ] . }
140
+ =>
141
+ {
142
+ [ a :PossibleTask ;
143
+ :kind :ParallelNetwork ;
144
+ :source ?A ;
145
+ :left ?B ;
146
+ :right ?C ;
147
+ :variable ?V ] .
148
+ } .
149
+
150
+ # ----------------------------------------------------------
151
+ # CAN'T rules — what becomes impossible for the quantum seal
152
+ # ----------------------------------------------------------
153
+
154
+ # A superinformation medium cannot have all of its states universally cloned.
155
+ { ?M a :SuperinformationMedium ;
156
+ :encodes ?V . }
157
+ =>
158
+ {
159
+ ?M :cannot :UniversalClone .
160
+ [ a :ImpossibleTask ;
161
+ :kind :CloneAllStates ;
162
+ :on ?M ;
163
+ :variable ?V ] .
164
+ } .
165
+
166
+ # If universal cloning is unavailable, unrestricted audit fan-out is unavailable.
167
+ { ?M :cannot :UniversalClone . }
168
+ =>
169
+ { ?M :cannot :UnrestrictedAuditFanOut . } .
170
+
171
+ # ------
172
+ # Checks
173
+ # ------
174
+
175
+ # Positive checks for the classical abort token.
176
+ { :abortLamp a :ComputationMedium . }
177
+ => { :case :checkC1 :Passed . } .
178
+
179
+ { :abortLamp :distinguishes :AbortBit . }
180
+ => { :case :checkC2 :Passed . } .
181
+
182
+ { [ a :PossibleTask ;
183
+ :kind :Permute ;
184
+ :on :abortLamp ;
185
+ :variable :AbortBit ] . }
186
+ => { :case :checkC3 :Passed . } .
187
+
188
+ { [ a :PossibleTask ;
189
+ :kind :CloneLocal ;
190
+ :on :flightPLC ;
191
+ :variable :AbortBit ] . }
192
+ => { :case :checkC4 :Passed . } .
193
+
194
+ { [ a :PossibleTask ;
195
+ :kind :Copy ;
196
+ :from :abortLamp ;
197
+ :to :flightPLC ;
198
+ :variable :AbortBit ] . }
199
+ => { :case :checkC5 :Passed . } .
200
+
201
+ { [ a :PossibleTask ;
202
+ :kind :Copy ;
203
+ :from :flightPLC ;
204
+ :to :radioFrame ;
205
+ :variable :AbortBit ] . }
206
+ => { :case :checkC6 :Passed . } .
207
+
208
+ { [ a :PossibleTask ;
209
+ :kind :Measure ;
210
+ :from :radioFrame ;
211
+ :to :auditDisplay ;
212
+ :variable :AbortBit ] . }
213
+ => { :case :checkC7 :Passed . } .
214
+
215
+ { [ a :PossibleTask ;
216
+ :kind :SerialNetwork ;
217
+ :from :abortLamp ;
218
+ :via :flightPLC ;
219
+ :to :auditDisplay ;
220
+ :variable :AbortBit ] . }
221
+ => { :case :checkC8 :Passed . } .
222
+
223
+ { [ a :PossibleTask ;
224
+ :kind :ParallelNetwork ;
225
+ :source :flightPLC ;
226
+ :left :radioFrame ;
227
+ :right :auditDisplay ;
228
+ :variable :AbortBit ] . }
229
+ => { :case :checkC9 :Passed . } .
230
+
231
+ # Negative checks for the quantum seal.
232
+ { [ a :ImpossibleTask ;
233
+ :kind :CloneAllStates ;
234
+ :on :quantumSeal ;
235
+ :variable :SealVariable ] . }
236
+ => { :case :checkC10 :Passed . } .
237
+
238
+ { :quantumSeal :cannot :UniversalClone . }
239
+ => { :case :checkC11 :Passed . } .
240
+
241
+ { :quantumSeal :cannot :UnrestrictedAuditFanOut . }
242
+ => { :case :checkC12 :Passed . } .
243
+
244
+ # ----------------
245
+ # ARC-style report
246
+ # ----------------
247
+
248
+ { :case :checkC1 :Passed .
249
+ :case :checkC2 :Passed .
250
+ :case :checkC3 :Passed .
251
+ :case :checkC4 :Passed .
252
+ :case :checkC5 :Passed .
253
+ :case :checkC6 :Passed .
254
+ :case :checkC7 :Passed .
255
+ :case :checkC8 :Passed .
256
+ :case :checkC9 :Passed .
257
+ :case :checkC10 :Passed .
258
+ :case :checkC11 :Passed .
259
+ :case :checkC12 :Passed . }
260
+ =>
261
+ {
262
+ :out log:outputString """ACT docking abort token — constructor-theory coverage case
263
+
264
+ Answer
265
+ YES for the classical abort token.
266
+ NO for universal cloning and unrestricted audit fan-out of the quantum seal.
267
+
268
+ Reason Why
269
+ The docking-abort token is treated as an abstract information variable carried by unlike classical media: lamp state, PLC register, radio frame, and audit display. Because those substrates are information media for the same variable, the token can be permuted locally, cloned locally, copied across media, measured into an output record, and embedded in serial and parallel task networks. By contrast, the quantum authenticity seal is treated as a superinformation medium, so cloning all of its states is impossible and unrestricted audit fan-out is blocked.
270
+
271
+ Check
272
+ C1 OK - the abort lamp is a computation medium
273
+ C2 OK - the abort lamp distinguishes the abort bit
274
+ C3 OK - permutation of the abort bit is possible on the abort lamp
275
+ C4 OK - local cloning of the abort bit is possible on the PLC register
276
+ C5 OK - the abort bit can be copied from lamp to PLC
277
+ C6 OK - the abort bit can be copied from PLC to radio frame
278
+ C7 OK - the abort bit can be measured from radio frame into the audit display
279
+ C8 OK - a serial network from lamp via PLC to audit display is possible
280
+ C9 OK - a parallel network from PLC to radio frame and audit display is possible
281
+ C10 OK - cloning all states of the quantum seal is an impossible task
282
+ C11 OK - the quantum seal cannot be universally cloned
283
+ C12 OK - the quantum seal cannot be used for unrestricted audit fan-out
284
+ """ .
285
+ } .
@@ -0,0 +1,235 @@
1
+ # ==============================================================================
2
+ # ACT gravity mediator witness — explicit can and can't version
3
+ #
4
+ # Concrete applied-constructor-theory case:
5
+ # Two quantum sensors become entangled even though they have no direct coupling.
6
+ # They interact only through a mediator interpreted as gravitational.
7
+ #
8
+ # This example therefore includes both sides:
9
+ # - CAN : a mediator-only entanglement witness is possible when the mediator
10
+ # is treated as non-classical under locality and interoperability
11
+ # - CAN'T : a purely classical mediator model cannot generate the same witness
12
+ # under the same mediator-only conditions
13
+ # ==============================================================================
14
+
15
+ @prefix : <http://example.org/act-gravity/> .
16
+ @prefix arc: <https://example.org/arc#> .
17
+ @prefix log: <http://www.w3.org/2000/10/swap/log#> .
18
+
19
+ :case a arc:Case ;
20
+ arc:question "If two quantum sensors become entangled only through a gravitational mediator, while locality and interoperability hold, what can be concluded, and what can't a purely classical mediator model do?" .
21
+
22
+ # -----------------------
23
+ # Shared physical systems
24
+ # -----------------------
25
+
26
+ :leftSensor a :QuantumSystem .
27
+ :rightSensor a :QuantumSystem .
28
+
29
+ # ----------------------------------
30
+ # Positive mediator and positive run
31
+ # ----------------------------------
32
+
33
+ :gravityMediator a :Mediator ;
34
+ :couplingMode :Gravitational ;
35
+ :mediatorModel :NonClassicalCandidate .
36
+
37
+ :run a :ExperimentRun ;
38
+ :leftSystem :leftSensor ;
39
+ :rightSystem :rightSensor ;
40
+ :usesMediator :gravityMediator ;
41
+ :assumes :Locality ;
42
+ :assumes :Interoperability ;
43
+ :directCouplingStatus :NoDirectCoupling ;
44
+ :observed :EntanglementWitnessPassed ;
45
+ :probeStatus :LocalProbeReadoutPresent ;
46
+ :controlStatus :CopyLikeControlPresent .
47
+
48
+ # ----------------------------------
49
+ # Contrast mediator and contrast run
50
+ # ----------------------------------
51
+
52
+ :classicalGravityMediator a :Mediator ;
53
+ :couplingMode :Gravitational ;
54
+ :mediatorModel :PurelyClassical .
55
+
56
+ :contrastRun a :ExperimentRun ;
57
+ :leftSystem :leftSensor ;
58
+ :rightSystem :rightSensor ;
59
+ :usesMediator :classicalGravityMediator ;
60
+ :assumes :Locality ;
61
+ :assumes :Interoperability ;
62
+ :directCouplingStatus :NoDirectCoupling ;
63
+ :observed :NoEntanglementWitness ;
64
+ :probeStatus :LocalProbeReadoutPresent ;
65
+ :controlStatus :CopyLikeControlPresent .
66
+
67
+ # -------------------------------------------------------------
68
+ # CAN rules — what becomes possible in the positive witness run
69
+ # -------------------------------------------------------------
70
+
71
+ # Under locality and no direct coupling, interaction is mediated only through M.
72
+ { ?R a :ExperimentRun ;
73
+ :assumes :Locality ;
74
+ :directCouplingStatus :NoDirectCoupling ;
75
+ :usesMediator ?M . }
76
+ =>
77
+ { ?R :interactionPath :MediatorOnlyPath .
78
+ ?R :pathMediator ?M . } .
79
+
80
+ # Interoperability plus copy-like control gives an information-transfer interface.
81
+ { ?R a :ExperimentRun ;
82
+ :assumes :Interoperability ;
83
+ :controlStatus :CopyLikeControlPresent . }
84
+ =>
85
+ { ?R :supports :InformationTransferInterface . } .
86
+
87
+ # Local probe readout provides a local measurement interface.
88
+ { ?R a :ExperimentRun ;
89
+ :probeStatus :LocalProbeReadoutPresent . }
90
+ =>
91
+ { ?R :supports :LocalReadoutInterface . } .
92
+
93
+ # Core ACT witness rule:
94
+ # locality + interoperability + mediator-only interaction + observed entanglement
95
+ # imply a non-classical mediator.
96
+ { ?R a :ExperimentRun ;
97
+ :assumes :Locality ;
98
+ :assumes :Interoperability ;
99
+ :interactionPath :MediatorOnlyPath ;
100
+ :usesMediator ?M ;
101
+ :observed :EntanglementWitnessPassed . }
102
+ =>
103
+ { ?M a :NonClassicalMediator .
104
+ ?R :can :SupportMediatorOnlyEntanglementWitness .
105
+ ?R :supportsConclusion :MediatorNonClassical . } .
106
+
107
+ # If the mediator is non-classical, a purely classical mediator model is ruled out.
108
+ { ?R :supportsConclusion :MediatorNonClassical ;
109
+ :usesMediator ?M .
110
+ ?M a :NonClassicalMediator . }
111
+ =>
112
+ { ?R :rulesOut :PurelyClassicalMediatorModel . } .
113
+
114
+ # The witness is specifically about the gravitational mediator in this run.
115
+ { ?R :usesMediator ?M .
116
+ ?M :couplingMode :Gravitational .
117
+ ?M a :NonClassicalMediator . }
118
+ =>
119
+ { ?R :supportsConclusion :GravityMediatorNonClassical . } .
120
+
121
+ # --------------------------------------------------------------
122
+ # CAN'T rules — what a purely classical mediator model cannot do
123
+ # --------------------------------------------------------------
124
+
125
+ # Under the same locality/interoperability/mediator-only conditions, a purely
126
+ # classical mediator model cannot support the mediator-only entanglement witness.
127
+ { ?R a :ExperimentRun ;
128
+ :assumes :Locality ;
129
+ :assumes :Interoperability ;
130
+ :interactionPath :MediatorOnlyPath ;
131
+ :usesMediator ?M .
132
+ ?M :mediatorModel :PurelyClassical . }
133
+ =>
134
+ { ?R :cannot :SupportMediatorOnlyEntanglementWitness .
135
+ ?M :cannot :MediateEntanglementUnderWitnessConditions . } .
136
+
137
+ # If the witness cannot be supported, the run cannot justify a non-classicality conclusion.
138
+ { ?R :cannot :SupportMediatorOnlyEntanglementWitness . }
139
+ =>
140
+ { ?R :cannot :SupportMediatorNonClassicalConclusion . } .
141
+
142
+ # ------
143
+ # Checks
144
+ # ------
145
+
146
+ # Positive checks for the successful witness run.
147
+ { :run :assumes :Locality . }
148
+ => { :case :checkC1 :Passed . } .
149
+
150
+ { :run :assumes :Interoperability . }
151
+ => { :case :checkC2 :Passed . } .
152
+
153
+ { :run :directCouplingStatus :NoDirectCoupling . }
154
+ => { :case :checkC3 :Passed . } .
155
+
156
+ { :run :interactionPath :MediatorOnlyPath . }
157
+ => { :case :checkC4 :Passed . } .
158
+
159
+ { :run :observed :EntanglementWitnessPassed . }
160
+ => { :case :checkC5 :Passed . } .
161
+
162
+ { :run :supports :InformationTransferInterface . }
163
+ => { :case :checkC6 :Passed . } .
164
+
165
+ { :run :supports :LocalReadoutInterface . }
166
+ => { :case :checkC7 :Passed . } .
167
+
168
+ { :gravityMediator a :NonClassicalMediator . }
169
+ => { :case :checkC8 :Passed . } .
170
+
171
+ { :run :rulesOut :PurelyClassicalMediatorModel . }
172
+ => { :case :checkC9 :Passed . } .
173
+
174
+ { :run :supportsConclusion :GravityMediatorNonClassical . }
175
+ => { :case :checkC10 :Passed . } .
176
+
177
+ # Negative checks for the purely classical contrast model.
178
+ { :contrastRun :interactionPath :MediatorOnlyPath . }
179
+ => { :case :checkC11 :Passed . } .
180
+
181
+ { :contrastRun :cannot :SupportMediatorOnlyEntanglementWitness . }
182
+ => { :case :checkC12 :Passed . } .
183
+
184
+ { :classicalGravityMediator :cannot :MediateEntanglementUnderWitnessConditions . }
185
+ => { :case :checkC13 :Passed . } .
186
+
187
+ { :contrastRun :cannot :SupportMediatorNonClassicalConclusion . }
188
+ => { :case :checkC14 :Passed . } .
189
+
190
+ # ----------------
191
+ # ARC-style output
192
+ # ----------------
193
+
194
+ { :case :checkC1 :Passed .
195
+ :case :checkC2 :Passed .
196
+ :case :checkC3 :Passed .
197
+ :case :checkC4 :Passed .
198
+ :case :checkC5 :Passed .
199
+ :case :checkC6 :Passed .
200
+ :case :checkC7 :Passed .
201
+ :case :checkC8 :Passed .
202
+ :case :checkC9 :Passed .
203
+ :case :checkC10 :Passed .
204
+ :case :checkC11 :Passed .
205
+ :case :checkC12 :Passed .
206
+ :case :checkC13 :Passed .
207
+ :case :checkC14 :Passed . }
208
+ =>
209
+ {
210
+ :out log:outputString """ACT gravity mediator witness
211
+
212
+ Answer
213
+ YES for the mediator-only witness run.
214
+ NO for a purely classical mediator model under the same mediator-only conditions.
215
+
216
+ Reason Why
217
+ The positive run assumes locality and interoperability, excludes direct coupling between the two quantum systems, and records an entanglement witness after interaction through the mediator alone. Under those constructor-theoretic conditions, the mediator must be non-classical, so the run rules out a purely classical mediator model. The contrast run keeps the same locality, interoperability, and mediator-only structure but assigns the mediator a purely classical model. In that case the mediator-only entanglement witness is blocked, so the run cannot support the same non-classicality conclusion.
218
+
219
+ Check
220
+ C1 OK - locality is assumed in the positive run
221
+ C2 OK - interoperability is assumed in the positive run
222
+ C3 OK - direct coupling between the two quantum systems is excluded
223
+ C4 OK - the positive run has a mediator-only interaction path
224
+ C5 OK - an entanglement witness is observed in the positive run
225
+ C6 OK - the positive run supports an information-transfer interface
226
+ C7 OK - the positive run supports local readout
227
+ C8 OK - the positive mediator is derived to be non-classical
228
+ C9 OK - a purely classical mediator model is ruled out by the positive run
229
+ C10 OK - the non-classicality conclusion applies to the gravitational mediator
230
+ C11 OK - the contrast run is also mediator-only
231
+ C12 OK - the contrast run cannot support a mediator-only entanglement witness
232
+ C13 OK - the purely classical gravitational mediator cannot mediate entanglement under the witness conditions
233
+ C14 OK - the contrast run cannot support the non-classicality conclusion
234
+ """ .
235
+ } .