eyeling 1.19.5 → 1.20.0

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 (44) hide show
  1. package/HANDBOOK.md +39 -3
  2. package/bin/eyeling.cjs +10 -0
  3. package/dist/browser/eyeling.browser.js +12796 -0
  4. package/dist/browser/index.mjs +78 -0
  5. package/examples/deck/extra.md +169 -0
  6. package/examples/extra/collatz-1000.js +138 -0
  7. package/examples/extra/control-system.js +68 -0
  8. package/examples/extra/deep-taxonomy-100000.js +95 -0
  9. package/examples/extra/delfour.js +110 -0
  10. package/examples/extra/euler-identity.js +41 -0
  11. package/examples/extra/fibonacci.js +81 -0
  12. package/examples/extra/goldbach-1000.js +112 -0
  13. package/examples/extra/gps.js +274 -0
  14. package/examples/extra/kaprekar-6174.js +112 -0
  15. package/examples/extra/matrix-mechanics.js +69 -0
  16. package/examples/extra/odrl-dpv-ehds-risk-ranked.js +255 -0
  17. package/examples/extra/output/collatz-1000.txt +18 -0
  18. package/examples/extra/output/control-system.txt +14 -0
  19. package/examples/extra/output/deep-taxonomy-100000.txt +15 -0
  20. package/examples/extra/output/delfour.txt +20 -0
  21. package/examples/extra/output/euler-identity.txt +12 -0
  22. package/examples/extra/output/fibonacci.txt +21 -0
  23. package/examples/extra/output/goldbach-1000.txt +17 -0
  24. package/examples/extra/output/gps.txt +33 -0
  25. package/examples/extra/output/kaprekar-6174.txt +17 -0
  26. package/examples/extra/output/matrix-mechanics.txt +14 -0
  27. package/examples/extra/output/odrl-dpv-ehds-risk-ranked.txt +48 -0
  28. package/examples/extra/output/path-discovery.txt +28 -0
  29. package/examples/extra/output/pn-junction-tunneling.txt +15 -0
  30. package/examples/extra/output/polynomial.txt +20 -0
  31. package/examples/extra/output/sudoku.txt +47 -0
  32. package/examples/extra/output/transistor-switch.txt +16 -0
  33. package/examples/extra/path-discovery.js +45114 -0
  34. package/examples/extra/pn-junction-tunneling.js +69 -0
  35. package/examples/extra/polynomial.js +181 -0
  36. package/examples/extra/sudoku.js +330 -0
  37. package/examples/extra/transistor-switch.js +93 -0
  38. package/eyeling.js +5 -4
  39. package/index.d.ts +38 -0
  40. package/lib/entry.js +2 -0
  41. package/package.json +27 -3
  42. package/test/extra.test.js +100 -0
  43. package/test/packlist.test.js +16 -3
  44. package/tools/bundle.js +258 -147
@@ -0,0 +1,255 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ /**
5
+ * Specialized EHDS risk-ranking case with concrete permissions, needs, and scoring rules.
6
+ * Instead of generic policy reasoning, the file evaluates the fixed rule set directly and explains the ranking.
7
+ */
8
+
9
+ const ACTION = {
10
+ PROVIDE_SECONDARY_USE_DATA: 0,
11
+ DOWNLOAD: 1,
12
+ REMOVE_DIRECT_IDENTIFIERS: 2,
13
+ PROCESS_ONLY_IN_SECURE_ENVIRONMENT: 3,
14
+ };
15
+
16
+ const CONSTRAINT_KEY = {
17
+ PURPOSE: 0,
18
+ HAS_DATA_PERMIT: 1,
19
+ RESPECT_OPT_OUT_SECONDARY_USE: 2,
20
+ STATISTICALLY_ANONYMISED: 3,
21
+ };
22
+
23
+ function actionName(a) {
24
+ switch (a) {
25
+ case ACTION.PROVIDE_SECONDARY_USE_DATA:
26
+ return 'provideSecondaryUseData';
27
+ case ACTION.DOWNLOAD:
28
+ return 'download';
29
+ case ACTION.REMOVE_DIRECT_IDENTIFIERS:
30
+ return 'removeDirectIdentifiers';
31
+ case ACTION.PROCESS_ONLY_IN_SECURE_ENVIRONMENT:
32
+ return 'processOnlyInSecureEnvironment';
33
+ default:
34
+ return '?';
35
+ }
36
+ }
37
+
38
+ const NEEDS = [
39
+ {
40
+ id: 'Need_RequireDataPermit',
41
+ importance: 20,
42
+ description: 'Secondary use should be authorised via an EHDS Data Permit.',
43
+ },
44
+ {
45
+ id: 'Need_RespectOptOutSecondaryUse',
46
+ importance: 25,
47
+ description: 'Respect the EHDS right to opt out from secondary use.',
48
+ },
49
+ {
50
+ id: 'Need_SecureProcessingEnvironment',
51
+ importance: 18,
52
+ description: 'Secondary-use processing must occur within a secure processing environment.',
53
+ },
54
+ {
55
+ id: 'Need_StatisticallyAnonymisedSecondaryUse',
56
+ importance: 15,
57
+ description: 'Secondary use should use statistically anonymised data.',
58
+ },
59
+ ];
60
+
61
+ const P1_C = [{ key: CONSTRAINT_KEY.PURPOSE, value: 'HealthcareScientificResearch' }];
62
+ const P2_C = [{ key: CONSTRAINT_KEY.PURPOSE, value: 'TrainTestAndEvaluateHealthAlgorithms' }];
63
+ const P4_D = [{ action: ACTION.REMOVE_DIRECT_IDENTIFIERS }];
64
+
65
+ const PERMISSIONS = [
66
+ {
67
+ id: 'PermSecondaryUseDUA',
68
+ clauseId: 'H1',
69
+ action: ACTION.PROVIDE_SECONDARY_USE_DATA,
70
+ constraints: P1_C,
71
+ duties: [],
72
+ },
73
+ {
74
+ id: 'PermSecondaryUseAllPatients',
75
+ clauseId: 'H2',
76
+ action: ACTION.PROVIDE_SECONDARY_USE_DATA,
77
+ constraints: P2_C,
78
+ duties: [],
79
+ },
80
+ { id: 'PermDownloadLocalCopy', clauseId: 'H3', action: ACTION.DOWNLOAD, constraints: [], duties: [] },
81
+ {
82
+ id: 'PermProvidePseudonymisedData',
83
+ clauseId: 'H4',
84
+ action: ACTION.PROVIDE_SECONDARY_USE_DATA,
85
+ constraints: [],
86
+ duties: P4_D,
87
+ },
88
+ ];
89
+
90
+ const MISSING = {
91
+ MISSING_DATA_PERMIT: 0,
92
+ MISSING_OPT_OUT: 1,
93
+ MISSING_SECURE_ENV: 2,
94
+ MISSING_STAT_ANON: 3,
95
+ };
96
+
97
+ // Risk rules combine a base severity with the importance of the unmet need.
98
+ const RULES = [
99
+ {
100
+ ruleId: 'R1',
101
+ permissionId: 'PermSecondaryUseDUA',
102
+ clauseId: 'H1',
103
+ needId: 'Need_RequireDataPermit',
104
+ baseScore: 80,
105
+ riskSource: 'Secondary use permitted without EHDS Data Permit.',
106
+ mitigation: 'Require an EHDS Data Permit before secondary use.',
107
+ missing: MISSING.MISSING_DATA_PERMIT,
108
+ },
109
+ {
110
+ ruleId: 'R2',
111
+ permissionId: 'PermSecondaryUseAllPatients',
112
+ clauseId: 'H2',
113
+ needId: 'Need_RespectOptOutSecondaryUse',
114
+ baseScore: 75,
115
+ riskSource: 'Opt-out from secondary use not explicitly respected.',
116
+ mitigation: 'Exclude records of persons who exercised the EHDS opt-out.',
117
+ missing: MISSING.MISSING_OPT_OUT,
118
+ },
119
+ {
120
+ ruleId: 'R3',
121
+ permissionId: 'PermDownloadLocalCopy',
122
+ clauseId: 'H3',
123
+ needId: 'Need_SecureProcessingEnvironment',
124
+ baseScore: 70,
125
+ riskSource: 'Local download permitted; secure processing environment not required.',
126
+ mitigation: 'Require processing only within a secure processing environment.',
127
+ missing: MISSING.MISSING_SECURE_ENV,
128
+ },
129
+ {
130
+ ruleId: 'R4',
131
+ permissionId: 'PermProvidePseudonymisedData',
132
+ clauseId: 'H4',
133
+ needId: 'Need_StatisticallyAnonymisedSecondaryUse',
134
+ baseScore: 65,
135
+ riskSource: 'Statistical anonymisation safeguard missing for secondary use.',
136
+ mitigation: 'Require statistically anonymised data for secondary use.',
137
+ missing: MISSING.MISSING_STAT_ANON,
138
+ },
139
+ ];
140
+
141
+ function findNeed(id) {
142
+ return NEEDS.find((need) => need.id === id) || null;
143
+ }
144
+
145
+ function findPerm(id) {
146
+ return PERMISSIONS.find((permission) => permission.id === id) || null;
147
+ }
148
+
149
+ function hasConstraint(permission, key) {
150
+ return permission.constraints.some((constraint) => constraint.key === key);
151
+ }
152
+
153
+ function hasDuty(permission, action) {
154
+ return permission.duties.some((duty) => duty.action === action);
155
+ }
156
+
157
+ function missing(permission, kind) {
158
+ switch (kind) {
159
+ case MISSING.MISSING_DATA_PERMIT:
160
+ return !hasConstraint(permission, CONSTRAINT_KEY.HAS_DATA_PERMIT);
161
+ case MISSING.MISSING_OPT_OUT:
162
+ return !hasConstraint(permission, CONSTRAINT_KEY.RESPECT_OPT_OUT_SECONDARY_USE);
163
+ case MISSING.MISSING_SECURE_ENV:
164
+ return !hasDuty(permission, ACTION.PROCESS_ONLY_IN_SECURE_ENVIRONMENT);
165
+ case MISSING.MISSING_STAT_ANON:
166
+ return !hasConstraint(permission, CONSTRAINT_KEY.STATISTICALLY_ANONYMISED);
167
+ default:
168
+ return false;
169
+ }
170
+ }
171
+
172
+ // Materialize the ranked risk list and verify the ordering and scores.
173
+ function main() {
174
+ const risks = [];
175
+ for (const rule of RULES) {
176
+ const permission = findPerm(rule.permissionId);
177
+ const need = findNeed(rule.needId);
178
+ if (permission && need && missing(permission, rule.missing)) {
179
+ const raw = rule.baseScore + need.importance;
180
+ const score = raw > 100 ? 100 : raw;
181
+ risks.push({
182
+ clauseId: rule.clauseId,
183
+ permissionId: rule.permissionId,
184
+ needId: rule.needId,
185
+ action: permission.action,
186
+ needImportance: need.importance,
187
+ scoreRaw: raw,
188
+ score,
189
+ riskSource: rule.riskSource,
190
+ mitigation: rule.mitigation,
191
+ });
192
+ }
193
+ }
194
+
195
+ risks.sort((a, b) => {
196
+ if (b.score !== a.score) return b.score - a.score;
197
+ return a.clauseId.localeCompare(b.clauseId);
198
+ });
199
+
200
+ let scoreFormulaOk = true;
201
+ let sortedOk = true;
202
+ let mitigationsOk = true;
203
+ for (let i = 0; i < risks.length; i += 1) {
204
+ const rule = RULES[i];
205
+ const need = findNeed(rule.needId);
206
+ const expected = Math.min(rule.baseScore + need.importance, 100);
207
+ if (risks.length > 0 && risks[i].score !== expected) scoreFormulaOk = false;
208
+ if (!risks[i].mitigation) mitigationsOk = false;
209
+ if (i + 1 < risks.length && risks[i].score < risks[i + 1].score) sortedOk = false;
210
+ }
211
+
212
+ const topPairOk =
213
+ risks.length >= 2 &&
214
+ risks[0].clauseId === 'H1' &&
215
+ risks[0].score === 100 &&
216
+ risks[1].clauseId === 'H2' &&
217
+ risks[1].score === 100;
218
+
219
+ const ok = risks.length === 4 && scoreFormulaOk && sortedOk && topPairOk && mitigationsOk;
220
+
221
+ const lines = [];
222
+ lines.push('=== Answer ===');
223
+ lines.push(
224
+ 'The EHDS secondary-use agreement yields four ranked risks; H1 and H2 normalize to score 100, followed by H3 at 88 and H4 at 80.',
225
+ );
226
+ lines.push('');
227
+ lines.push('=== Reason Why ===');
228
+ lines.push(
229
+ 'The agreement instantiates concrete clauses, permissions, patient needs, and rule applications. A risk appears when a permission is missing a required safeguard.',
230
+ );
231
+ for (let i = 0; i < risks.length; i += 1) {
232
+ const risk = risks[i];
233
+ lines.push(`Risk #${i + 1}`);
234
+ lines.push(` clause : ${risk.clauseId}`);
235
+ lines.push(` permission : ${risk.permissionId}`);
236
+ lines.push(` action : ${actionName(risk.action)}`);
237
+ lines.push(` violated need : ${risk.needId}`);
238
+ lines.push(` score raw : ${risk.scoreRaw}`);
239
+ lines.push(` score : ${risk.score}`);
240
+ lines.push(` source : ${risk.riskSource}`);
241
+ lines.push(` mitigation : ${risk.mitigation}`);
242
+ }
243
+ lines.push('');
244
+ lines.push('=== Check ===');
245
+ lines.push(`risk count = 4 : ${risks.length === 4 ? 'yes' : 'no'}`);
246
+ lines.push(`score formula recomputes: ${scoreFormulaOk ? 'yes' : 'no'}`);
247
+ lines.push(`ranking sorted desc : ${sortedOk ? 'yes' : 'no'}`);
248
+ lines.push(`expected top pair : ${topPairOk ? 'yes' : 'no'}`);
249
+ lines.push(`every risk has mitigation: ${mitigationsOk ? 'yes' : 'no'}`);
250
+
251
+ process.stdout.write(`${lines.join('\n')}\n`);
252
+ process.exit(ok ? 0 : 1);
253
+ }
254
+
255
+ main();
@@ -0,0 +1,18 @@
1
+ === Answer ===
2
+ For starts 1..=10000, every tested value reaches 1 under the Collatz map.
3
+
4
+ === Reason Why ===
5
+ The program applies the standard Collatz rule, memoizes stopping times, and tracks the hardest witnesses.
6
+ starts checked : 10000
7
+ max steps : 261
8
+ max-steps start : 6171
9
+ highest peak : 27114424
10
+ peak start : 9663
11
+ trace(27) steps : 111
12
+ trace(27) peak : 9232
13
+
14
+ === Check ===
15
+ all reach 1 : yes
16
+ trace(27) valid : yes
17
+ max-steps witness ok: yes
18
+ peak witness ok : yes
@@ -0,0 +1,14 @@
1
+ === Answer ===
2
+ The control query is satisfied: the source facts derive concrete outputs for actuator1 and actuator2.
3
+
4
+ === Reason Why ===
5
+ The helper rule measurement10(input1) is derived first, then both control rules are evaluated from the available facts.
6
+ measurement10(input1): 2.236068
7
+ actuator1 : 39.273462
8
+ actuator2 : 26.080000
9
+
10
+ === Check ===
11
+ query satisfied : yes
12
+ unique actuators : yes
13
+ actuator1 formula ok : yes
14
+ actuator2 formula ok : yes
@@ -0,0 +1,15 @@
1
+ === Answer ===
2
+ The deep taxonomy chain reaches the goal from the seed fact after deriving the full class ladder up to N(100000).
3
+
4
+ === Reason Why ===
5
+ Starting from Ind:N(0), each N(i) derives N(i+1), I(i+1), and J(i+1); N(100000) then derives A2 and the goal.
6
+ seed facts : 1
7
+ rules : 100002
8
+ derived facts : 300003
9
+ type facts : 300002
10
+
11
+ === Check ===
12
+ goal reached : yes
13
+ N(100000) seen: yes
14
+ A2 derived : yes
15
+ count formula : yes
@@ -0,0 +1,20 @@
1
+ === Answer ===
2
+ The scanner is allowed to use a neutral shopping insight and recommends Low-Sugar Tea Biscuits instead of Classic Tea Biscuits.
3
+
4
+ === Reason Why ===
5
+ The phone desensitizes a diabetes-related household condition into a scoped low-sugar need, wraps it in an expiring Insight+Policy envelope, and signs it.
6
+ scanned product : Classic Tea Biscuits
7
+ suggested alternative: Low-Sugar Tea Biscuits
8
+ payload SHA-256 : e1ad69852c98ca7697a164dbc6f0ca28f873508a6676865dba37b81faa66ebcb
9
+ HMAC-SHA256 : 518a84185e2975928c6c935dae6e251a071766078c6e9e70d6f583a1147728db
10
+
11
+ === Check ===
12
+ signature verifies : yes
13
+ payload hash matches : yes
14
+ minimization strips sensitive terms: yes
15
+ scope complete : yes
16
+ authorization allowed : yes
17
+ high-sugar banner : yes
18
+ alternative lowers sugar : yes
19
+ duty timing consistent : yes
20
+ marketing prohibited : yes
@@ -0,0 +1,12 @@
1
+ === Answer ===
2
+ Euler's identity holds exactly in this exact-arithmetic model: exp(i*pi) + 1 = 0.
3
+
4
+ === Reason Why ===
5
+ exp(i*pi) is represented as (-1, 0) and adding (1, 0) gives the exact zero complex number.
6
+ exp(i*pi) : (-1, 0)
7
+ exp(i*pi)+1 : (0, 0)
8
+ |exp(i*pi)|^2: 1
9
+
10
+ === Check ===
11
+ identity exact: yes
12
+ unit circle : yes
@@ -0,0 +1,21 @@
1
+ === Answer ===
2
+ The requested Fibonacci values are computed exactly, up to F(10000).
3
+
4
+ === Reason Why ===
5
+ The main computation uses the defining recurrence F(n+1)=F(n)+F(n-1), and the results are cross-checked with fast doubling.
6
+ value[0] : F(0) = 0
7
+ value[1] : F(1) = 1
8
+ value[2] : F(10) = 55
9
+ value[3] : F(100) = 354224848179261915075
10
+ value[4] : F(1000) = 43466557686937456435688527675040625802564660517371780402481729089536555417949051890403879840079255169295922593080322634775209689623239873322471161642996440906533187938298969649928516003704476137795166849228875
11
+ value[5] : F(10000) = 33644764876431783266621612005107543310302148460680063906564769974680081442166662368155595513633734025582065332680836159373734790483865268263040892463056431887354544369559827491606602099884183933864652731300088830269235673613135117579297437854413752130520504347701602264758318906527890855154366159582987279682987510631200575428783453215515103870818298969791613127856265033195487140214287532698187962046936097879900350962302291026368131493195275630227837628441540360584402572114334961180023091208287046088923962328835461505776583271252546093591128203925285393434620904245248929403901706233888991085841065183173360437470737908552631764325733993712871937587746897479926305837065742830161637408969178426378624212835258112820516370298089332099905707920064367426202389783111470054074998459250360633560933883831923386783056136435351892133279732908133732642652633989763922723407882928177953580570993691049175470808931841056146322338217465637321248226383092103297701648054726243842374862411453093812206564914032751086643394517512161526545361333111314042436854805106765843493523836959653428071768775328348234345557366719731392746273629108210679280784718035329131176778924659089938635459327894523777674406192240337638674004021330343297496902028328145933418826817683893072003634795623117103101291953169794607632737589253530772552375943788434504067715555779056450443016640119462580972216729758615026968443146952034614932291105970676243268515992834709891284706740862008587135016260312071903172086094081298321581077282076353186624611278245537208532365305775956430072517744315051539600905168603220349163222640885248852433158051534849622434848299380905070483482449327453732624567755879089187190803662058009594743150052402532709746995318770724376825907419939632265984147498193609285223945039707165443156421328157688908058783183404917434556270520223564846495196112460268313970975069382648706613264507665074611512677522748621598642530711298441182622661057163515069260029861704945425047491378115154139941550671256271197133252763631939606902895650288268608362241082050562430701794976171121233066073310059947366875
12
+ digits in F(1000) : 209
13
+ digits in F(10000) : 2090
14
+
15
+ === Check ===
16
+ F(10) = 55 : yes
17
+ fast doubling agrees : yes
18
+ Cassini at n=100 : yes
19
+ F(1000) has 209 digits: yes
20
+ F(10000) has 2090 digits: yes
21
+ F(10000) ends in 875 : yes
@@ -0,0 +1,17 @@
1
+ === Answer ===
2
+ Every even integer from 4 through 1000 has at least one Goldbach decomposition in the tested range.
3
+
4
+ === Reason Why ===
5
+ The program builds a prime table, enumerates unordered pairs p+q=n for each even target, and summarizes sparse and rich cases.
6
+ even targets checked : 499
7
+ total decompositions : 8222
8
+ fewest decompositions: 1
9
+ hardest targets : 4, 6, 8, 12
10
+ most decompositions : 52
11
+ richest target : 990
12
+ balanced pair(1000) : 491 + 509
13
+
14
+ === Check ===
15
+ all represented : yes
16
+ prime count known : yes
17
+ balanced pair valid : yes
@@ -0,0 +1,33 @@
1
+ === Answer ===
2
+ The GPS case finds all goal routes from Gent to Oostende that satisfy the route constraints.
3
+ case : gps
4
+ routes : 2
5
+
6
+ === Reason Why ===
7
+ Routes are built compositionally from direct descriptions, with duration and cost added and belief and comfort combined multiplicatively.
8
+ Route #1
9
+ Steps : 2
10
+ Duration : 2400 s (≤ 5000)
11
+ Cost : 0.010 (≤ 5.0)
12
+ Belief : 0.941 (≥ 0.2)
13
+ Comfort : 0.990 (≥ 0.4)
14
+ Stages : 1 (≤ 1)
15
+ 1. drive_gent_brugge
16
+ 2. drive_brugge_oostende
17
+
18
+ Route #2
19
+ Steps : 3
20
+ Duration : 4100 s (≤ 5000)
21
+ Cost : 0.018 (≤ 5.0)
22
+ Belief : 0.903 (≥ 0.2)
23
+ Comfort : 0.980 (≥ 0.4)
24
+ Stages : 1 (≤ 1)
25
+ 1. drive_gent_kortrijk
26
+ 2. drive_kortrijk_brugge
27
+ 3. drive_brugge_oostende
28
+
29
+ === Check ===
30
+ all routes satisfy constraints : yes
31
+ all routes hit goal endpoints : yes
32
+ metrics recompute from steps : yes
33
+ expected route count (= 2) : yes
@@ -0,0 +1,17 @@
1
+ === Answer ===
2
+ Every valid four-digit start tested reaches 6174, and all of them do so within seven iterations.
3
+
4
+ === Reason Why ===
5
+ The program applies Kaprekar's routine to every non-repdigit start, records the iteration count, and keeps witness traces.
6
+ valid starts checked: 9990
7
+ repdigits excluded : 10
8
+ max iterations : 7
9
+ worst-case starts : 2184
10
+ worst trace : 0014 -> 4086 -> 8172 -> 7443 -> 3996 -> 6264 -> 4176 -> 6174
11
+ leading-zero trace : 2111 -> 0999 -> 8991 -> 8082 -> 8532 -> 6174
12
+
13
+ === Check ===
14
+ 6174 fixed point : yes
15
+ all starts reach it : yes
16
+ bound <= 7 verified : yes
17
+ histogram total ok : yes
@@ -0,0 +1,14 @@
1
+ === Answer ===
2
+ In this toy matrix-mechanics model, the Hamiltonian has two discrete energy levels and does not commute with a second observable.
3
+
4
+ === Reason Why ===
5
+ H = [[1,0],[0,2]]
6
+ X = [[0,1],[1,0]]
7
+ HX = [[0,1],[2,0]]
8
+ XH = [[0,2],[1,0]]
9
+ [H,X] = [[0,-1],[1,0]]
10
+
11
+ === Check ===
12
+ trace/determinant match energy levels: yes
13
+ X^2 = I : yes
14
+ [H,X] != 0 : yes
@@ -0,0 +1,48 @@
1
+ === Answer ===
2
+ The EHDS secondary-use agreement yields four ranked risks; H1 and H2 normalize to score 100, followed by H3 at 88 and H4 at 80.
3
+
4
+ === Reason Why ===
5
+ The agreement instantiates concrete clauses, permissions, patient needs, and rule applications. A risk appears when a permission is missing a required safeguard.
6
+ Risk #1
7
+ clause : H1
8
+ permission : PermSecondaryUseDUA
9
+ action : provideSecondaryUseData
10
+ violated need : Need_RequireDataPermit
11
+ score raw : 100
12
+ score : 100
13
+ source : Secondary use permitted without EHDS Data Permit.
14
+ mitigation : Require an EHDS Data Permit before secondary use.
15
+ Risk #2
16
+ clause : H2
17
+ permission : PermSecondaryUseAllPatients
18
+ action : provideSecondaryUseData
19
+ violated need : Need_RespectOptOutSecondaryUse
20
+ score raw : 100
21
+ score : 100
22
+ source : Opt-out from secondary use not explicitly respected.
23
+ mitigation : Exclude records of persons who exercised the EHDS opt-out.
24
+ Risk #3
25
+ clause : H3
26
+ permission : PermDownloadLocalCopy
27
+ action : download
28
+ violated need : Need_SecureProcessingEnvironment
29
+ score raw : 88
30
+ score : 88
31
+ source : Local download permitted; secure processing environment not required.
32
+ mitigation : Require processing only within a secure processing environment.
33
+ Risk #4
34
+ clause : H4
35
+ permission : PermProvidePseudonymisedData
36
+ action : provideSecondaryUseData
37
+ violated need : Need_StatisticallyAnonymisedSecondaryUse
38
+ score raw : 80
39
+ score : 80
40
+ source : Statistical anonymisation safeguard missing for secondary use.
41
+ mitigation : Require statistically anonymised data for secondary use.
42
+
43
+ === Check ===
44
+ risk count = 4 : yes
45
+ score formula recomputes: yes
46
+ ranking sorted desc : yes
47
+ expected top pair : yes
48
+ every risk has mitigation: yes
@@ -0,0 +1,28 @@
1
+ === Answer ===
2
+ The path-discovery case finds every simple route from Ostend-Bruges International Airport to Václav Havel Airport Prague with at most two stopovers.
3
+
4
+ === Reason Why ===
5
+ The program builds adjacency lists from the full airport graph, then runs a depth-limited DFS that never revisits an airport.
6
+ airports : 7698
7
+ flights : 37274
8
+ source : Ostend-Bruges International Airport
9
+ destination : Václav Havel Airport Prague
10
+ max stopovers : 2
11
+
12
+ Route #1
13
+ Stopovers : 2
14
+ Airports : Ostend-Bruges International Airport -> Liège Airport -> Heraklion International Nikos Kazantzakis Airport -> Václav Havel Airport Prague
15
+
16
+ Route #2
17
+ Stopovers : 2
18
+ Airports : Ostend-Bruges International Airport -> Liège Airport -> Diagoras Airport -> Václav Havel Airport Prague
19
+
20
+ Route #3
21
+ Stopovers : 2
22
+ Airports : Ostend-Bruges International Airport -> Liège Airport -> Palma De Mallorca Airport -> Václav Havel Airport Prague
23
+
24
+ === Check ===
25
+ all routes within stopover bound : yes
26
+ all routes are simple paths : yes
27
+ all routes match endpoints : yes
28
+ route set matches known answer : yes
@@ -0,0 +1,15 @@
1
+ === Answer ===
2
+ In this toy PN-junction tunneling model, heavy doping narrows the depletion region enough for a tunneling window that rises to a peak and then falls.
3
+
4
+ === Reason Why ===
5
+ We count exact state overlap while forward bias shifts the empty P-side levels.
6
+ bias -> overlap current proxy : 0->2, 1->3, 2->4, 3->3, 4->2, 5->1, 6->0
7
+ peak point : 2 -> 4
8
+ high-bias point : 6 -> 0
9
+
10
+ === Check ===
11
+ heavily doped barrier is narrower : yes
12
+ peak occurs before overlap closes : yes
13
+ negative differential region : yes
14
+ high-bias overlap closes : yes
15
+ peak equals full overlap : yes
@@ -0,0 +1,20 @@
1
+ === Answer ===
2
+ Both polynomial examples are solved consistently: the computed roots satisfy the source polynomials and reconstruct the original coefficients.
3
+
4
+ === Reason Why ===
5
+ For each quartic, the program solves for the roots numerically, substitutes them back, and rebuilds the polynomial from those roots.
6
+
7
+ Example #1 (real quartic)
8
+ roots : 4, 3, 2, 1
9
+ residuals : 0, 0, 0, 0
10
+ reconstruction ok : yes
11
+ roots valid : yes
12
+
13
+ Example #2 (complex quartic)
14
+ roots : 3 + 2i, 1i, 1 + 1i, 5 + 1i
15
+ residuals : 0, 0, 0, 0
16
+ reconstruction ok : yes
17
+ roots valid : yes
18
+
19
+ === Check ===
20
+ all examples valid : yes
@@ -0,0 +1,47 @@
1
+ === Answer ===
2
+ The puzzle is solved, and the completed grid is the unique valid Sudoku solution.
3
+
4
+ Puzzle
5
+ 1 . . | . . 7 | . 9 .
6
+ . 3 . | . 2 . | . . 8
7
+ . . 9 | 6 . . | 5 . .
8
+
9
+ . . 5 | 3 . . | 9 . .
10
+ . 1 . | . 8 . | . . 2
11
+ 6 . . | . . 4 | . . .
12
+
13
+ 3 . . | . . . | . 1 .
14
+ . 4 . | . . . | . . 7
15
+ . . 7 | . . . | 3 . .
16
+
17
+ Completed grid
18
+ 1 6 2 | 8 5 7 | 4 9 3
19
+ 5 3 4 | 1 2 9 | 6 7 8
20
+ 7 8 9 | 6 4 3 | 5 2 1
21
+
22
+ 4 7 5 | 3 1 2 | 9 8 6
23
+ 9 1 3 | 5 8 6 | 7 4 2
24
+ 6 2 8 | 7 9 4 | 1 3 5
25
+
26
+ 3 5 6 | 4 7 8 | 2 1 9
27
+ 2 4 1 | 9 3 5 | 8 6 7
28
+ 8 9 7 | 2 6 1 | 3 5 4
29
+
30
+ === Reason Why ===
31
+ The solver combines constraint propagation with depth-first search. It fills forced singles immediately and branches on the blank cell with the fewest candidates.
32
+ givens : 23
33
+ blanks : 58
34
+ forced placements : 213
35
+ guesses : 22
36
+ search nodes : 23
37
+ backtracks : 12
38
+ solution unique : yes
39
+
40
+ === Check ===
41
+ solver found solution : yes
42
+ givens preserved : yes
43
+ rows complete : yes
44
+ columns complete : yes
45
+ boxes complete : yes
46
+ recorded placements replay legally: yes
47
+ uniqueness check : yes
@@ -0,0 +1,16 @@
1
+ === Answer ===
2
+ In this toy transistor-switch model, a low input leaves the transistor OFF and a high input drives it ON in saturation.
3
+
4
+ === Reason Why ===
5
+ low input state : cutoff / OFF
6
+ high input state : saturation / ON
7
+ high base current : 430 uA
8
+ high collector Ic : 4800 uA
9
+ load-limited Ic : 4800 uA
10
+
11
+ === Check ===
12
+ low input cutoff : yes
13
+ high input saturation : yes
14
+ switching states differ : yes
15
+ on-state current is load-limited: yes
16
+ load voltage matches Ohm's law : yes