@stevenvo780/st-lang 4.7.0 → 4.8.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 (145) hide show
  1. package/dist/namespaces/reasoning.d.ts +2 -1
  2. package/dist/namespaces/reasoning.d.ts.map +1 -1
  3. package/dist/namespaces/reasoning.js +3 -1
  4. package/dist/namespaces/reasoning.js.map +1 -1
  5. package/dist/reasoning/combinatorial-games/index.d.ts +105 -0
  6. package/dist/reasoning/combinatorial-games/index.d.ts.map +1 -0
  7. package/dist/reasoning/combinatorial-games/index.js +377 -0
  8. package/dist/reasoning/combinatorial-games/index.js.map +1 -0
  9. package/dist/reasoning/mechanism-design/auctions.d.ts +49 -0
  10. package/dist/reasoning/mechanism-design/auctions.d.ts.map +1 -0
  11. package/dist/reasoning/mechanism-design/auctions.js +179 -0
  12. package/dist/reasoning/mechanism-design/auctions.js.map +1 -0
  13. package/dist/reasoning/mechanism-design/index.d.ts +5 -0
  14. package/dist/reasoning/mechanism-design/index.d.ts.map +1 -0
  15. package/dist/reasoning/mechanism-design/index.js +39 -0
  16. package/dist/reasoning/mechanism-design/index.js.map +1 -0
  17. package/dist/reasoning/mechanism-design/myerson.d.ts +64 -0
  18. package/dist/reasoning/mechanism-design/myerson.d.ts.map +1 -0
  19. package/dist/reasoning/mechanism-design/myerson.js +253 -0
  20. package/dist/reasoning/mechanism-design/myerson.js.map +1 -0
  21. package/dist/reasoning/mechanism-design/types.d.ts +44 -0
  22. package/dist/reasoning/mechanism-design/types.d.ts.map +1 -0
  23. package/dist/reasoning/mechanism-design/types.js +22 -0
  24. package/dist/reasoning/mechanism-design/types.js.map +1 -0
  25. package/dist/reasoning/mechanism-design/vcg.d.ts +29 -0
  26. package/dist/reasoning/mechanism-design/vcg.d.ts.map +1 -0
  27. package/dist/reasoning/mechanism-design/vcg.js +305 -0
  28. package/dist/reasoning/mechanism-design/vcg.js.map +1 -0
  29. package/dist/reasoning/probabilistic/distributions.d.ts +44 -0
  30. package/dist/reasoning/probabilistic/distributions.d.ts.map +1 -0
  31. package/dist/reasoning/probabilistic/distributions.js +207 -0
  32. package/dist/reasoning/probabilistic/distributions.js.map +1 -0
  33. package/dist/reasoning/probabilistic/examples.d.ts +31 -0
  34. package/dist/reasoning/probabilistic/examples.d.ts.map +1 -0
  35. package/dist/reasoning/probabilistic/examples.js +85 -0
  36. package/dist/reasoning/probabilistic/examples.js.map +1 -0
  37. package/dist/reasoning/probabilistic/index.d.ts +6 -0
  38. package/dist/reasoning/probabilistic/index.d.ts.map +1 -0
  39. package/dist/reasoning/probabilistic/index.js +42 -0
  40. package/dist/reasoning/probabilistic/index.js.map +1 -0
  41. package/dist/reasoning/probabilistic/inference.d.ts +45 -0
  42. package/dist/reasoning/probabilistic/inference.d.ts.map +1 -0
  43. package/dist/reasoning/probabilistic/inference.js +579 -0
  44. package/dist/reasoning/probabilistic/inference.js.map +1 -0
  45. package/dist/reasoning/probabilistic/types.d.ts +153 -0
  46. package/dist/reasoning/probabilistic/types.d.ts.map +1 -0
  47. package/dist/reasoning/probabilistic/types.js +37 -0
  48. package/dist/reasoning/probabilistic/types.js.map +1 -0
  49. package/dist/solver/smt-z3/index.d.ts +3 -0
  50. package/dist/solver/smt-z3/index.d.ts.map +1 -0
  51. package/dist/solver/smt-z3/index.js +11 -0
  52. package/dist/solver/smt-z3/index.js.map +1 -0
  53. package/dist/solver/smt-z3/types.d.ts +52 -0
  54. package/dist/solver/smt-z3/types.d.ts.map +1 -0
  55. package/dist/solver/smt-z3/types.js +6 -0
  56. package/dist/solver/smt-z3/types.js.map +1 -0
  57. package/dist/solver/smt-z3/z3-wasm-backend.d.ts +88 -0
  58. package/dist/solver/smt-z3/z3-wasm-backend.d.ts.map +1 -0
  59. package/dist/solver/smt-z3/z3-wasm-backend.js +437 -0
  60. package/dist/solver/smt-z3/z3-wasm-backend.js.map +1 -0
  61. package/dist/tests/reasoning/combinatorial-games/combinatorial-games.test.d.ts +2 -0
  62. package/dist/tests/reasoning/combinatorial-games/combinatorial-games.test.d.ts.map +1 -0
  63. package/dist/tests/reasoning/combinatorial-games/combinatorial-games.test.js +203 -0
  64. package/dist/tests/reasoning/combinatorial-games/combinatorial-games.test.js.map +1 -0
  65. package/dist/tests/reasoning/mechanism-design/mechanism-design.test.d.ts +2 -0
  66. package/dist/tests/reasoning/mechanism-design/mechanism-design.test.d.ts.map +1 -0
  67. package/dist/tests/reasoning/mechanism-design/mechanism-design.test.js +290 -0
  68. package/dist/tests/reasoning/mechanism-design/mechanism-design.test.js.map +1 -0
  69. package/dist/tests/reasoning/probabilistic/probabilistic.test.d.ts +2 -0
  70. package/dist/tests/reasoning/probabilistic/probabilistic.test.d.ts.map +1 -0
  71. package/dist/tests/reasoning/probabilistic/probabilistic.test.js +370 -0
  72. package/dist/tests/reasoning/probabilistic/probabilistic.test.js.map +1 -0
  73. package/dist/tests/solver/smt-z3/z3-wasm-backend.test.d.ts +2 -0
  74. package/dist/tests/solver/smt-z3/z3-wasm-backend.test.d.ts.map +1 -0
  75. package/dist/tests/solver/smt-z3/z3-wasm-backend.test.js +394 -0
  76. package/dist/tests/solver/smt-z3/z3-wasm-backend.test.js.map +1 -0
  77. package/dist/tests/tooling/proof-guidance/features.test.d.ts +2 -0
  78. package/dist/tests/tooling/proof-guidance/features.test.d.ts.map +1 -0
  79. package/dist/tests/tooling/proof-guidance/features.test.js +72 -0
  80. package/dist/tests/tooling/proof-guidance/features.test.js.map +1 -0
  81. package/dist/tests/tooling/proof-guidance/model.test.d.ts +2 -0
  82. package/dist/tests/tooling/proof-guidance/model.test.d.ts.map +1 -0
  83. package/dist/tests/tooling/proof-guidance/model.test.js +165 -0
  84. package/dist/tests/tooling/proof-guidance/model.test.js.map +1 -0
  85. package/dist/tests/tooling/proof-guidance/search.test.d.ts +2 -0
  86. package/dist/tests/tooling/proof-guidance/search.test.d.ts.map +1 -0
  87. package/dist/tests/tooling/proof-guidance/search.test.js +238 -0
  88. package/dist/tests/tooling/proof-guidance/search.test.js.map +1 -0
  89. package/dist/tests/type-theory/cubical/cubical.test.d.ts +2 -0
  90. package/dist/tests/type-theory/cubical/cubical.test.d.ts.map +1 -0
  91. package/dist/tests/type-theory/cubical/cubical.test.js +207 -0
  92. package/dist/tests/type-theory/cubical/cubical.test.js.map +1 -0
  93. package/dist/tooling/proof-guidance/features.d.ts +10 -0
  94. package/dist/tooling/proof-guidance/features.d.ts.map +1 -0
  95. package/dist/tooling/proof-guidance/features.js +97 -0
  96. package/dist/tooling/proof-guidance/features.js.map +1 -0
  97. package/dist/tooling/proof-guidance/index.d.ts +5 -0
  98. package/dist/tooling/proof-guidance/index.d.ts.map +1 -0
  99. package/dist/tooling/proof-guidance/index.js +25 -0
  100. package/dist/tooling/proof-guidance/index.js.map +1 -0
  101. package/dist/tooling/proof-guidance/model.d.ts +42 -0
  102. package/dist/tooling/proof-guidance/model.d.ts.map +1 -0
  103. package/dist/tooling/proof-guidance/model.js +149 -0
  104. package/dist/tooling/proof-guidance/model.js.map +1 -0
  105. package/dist/tooling/proof-guidance/search.d.ts +7 -0
  106. package/dist/tooling/proof-guidance/search.d.ts.map +1 -0
  107. package/dist/tooling/proof-guidance/search.js +102 -0
  108. package/dist/tooling/proof-guidance/search.js.map +1 -0
  109. package/dist/tooling/proof-guidance/types.d.ts +77 -0
  110. package/dist/tooling/proof-guidance/types.d.ts.map +1 -0
  111. package/dist/tooling/proof-guidance/types.js +8 -0
  112. package/dist/tooling/proof-guidance/types.js.map +1 -0
  113. package/dist/type-theory/cubical/equality.d.ts +4 -0
  114. package/dist/type-theory/cubical/equality.d.ts.map +1 -0
  115. package/dist/type-theory/cubical/equality.js +78 -0
  116. package/dist/type-theory/cubical/equality.js.map +1 -0
  117. package/dist/type-theory/cubical/index.d.ts +14 -0
  118. package/dist/type-theory/cubical/index.d.ts.map +1 -0
  119. package/dist/type-theory/cubical/index.js +71 -0
  120. package/dist/type-theory/cubical/index.js.map +1 -0
  121. package/dist/type-theory/cubical/infer.d.ts +18 -0
  122. package/dist/type-theory/cubical/infer.d.ts.map +1 -0
  123. package/dist/type-theory/cubical/infer.js +241 -0
  124. package/dist/type-theory/cubical/infer.js.map +1 -0
  125. package/dist/type-theory/cubical/interval.d.ts +12 -0
  126. package/dist/type-theory/cubical/interval.d.ts.map +1 -0
  127. package/dist/type-theory/cubical/interval.js +118 -0
  128. package/dist/type-theory/cubical/interval.js.map +1 -0
  129. package/dist/type-theory/cubical/normalize.d.ts +5 -0
  130. package/dist/type-theory/cubical/normalize.d.ts.map +1 -0
  131. package/dist/type-theory/cubical/normalize.js +191 -0
  132. package/dist/type-theory/cubical/normalize.js.map +1 -0
  133. package/dist/type-theory/cubical/path-algebra.d.ts +12 -0
  134. package/dist/type-theory/cubical/path-algebra.d.ts.map +1 -0
  135. package/dist/type-theory/cubical/path-algebra.js +109 -0
  136. package/dist/type-theory/cubical/path-algebra.js.map +1 -0
  137. package/dist/type-theory/cubical/substitute.d.ts +3 -0
  138. package/dist/type-theory/cubical/substitute.d.ts.map +1 -0
  139. package/dist/type-theory/cubical/substitute.js +109 -0
  140. package/dist/type-theory/cubical/substitute.js.map +1 -0
  141. package/dist/type-theory/cubical/types.d.ts +77 -0
  142. package/dist/type-theory/cubical/types.d.ts.map +1 -0
  143. package/dist/type-theory/cubical/types.js +258 -0
  144. package/dist/type-theory/cubical/types.js.map +1 -0
  145. package/package.json +1 -1
@@ -0,0 +1,165 @@
1
+ "use strict";
2
+ // ============================================================
3
+ // Tests: trainModel, rankTactics, updateModel, tacticSuccessProbability
4
+ // ============================================================
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const vitest_1 = require("vitest");
7
+ const proof_guidance_1 = require("../../../tooling/proof-guidance");
8
+ function record(tactic, beforeState, afterState, successful) {
9
+ return { tactic, beforeState, afterState, successful };
10
+ }
11
+ (0, vitest_1.describe)('trainModel', () => {
12
+ (0, vitest_1.it)('con 10 records produce modelo con weights aprendidos', () => {
13
+ // Dataset sintético: 'assumption' funciona cuando hypEqualsGoal=1.
14
+ // 'intro' funciona cuando el goal tiene →.
15
+ const records = [
16
+ record('assumption', { goal: 'P', hypotheses: ['P'] }, { goal: '', hypotheses: ['P'] }, true),
17
+ record('assumption', { goal: 'Q', hypotheses: ['Q'] }, { goal: '', hypotheses: ['Q'] }, true),
18
+ record('assumption', { goal: 'R', hypotheses: ['R'] }, { goal: '', hypotheses: ['R'] }, true),
19
+ record('assumption', { goal: 'P', hypotheses: ['Q'] }, { goal: 'P', hypotheses: ['Q'] }, false),
20
+ record('assumption', { goal: 'A', hypotheses: ['B'] }, { goal: 'A', hypotheses: ['B'] }, false),
21
+ record('intro', { goal: 'P → Q', hypotheses: [] }, { goal: 'Q', hypotheses: ['P'] }, true),
22
+ record('intro', { goal: 'A → B', hypotheses: [] }, { goal: 'B', hypotheses: ['A'] }, true),
23
+ record('intro', { goal: 'X → Y', hypotheses: [] }, { goal: 'Y', hypotheses: ['X'] }, true),
24
+ record('intro', { goal: 'P', hypotheses: [] }, { goal: 'P', hypotheses: [] }, false),
25
+ record('intro', { goal: 'Q', hypotheses: [] }, { goal: 'Q', hypotheses: [] }, false),
26
+ ];
27
+ const model = (0, proof_guidance_1.trainModel)(records, { epochs: 100 });
28
+ (0, vitest_1.expect)(model.weights.size).toBeGreaterThan(0);
29
+ (0, vitest_1.expect)(model.bias.size).toBeGreaterThan(0);
30
+ (0, vitest_1.expect)(model.features.length).toBeGreaterThan(0);
31
+ // El modelo debe puntuar 'assumption' alto cuando hypEqualsGoal=1.
32
+ const goodForAssumption = { goal: 'P', hypotheses: ['P'] };
33
+ const ranked1 = (0, proof_guidance_1.rankTactics)(goodForAssumption, model, ['assumption', 'intro']);
34
+ (0, vitest_1.expect)(ranked1[0].tactic).toBe('assumption');
35
+ // Y 'intro' alto cuando el goal tiene →.
36
+ const goodForIntro = { goal: 'A → B', hypotheses: [] };
37
+ const ranked2 = (0, proof_guidance_1.rankTactics)(goodForIntro, model, ['assumption', 'intro']);
38
+ (0, vitest_1.expect)(ranked2[0].tactic).toBe('intro');
39
+ });
40
+ (0, vitest_1.it)('modelo vacío (sin records) tiene weights vacíos pero rankea sin crashear', () => {
41
+ const model = (0, proof_guidance_1.trainModel)([]);
42
+ (0, vitest_1.expect)(model.weights.size).toBe(0);
43
+ const ranked = (0, proof_guidance_1.rankTactics)({ goal: 'P', hypotheses: [] }, model, ['a', 'b', 'c']);
44
+ (0, vitest_1.expect)(ranked.length).toBe(3);
45
+ // Todas con score 0 — orden estable por idx.
46
+ (0, vitest_1.expect)(ranked.every((r) => r.score === 0)).toBe(true);
47
+ (0, vitest_1.expect)(ranked.map((r) => r.tactic)).toEqual(['a', 'b', 'c']);
48
+ });
49
+ });
50
+ (0, vitest_1.describe)('rankTactics', () => {
51
+ (0, vitest_1.it)('ordena consistentemente: mismo state + model + candidates → mismo ranking', () => {
52
+ const records = [
53
+ record('apply', { goal: 'P', hypotheses: ['P → Q'] }, { goal: 'Q', hypotheses: [] }, true),
54
+ record('apply', { goal: 'A', hypotheses: ['A → B'] }, { goal: 'B', hypotheses: [] }, true),
55
+ record('intro', { goal: 'P → Q', hypotheses: [] }, { goal: 'Q', hypotheses: ['P'] }, true),
56
+ record('intro', { goal: 'X → Y', hypotheses: [] }, { goal: 'Y', hypotheses: ['X'] }, true),
57
+ record('apply', { goal: 'P', hypotheses: [] }, { goal: 'P', hypotheses: [] }, false),
58
+ ];
59
+ const model = (0, proof_guidance_1.trainModel)(records, { epochs: 80 });
60
+ const state = { goal: 'P', hypotheses: ['P → Q'] };
61
+ const r1 = (0, proof_guidance_1.rankTactics)(state, model, ['intro', 'apply', 'assumption']);
62
+ const r2 = (0, proof_guidance_1.rankTactics)(state, model, ['intro', 'apply', 'assumption']);
63
+ (0, vitest_1.expect)(r1).toEqual(r2);
64
+ });
65
+ (0, vitest_1.it)('candidatos no vistos en training reciben score 0 y quedan al final', () => {
66
+ const records = [
67
+ record('foo', { goal: 'P', hypotheses: ['P'] }, { goal: '', hypotheses: ['P'] }, true),
68
+ record('foo', { goal: 'Q', hypotheses: ['Q'] }, { goal: '', hypotheses: ['Q'] }, true),
69
+ record('foo', { goal: 'R', hypotheses: ['R'] }, { goal: '', hypotheses: ['R'] }, true),
70
+ ];
71
+ const model = (0, proof_guidance_1.trainModel)(records, { epochs: 80 });
72
+ const state = { goal: 'P', hypotheses: ['P'] };
73
+ const ranked = (0, proof_guidance_1.rankTactics)(state, model, ['nunca-visto', 'foo']);
74
+ (0, vitest_1.expect)(ranked[0].tactic).toBe('foo');
75
+ (0, vitest_1.expect)(ranked[0].score).toBeGreaterThan(ranked[1].score);
76
+ });
77
+ (0, vitest_1.it)('tie-break determinístico cuando todos los scores son iguales', () => {
78
+ const model = (0, proof_guidance_1.createEmptyModel)();
79
+ const state = { goal: 'P', hypotheses: [] };
80
+ const ranked = (0, proof_guidance_1.rankTactics)(state, model, ['c', 'b', 'a']);
81
+ (0, vitest_1.expect)(ranked.map((r) => r.tactic)).toEqual(['c', 'b', 'a']); // mismo orden de entrada
82
+ });
83
+ });
84
+ (0, vitest_1.describe)('updateModel', () => {
85
+ (0, vitest_1.it)('converge con repeated updates: la probabilidad estimada se mueve hacia el target', () => {
86
+ let model = (0, proof_guidance_1.createEmptyModel)();
87
+ const state = { goal: 'P', hypotheses: ['P'] };
88
+ const successRecord = {
89
+ tactic: 'assumption',
90
+ beforeState: state,
91
+ afterState: { goal: '', hypotheses: ['P'] },
92
+ successful: true,
93
+ };
94
+ const p0 = (0, proof_guidance_1.tacticSuccessProbability)(state, model, 'assumption');
95
+ (0, vitest_1.expect)(p0).toBeCloseTo(0.5); // bias 0 + features × 0 → sigmoid(0)
96
+ // 200 actualizaciones positivas → la probabilidad debe subir mucho.
97
+ for (let i = 0; i < 200; i++) {
98
+ model = (0, proof_guidance_1.updateModel)(model, successRecord, 0.3);
99
+ }
100
+ const pAfter = (0, proof_guidance_1.tacticSuccessProbability)(state, model, 'assumption');
101
+ (0, vitest_1.expect)(pAfter).toBeGreaterThan(0.9);
102
+ });
103
+ (0, vitest_1.it)('updateModel no muta el modelo original (immutable update)', () => {
104
+ const model = (0, proof_guidance_1.createEmptyModel)();
105
+ const record = {
106
+ tactic: 'foo',
107
+ beforeState: { goal: 'P', hypotheses: ['P'] },
108
+ afterState: { goal: '', hypotheses: ['P'] },
109
+ successful: true,
110
+ };
111
+ const sizeBefore = model.weights.size;
112
+ const biasBefore = model.bias.size;
113
+ const next = (0, proof_guidance_1.updateModel)(model, record, 0.5);
114
+ (0, vitest_1.expect)(model.weights.size).toBe(sizeBefore);
115
+ (0, vitest_1.expect)(model.bias.size).toBe(biasBefore);
116
+ (0, vitest_1.expect)(next.weights.size).toBeGreaterThanOrEqual(sizeBefore);
117
+ });
118
+ (0, vitest_1.it)('updates negativos bajan la probabilidad', () => {
119
+ let model = (0, proof_guidance_1.createEmptyModel)();
120
+ const state = { goal: 'P', hypotheses: [] };
121
+ const failRecord = {
122
+ tactic: 'wrong-tactic',
123
+ beforeState: state,
124
+ afterState: state,
125
+ successful: false,
126
+ };
127
+ for (let i = 0; i < 200; i++) {
128
+ model = (0, proof_guidance_1.updateModel)(model, failRecord, 0.3);
129
+ }
130
+ const p = (0, proof_guidance_1.tacticSuccessProbability)(state, model, 'wrong-tactic');
131
+ (0, vitest_1.expect)(p).toBeLessThan(0.1);
132
+ });
133
+ });
134
+ (0, vitest_1.describe)('proofDepthRemaining weighting', () => {
135
+ (0, vitest_1.it)('records con menos depth remaining tienen más peso en train', () => {
136
+ // Mismos features y mismas tácticas; el record "close to QED" pesa más.
137
+ const records = [
138
+ {
139
+ tactic: 'finish',
140
+ beforeState: { goal: 'P', hypotheses: ['P'] },
141
+ afterState: { goal: '', hypotheses: ['P'] },
142
+ successful: true,
143
+ proofDepthRemaining: 0,
144
+ },
145
+ {
146
+ tactic: 'finish',
147
+ beforeState: { goal: 'Q', hypotheses: ['Q'] },
148
+ afterState: { goal: '', hypotheses: ['Q'] },
149
+ successful: true,
150
+ proofDepthRemaining: 0,
151
+ },
152
+ {
153
+ tactic: 'finish',
154
+ beforeState: { goal: 'R', hypotheses: ['R'] },
155
+ afterState: { goal: '', hypotheses: ['R'] },
156
+ successful: true,
157
+ proofDepthRemaining: 0,
158
+ },
159
+ ];
160
+ const model = (0, proof_guidance_1.trainModel)(records, { epochs: 100 });
161
+ const p = (0, proof_guidance_1.tacticSuccessProbability)({ goal: 'X', hypotheses: ['X'] }, model, 'finish');
162
+ (0, vitest_1.expect)(p).toBeGreaterThan(0.6);
163
+ });
164
+ });
165
+ //# sourceMappingURL=model.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model.test.js","sourceRoot":"","sources":["../../../../src/tests/tooling/proof-guidance/model.test.ts"],"names":[],"mappings":";AAAA,+DAA+D;AAC/D,wEAAwE;AACxE,+DAA+D;;AAE/D,mCAA8C;AAC9C,oEAMyC;AAGzC,SAAS,MAAM,CACb,MAAc,EACd,WAAuB,EACvB,UAAsB,EACtB,UAAmB;IAEnB,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC;AACzD,CAAC;AAED,IAAA,iBAAQ,EAAC,YAAY,EAAE,GAAG,EAAE;IAC1B,IAAA,WAAE,EAAC,sDAAsD,EAAE,GAAG,EAAE;QAC9D,mEAAmE;QACnE,2CAA2C;QAC3C,MAAM,OAAO,GAAmB;YAC9B,MAAM,CAAC,YAAY,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC;YAC7F,MAAM,CAAC,YAAY,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC;YAC7F,MAAM,CAAC,YAAY,EAAE,EAAE,I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,CAAC;aACvB;YACD;gBACE,MAAM,EAAE,QAAQ;gBAChB,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,CAAC,GAAG,CAAC,EAAE;gBAC7C,UAAU,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC,GAAG,CAAC,EAAE;gBAC3C,UAAU,EAAE,IAAI;gBAChB,mBAAmB,EAAE,CAAC;aACvB;SACF,CAAC;QAEF,MAAM,KAAK,GAAG,IAAA,2BAAU,EAAC,OAAO,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;QACnD,MAAM,CAAC,GAAG,IAAA,yCAAwB,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;QACtF,IAAA,eAAM,EAAC,CAAC,CAAC,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;IACjC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=search.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search.test.d.ts","sourceRoot":"","sources":["../../../../src/tests/tooling/proof-guidance/search.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,238 @@
1
+ "use strict";
2
+ // ============================================================
3
+ // Tests: guidedSearch (beam search guiada por modelo)
4
+ // ============================================================
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const vitest_1 = require("vitest");
7
+ const proof_guidance_1 = require("../../../tooling/proof-guidance");
8
+ /**
9
+ * Mini-motor de tácticas mock — lo suficientemente rico para
10
+ * que el beam search tenga algo no-trivial que decidir.
11
+ *
12
+ * Tácticas:
13
+ * - 'assumption': cierra si goal ∈ hypotheses.
14
+ * - 'intro': si goal = "A → B", deja goal = B con A agregado a hyps.
15
+ * - 'modusPonens': si goal = G y hay "X → G" + "X" en hyps, cierra.
16
+ * - 'split-and': si goal = "A ∧ B", deja goal = A (rama simplificada).
17
+ * - 'noop': no aplica (siempre devuelve null) — táctica trampa.
18
+ */
19
+ const mockApply = (state, tactic) => {
20
+ const goal = state.goal.trim();
21
+ if (tactic === 'assumption') {
22
+ if (state.hypotheses.some((h) => h.trim() === goal)) {
23
+ return { goal: '', hypotheses: state.hypotheses };
24
+ }
25
+ return null;
26
+ }
27
+ if (tactic === 'intro') {
28
+ const m = /^(.+?)\s*→\s*(.+)$/.exec(goal);
29
+ if (m) {
30
+ const [, antecedent, consequent] = m;
31
+ return {
32
+ goal: consequent.trim(),
33
+ hypotheses: [...state.hypotheses, antecedent.trim()],
34
+ };
35
+ }
36
+ return null;
37
+ }
38
+ if (tactic === 'modusPonens') {
39
+ // busca "X → G" con X también en hyps
40
+ for (const h of state.hypotheses) {
41
+ const m = /^(.+?)\s*→\s*(.+)$/.exec(h.trim());
42
+ if (m && m[2].trim() === goal) {
43
+ const x = m[1].trim();
44
+ if (state.hypotheses.some((h2) => h2.trim() === x)) {
45
+ return { goal: '', hypotheses: state.hypotheses };
46
+ }
47
+ }
48
+ }
49
+ return null;
50
+ }
51
+ if (tactic === 'split-and') {
52
+ const m = /^(.+?)\s*∧\s*(.+)$/.exec(goal);
53
+ if (m) {
54
+ return { goal: m[1].trim(), hypotheses: state.hypotheses };
55
+ }
56
+ return null;
57
+ }
58
+ return null;
59
+ };
60
+ (0, vitest_1.describe)('guidedSearch', () => {
61
+ (0, vitest_1.it)('encuentra prueba simple por assumption directa (intro → assumption)', () => {
62
+ // Goal "A → A" requiere: intro deja goal=A con A en hyps → assumption cierra.
63
+ const model = (0, proof_guidance_1.createEmptyModel)();
64
+ const initial = { goal: 'P', hypotheses: [] };
65
+ // Test caso donde NO está pre-cerrado: necesita aplicar al menos 1 táctica.
66
+ const wrapped = { goal: 'P → P', hypotheses: [] };
67
+ const result = (0, proof_guidance_1.guidedSearch)(wrapped, mockApply, model, ['assumption', 'intro', 'modusPonens']);
68
+ (0, vitest_1.expect)(result.success).toBe(true);
69
+ (0, vitest_1.expect)(result.proof).toBeDefined();
70
+ (0, vitest_1.expect)(result.proof.length).toBeGreaterThanOrEqual(1);
71
+ // El último paso debe cerrar el goal.
72
+ (0, vitest_1.expect)(result.proof[result.proof.length - 1].successful).toBe(true);
73
+ // initial nunca se usa por el caller — sólo lo mantenemos para tipado.
74
+ void initial;
75
+ });
76
+ (0, vitest_1.it)('encuentra prueba de modus ponens: P→Q + P ⊢ Q', () => {
77
+ // Entrenamos un modelo trivial para que prefiera modusPonens
78
+ // cuando el goal está en el consecuente de una hipótesis.
79
+ const trainingData = [
80
+ {
81
+ tactic: 'modusPonens',
82
+ beforeState: { goal: 'Q', hypotheses: ['P → Q', 'P'] },
83
+ afterState: { goal: '', hypotheses: ['P → Q', 'P'] },
84
+ successful: true,
85
+ },
86
+ {
87
+ tactic: 'modusPonens',
88
+ beforeState: { goal: 'B', hypotheses: ['A → B', 'A'] },
89
+ afterState: { goal: '', hypotheses: ['A → B', 'A'] },
90
+ successful: true,
91
+ },
92
+ {
93
+ tactic: 'assumption',
94
+ beforeState: { goal: 'Q', hypotheses: ['P → Q', 'P'] },
95
+ afterState: { goal: 'Q', hypotheses: ['P → Q', 'P'] },
96
+ successful: false,
97
+ },
98
+ ];
99
+ const model = (0, proof_guidance_1.trainModel)(trainingData, { epochs: 100 });
100
+ const initial = { goal: 'Q', hypotheses: ['P → Q', 'P'] };
101
+ const result = (0, proof_guidance_1.guidedSearch)(initial, mockApply, model, [
102
+ 'assumption',
103
+ 'intro',
104
+ 'modusPonens',
105
+ 'split-and',
106
+ ]);
107
+ (0, vitest_1.expect)(result.success).toBe(true);
108
+ (0, vitest_1.expect)(result.proof).toBeDefined();
109
+ // La prueba minimal es 1 paso (modusPonens directo).
110
+ (0, vitest_1.expect)(result.proof.length).toBeGreaterThanOrEqual(1);
111
+ (0, vitest_1.expect)(result.proof.some((p) => p.tactic === 'modusPonens')).toBe(true);
112
+ });
113
+ (0, vitest_1.it)('encuentra prueba de implicación: ⊢ A → A usando intro', () => {
114
+ // Tras `intro`, queda {goal:'A', hypotheses:['A']} — `isClosed` lo detecta
115
+ // (assumption implícita) sin necesidad de un paso extra. La prueba se cierra
116
+ // en 1 táctica.
117
+ const model = (0, proof_guidance_1.createEmptyModel)();
118
+ const initial = { goal: 'A → A', hypotheses: [] };
119
+ const result = (0, proof_guidance_1.guidedSearch)(initial, mockApply, model, ['intro', 'assumption']);
120
+ (0, vitest_1.expect)(result.success).toBe(true);
121
+ (0, vitest_1.expect)(result.proof.length).toBeGreaterThanOrEqual(1);
122
+ (0, vitest_1.expect)(result.proof[0].tactic).toBe('intro');
123
+ });
124
+ (0, vitest_1.it)('respeta timeout: retorna failure con reason=timeout si excede el presupuesto', () => {
125
+ // Apply que tarda artificialmente — usamos busy-wait corto.
126
+ const slowApply = (state) => {
127
+ const t0 = Date.now();
128
+ while (Date.now() - t0 < 5) {
129
+ /* burn */
130
+ }
131
+ // Nunca cierra el goal → search nunca tendrá éxito.
132
+ return { goal: state.goal + 'x', hypotheses: state.hypotheses };
133
+ };
134
+ const model = (0, proof_guidance_1.createEmptyModel)();
135
+ const initial = { goal: 'P', hypotheses: [] };
136
+ const result = (0, proof_guidance_1.guidedSearch)(initial, slowApply, model, ['t1', 't2', 't3'], {
137
+ timeoutMs: 20,
138
+ maxDepth: 50,
139
+ beamWidth: 5,
140
+ });
141
+ (0, vitest_1.expect)(result.success).toBe(false);
142
+ (0, vitest_1.expect)(result.reason === 'timeout' || result.reason === 'cap').toBe(true);
143
+ });
144
+ (0, vitest_1.it)('respeta maxDepth: falla con reason=depth si no puede probar en N pasos', () => {
145
+ // Aplicador que estira el goal indefinidamente sin cerrarlo.
146
+ const grow = (state, _tactic) => ({ goal: state.goal + 'x', hypotheses: state.hypotheses });
147
+ const model = (0, proof_guidance_1.createEmptyModel)();
148
+ const initial = { goal: 'P', hypotheses: [] };
149
+ const result = (0, proof_guidance_1.guidedSearch)(initial, grow, model, ['extender'], {
150
+ maxDepth: 3,
151
+ timeoutMs: 5000,
152
+ beamWidth: 1,
153
+ });
154
+ (0, vitest_1.expect)(result.success).toBe(false);
155
+ (0, vitest_1.expect)(result.reason).toBe('depth');
156
+ });
157
+ (0, vitest_1.it)('beam width afecta el número de estados explorados', () => {
158
+ // Aplicador que produce muchos hijos: cada tactic genera estado distinto.
159
+ const fanout = (state, tactic) => ({
160
+ goal: `${state.goal}-${tactic}`,
161
+ hypotheses: state.hypotheses,
162
+ });
163
+ const model = (0, proof_guidance_1.createEmptyModel)();
164
+ const initial = { goal: 'P', hypotheses: [] };
165
+ const candidates = ['t1', 't2', 't3', 't4'];
166
+ const narrow = (0, proof_guidance_1.guidedSearch)(initial, fanout, model, candidates, {
167
+ maxDepth: 4,
168
+ beamWidth: 1,
169
+ timeoutMs: 1000,
170
+ });
171
+ const wide = (0, proof_guidance_1.guidedSearch)(initial, fanout, model, candidates, {
172
+ maxDepth: 4,
173
+ beamWidth: 4,
174
+ timeoutMs: 1000,
175
+ });
176
+ (0, vitest_1.expect)(wide.exploredStates).toBeGreaterThan(narrow.exploredStates);
177
+ });
178
+ (0, vitest_1.it)('retorna éxito inmediato (proof vacío) si el goal ya está cerrado', () => {
179
+ const model = (0, proof_guidance_1.createEmptyModel)();
180
+ const initial = { goal: '', hypotheses: [] };
181
+ const result = (0, proof_guidance_1.guidedSearch)(initial, mockApply, model, ['assumption']);
182
+ (0, vitest_1.expect)(result.success).toBe(true);
183
+ (0, vitest_1.expect)(result.proof).toEqual([]);
184
+ (0, vitest_1.expect)(result.exploredStates).toBe(0);
185
+ });
186
+ (0, vitest_1.it)('no entra en ciclo: estados ya visitados se descartan', () => {
187
+ // Aplicador que devuelve el mismo estado (cycle detector debe cortar).
188
+ const identity = (state) => ({ goal: state.goal, hypotheses: state.hypotheses });
189
+ const model = (0, proof_guidance_1.createEmptyModel)();
190
+ const initial = { goal: 'P', hypotheses: [] };
191
+ const result = (0, proof_guidance_1.guidedSearch)(initial, identity, model, ['noop'], {
192
+ maxDepth: 100,
193
+ timeoutMs: 1000,
194
+ beamWidth: 5,
195
+ });
196
+ (0, vitest_1.expect)(result.success).toBe(false);
197
+ (0, vitest_1.expect)(result.exploredStates).toBeLessThan(50); // no debe explotar
198
+ });
199
+ (0, vitest_1.it)('exploredStates es coherente: aumenta con maxDepth', () => {
200
+ const fanout = (state, tactic) => ({
201
+ goal: `${state.goal}|${tactic}`,
202
+ hypotheses: state.hypotheses,
203
+ });
204
+ const model = (0, proof_guidance_1.createEmptyModel)();
205
+ const initial = { goal: 'X', hypotheses: [] };
206
+ const shallow = (0, proof_guidance_1.guidedSearch)(initial, fanout, model, ['a', 'b', 'c'], {
207
+ maxDepth: 2,
208
+ beamWidth: 3,
209
+ timeoutMs: 1000,
210
+ });
211
+ const deep = (0, proof_guidance_1.guidedSearch)(initial, fanout, model, ['a', 'b', 'c'], {
212
+ maxDepth: 6,
213
+ beamWidth: 3,
214
+ timeoutMs: 1000,
215
+ });
216
+ (0, vitest_1.expect)(deep.exploredStates).toBeGreaterThan(shallow.exploredStates);
217
+ });
218
+ });
219
+ (0, vitest_1.describe)('integración: train → search', () => {
220
+ (0, vitest_1.it)('un modelo entrenado guía la búsqueda hacia tácticas exitosas (modus ponens)', () => {
221
+ // Train data fuerte sobre modusPonens.
222
+ let model = (0, proof_guidance_1.createEmptyModel)();
223
+ const goodRecord = {
224
+ tactic: 'modusPonens',
225
+ beforeState: { goal: 'Q', hypotheses: ['P → Q', 'P'] },
226
+ afterState: { goal: '', hypotheses: ['P → Q', 'P'] },
227
+ successful: true,
228
+ };
229
+ for (let i = 0; i < 30; i++) {
230
+ model = (0, proof_guidance_1.updateModel)(model, goodRecord, 0.2);
231
+ }
232
+ const initial = { goal: 'Z', hypotheses: ['Y → Z', 'Y'] };
233
+ const result = (0, proof_guidance_1.guidedSearch)(initial, mockApply, model, ['split-and', 'intro', 'modusPonens', 'assumption'], { beamWidth: 1, maxDepth: 5, timeoutMs: 2000 });
234
+ (0, vitest_1.expect)(result.success).toBe(true);
235
+ (0, vitest_1.expect)(result.proof[0].tactic).toBe('modusPonens');
236
+ });
237
+ });
238
+ //# sourceMappingURL=search.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search.test.js","sourceRoot":"","sources":["../../../../src/tests/tooling/proof-guidance/search.test.ts"],"names":[],"mappings":";AAAA,+DAA+D;AAC/D,sDAAsD;AACtD,+DAA+D;;AAE/D,mCAA8C;AAC9C,oEAKyC;AAGzC;;;;;;;;;;GAUG;AACH,MAAM,SAAS,GAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;IAC/C,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;IAE/B,IAAI,MAAM,KAAK,YAAY,EAAE,CAAC;QAC5B,IAAI,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;YACpD,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,UAAU,EAAE,KAAK,CAAC,UAAU,EAAE,CAAC;QACpD,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,MAAM,KAAK,OAAO,EAAE,CAAC;QACvB,MAAM,CAAC,GAAG,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC1C,IAAI,CAAC,EAAE,CAAC;YACN,MAAM,CAAC,EAAE,UAAU,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC;YACrC,OAAO;gBACL,IAAI,EAAE,UAAU,CAAC,IAAI,EAAE;gBACvB,UAAU,EAAE,CAAC,GAAG,KAAK,CAAC,UAAU,EAAE,UAAU,CAAC,IAAI,EAAE,CAAC;aACrD,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,MAAM,KAAK,aAAa,EAAE,CAAC;QAC7B,sCAAsC;QACtC,KAAK,MAAM,C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AC,KAAK,EAAE,UAAU,EAAE,GAAG,CAAC,CAAC;QAC9C,CAAC;QAED,MAAM,OAAO,GAAe,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,CAAC,OAAO,EAAE,GAAG,CAAC,EAAE,CAAC;QACtE,MAAM,MAAM,GAAG,IAAA,6BAAY,EACzB,OAAO,EACP,SAAS,EACT,KAAK,EACL,CAAC,WAAW,EAAE,OAAO,EAAE,aAAa,EAAE,YAAY,CAAC,EACnD,EAAE,SAAS,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAC/C,CAAC;QACF,IAAA,eAAM,EAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAClC,IAAA,eAAM,EAAC,MAAM,CAAC,KAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=cubical.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cubical.test.d.ts","sourceRoot":"","sources":["../../../../src/tests/type-theory/cubical/cubical.test.ts"],"names":[],"mappings":""}