@stevenvo780/st-lang 4.5.2 → 4.6.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.
- package/dist/categorical/fin-set.d.ts +39 -0
- package/dist/categorical/fin-set.d.ts.map +1 -0
- package/dist/categorical/fin-set.js +217 -0
- package/dist/categorical/fin-set.js.map +1 -0
- package/dist/categorical/free.d.ts +23 -0
- package/dist/categorical/free.d.ts.map +1 -0
- package/dist/categorical/free.js +168 -0
- package/dist/categorical/free.js.map +1 -0
- package/dist/categorical/functor.d.ts +40 -0
- package/dist/categorical/functor.d.ts.map +1 -0
- package/dist/categorical/functor.js +139 -0
- package/dist/categorical/functor.js.map +1 -0
- package/dist/categorical/index.d.ts +11 -0
- package/dist/categorical/index.d.ts.map +1 -0
- package/dist/categorical/index.js +33 -0
- package/dist/categorical/index.js.map +1 -0
- package/dist/categorical/limits.d.ts +64 -0
- package/dist/categorical/limits.d.ts.map +1 -0
- package/dist/categorical/limits.js +248 -0
- package/dist/categorical/limits.js.map +1 -0
- package/dist/categorical/monoidal.d.ts +14 -0
- package/dist/categorical/monoidal.d.ts.map +1 -0
- package/dist/categorical/monoidal.js +148 -0
- package/dist/categorical/monoidal.js.map +1 -0
- package/dist/categorical/poset.d.ts +14 -0
- package/dist/categorical/poset.d.ts.map +1 -0
- package/dist/categorical/poset.js +115 -0
- package/dist/categorical/poset.js.map +1 -0
- package/dist/categorical/types.d.ts +111 -0
- package/dist/categorical/types.d.ts.map +1 -0
- package/dist/categorical/types.js +15 -0
- package/dist/categorical/types.js.map +1 -0
- package/dist/csp-hoare/analysis.d.ts +51 -0
- package/dist/csp-hoare/analysis.d.ts.map +1 -0
- package/dist/csp-hoare/analysis.js +317 -0
- package/dist/csp-hoare/analysis.js.map +1 -0
- package/dist/csp-hoare/examples.d.ts +33 -0
- package/dist/csp-hoare/examples.d.ts.map +1 -0
- package/dist/csp-hoare/examples.js +108 -0
- package/dist/csp-hoare/examples.js.map +1 -0
- package/dist/csp-hoare/index.d.ts +6 -0
- package/dist/csp-hoare/index.d.ts.map +1 -0
- package/dist/csp-hoare/index.js +50 -0
- package/dist/csp-hoare/index.js.map +1 -0
- package/dist/csp-hoare/semantics.d.ts +49 -0
- package/dist/csp-hoare/semantics.d.ts.map +1 -0
- package/dist/csp-hoare/semantics.js +494 -0
- package/dist/csp-hoare/semantics.js.map +1 -0
- package/dist/csp-hoare/types.d.ts +60 -0
- package/dist/csp-hoare/types.d.ts.map +1 -0
- package/dist/csp-hoare/types.js +31 -0
- package/dist/csp-hoare/types.js.map +1 -0
- package/dist/hindley-milner/index.d.ts +7 -0
- package/dist/hindley-milner/index.d.ts.map +1 -0
- package/dist/hindley-milner/index.js +60 -0
- package/dist/hindley-milner/index.js.map +1 -0
- package/dist/hindley-milner/infer.d.ts +26 -0
- package/dist/hindley-milner/infer.d.ts.map +1 -0
- package/dist/hindley-milner/infer.js +278 -0
- package/dist/hindley-milner/infer.js.map +1 -0
- package/dist/hindley-milner/substitution.d.ts +21 -0
- package/dist/hindley-milner/substitution.d.ts.map +1 -0
- package/dist/hindley-milner/substitution.js +215 -0
- package/dist/hindley-milner/substitution.js.map +1 -0
- package/dist/hindley-milner/types.d.ts +84 -0
- package/dist/hindley-milner/types.d.ts.map +1 -0
- package/dist/hindley-milner/types.js +166 -0
- package/dist/hindley-milner/types.js.map +1 -0
- package/dist/hott/equality.d.ts +4 -0
- package/dist/hott/equality.d.ts.map +1 -0
- package/dist/hott/equality.js +108 -0
- package/dist/hott/equality.js.map +1 -0
- package/dist/hott/index.d.ts +13 -0
- package/dist/hott/index.d.ts.map +1 -0
- package/dist/hott/index.js +77 -0
- package/dist/hott/index.js.map +1 -0
- package/dist/hott/infer.d.ts +11 -0
- package/dist/hott/infer.d.ts.map +1 -0
- package/dist/hott/infer.js +465 -0
- package/dist/hott/infer.js.map +1 -0
- package/dist/hott/normalize.d.ts +5 -0
- package/dist/hott/normalize.d.ts.map +1 -0
- package/dist/hott/normalize.js +240 -0
- package/dist/hott/normalize.js.map +1 -0
- package/dist/hott/path-algebra.d.ts +25 -0
- package/dist/hott/path-algebra.d.ts.map +1 -0
- package/dist/hott/path-algebra.js +67 -0
- package/dist/hott/path-algebra.js.map +1 -0
- package/dist/hott/substitute.d.ts +3 -0
- package/dist/hott/substitute.d.ts.map +1 -0
- package/dist/hott/substitute.js +131 -0
- package/dist/hott/substitute.js.map +1 -0
- package/dist/hott/types.d.ts +126 -0
- package/dist/hott/types.d.ts.map +1 -0
- package/dist/hott/types.js +346 -0
- package/dist/hott/types.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +48 -3
- package/dist/index.js.map +1 -1
- package/dist/lemma-synthesis/index.d.ts +124 -0
- package/dist/lemma-synthesis/index.d.ts.map +1 -0
- package/dist/lemma-synthesis/index.js +640 -0
- package/dist/lemma-synthesis/index.js.map +1 -0
- package/dist/tactic-dsl/combinators.d.ts +6 -0
- package/dist/tactic-dsl/combinators.d.ts.map +1 -0
- package/dist/tactic-dsl/combinators.js +98 -0
- package/dist/tactic-dsl/combinators.js.map +1 -0
- package/dist/tactic-dsl/index.d.ts +39 -0
- package/dist/tactic-dsl/index.d.ts.map +1 -0
- package/dist/tactic-dsl/index.js +162 -0
- package/dist/tactic-dsl/index.js.map +1 -0
- package/dist/tactic-dsl/tactics.d.ts +21 -0
- package/dist/tactic-dsl/tactics.d.ts.map +1 -0
- package/dist/tactic-dsl/tactics.js +536 -0
- package/dist/tactic-dsl/tactics.js.map +1 -0
- package/dist/tactic-dsl/types.d.ts +54 -0
- package/dist/tactic-dsl/types.d.ts.map +1 -0
- package/dist/tactic-dsl/types.js +226 -0
- package/dist/tactic-dsl/types.js.map +1 -0
- package/dist/tests/categorical/categorical.test.d.ts +2 -0
- package/dist/tests/categorical/categorical.test.d.ts.map +1 -0
- package/dist/tests/categorical/categorical.test.js +300 -0
- package/dist/tests/categorical/categorical.test.js.map +1 -0
- package/dist/tests/csp-hoare/csp-hoare.test.d.ts +2 -0
- package/dist/tests/csp-hoare/csp-hoare.test.d.ts.map +1 -0
- package/dist/tests/csp-hoare/csp-hoare.test.js +313 -0
- package/dist/tests/csp-hoare/csp-hoare.test.js.map +1 -0
- package/dist/tests/hindley-milner/hindley-milner.test.d.ts +2 -0
- package/dist/tests/hindley-milner/hindley-milner.test.d.ts.map +1 -0
- package/dist/tests/hindley-milner/hindley-milner.test.js +327 -0
- package/dist/tests/hindley-milner/hindley-milner.test.js.map +1 -0
- package/dist/tests/hott/hott.test.d.ts +2 -0
- package/dist/tests/hott/hott.test.d.ts.map +1 -0
- package/dist/tests/hott/hott.test.js +271 -0
- package/dist/tests/hott/hott.test.js.map +1 -0
- package/dist/tests/lemma-synthesis/lemma-synthesis.test.d.ts +2 -0
- package/dist/tests/lemma-synthesis/lemma-synthesis.test.d.ts.map +1 -0
- package/dist/tests/lemma-synthesis/lemma-synthesis.test.js +460 -0
- package/dist/tests/lemma-synthesis/lemma-synthesis.test.js.map +1 -0
- package/dist/tests/tactic-dsl/tactic-dsl.test.d.ts +2 -0
- package/dist/tests/tactic-dsl/tactic-dsl.test.d.ts.map +1 -0
- package/dist/tests/tactic-dsl/tactic-dsl.test.js +259 -0
- package/dist/tests/tactic-dsl/tactic-dsl.test.js.map +1 -0
- package/dist/tests/tptp/bridge.test.d.ts +2 -0
- package/dist/tests/tptp/bridge.test.d.ts.map +1 -0
- package/dist/tests/tptp/bridge.test.js +154 -0
- package/dist/tests/tptp/bridge.test.js.map +1 -0
- package/dist/tests/tptp/emitter.test.d.ts +2 -0
- package/dist/tests/tptp/emitter.test.d.ts.map +1 -0
- package/dist/tests/tptp/emitter.test.js +128 -0
- package/dist/tests/tptp/emitter.test.js.map +1 -0
- package/dist/tests/tptp/parser.test.d.ts +2 -0
- package/dist/tests/tptp/parser.test.d.ts.map +1 -0
- package/dist/tests/tptp/parser.test.js +192 -0
- package/dist/tests/tptp/parser.test.js.map +1 -0
- package/dist/tests/tptp/tokenizer.test.d.ts +2 -0
- package/dist/tests/tptp/tokenizer.test.d.ts.map +1 -0
- package/dist/tests/tptp/tokenizer.test.js +60 -0
- package/dist/tests/tptp/tokenizer.test.js.map +1 -0
- package/dist/tptp/ast.d.ts +73 -0
- package/dist/tptp/ast.d.ts.map +1 -0
- package/dist/tptp/ast.js +35 -0
- package/dist/tptp/ast.js.map +1 -0
- package/dist/tptp/bridge.d.ts +14 -0
- package/dist/tptp/bridge.d.ts.map +1 -0
- package/dist/tptp/bridge.js +146 -0
- package/dist/tptp/bridge.js.map +1 -0
- package/dist/tptp/emitter.d.ts +5 -0
- package/dist/tptp/emitter.d.ts.map +1 -0
- package/dist/tptp/emitter.js +103 -0
- package/dist/tptp/emitter.js.map +1 -0
- package/dist/tptp/index.d.ts +7 -0
- package/dist/tptp/index.d.ts.map +1 -0
- package/dist/tptp/index.js +31 -0
- package/dist/tptp/index.js.map +1 -0
- package/dist/tptp/parser.d.ts +23 -0
- package/dist/tptp/parser.d.ts.map +1 -0
- package/dist/tptp/parser.js +440 -0
- package/dist/tptp/parser.js.map +1 -0
- package/dist/tptp/tokenizer.d.ts +14 -0
- package/dist/tptp/tokenizer.d.ts.map +1 -0
- package/dist/tptp/tokenizer.js +264 -0
- package/dist/tptp/tokenizer.js.map +1 -0
- package/package.json +4 -1
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Tactic } from './types';
|
|
2
|
+
export declare function seq(...tactics: Tactic[]): Tactic;
|
|
3
|
+
export declare function orElse(...tactics: Tactic[]): Tactic;
|
|
4
|
+
export declare function repeat_(t: Tactic, max?: number): Tactic;
|
|
5
|
+
export declare function tryAlt(t: Tactic): Tactic;
|
|
6
|
+
//# sourceMappingURL=combinators.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"combinators.d.ts","sourceRoot":"","sources":["../../src/tactic-dsl/combinators.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAc,MAAM,EAAE,MAAM,SAAS,CAAC;AAMlD,wBAAgB,GAAG,CAAC,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,CAQhD;AAMD,wBAAgB,MAAM,CAAC,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,CAmBnD;AAOD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,SAAM,GAAG,MAAM,CAqBpD;AAMD,wBAAgB,MAAM,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAQxC"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// ============================================================
|
|
3
|
+
// Tactic DSL — combinators
|
|
4
|
+
// ============================================================
|
|
5
|
+
//
|
|
6
|
+
// seq / orElse / repeat_ / tryAlt: combinadores estándar al estilo
|
|
7
|
+
// Coq/Ltac. Operan sobre Tactic = (state) => state, lanzando
|
|
8
|
+
// TacticError para señalizar falla.
|
|
9
|
+
//
|
|
10
|
+
// Nota sobre el nombre `seq`: la API conceptual de Lean/Coq usa el
|
|
11
|
+
// nombre `then` o `;`. NO podemos exportar un símbolo top-level
|
|
12
|
+
// llamado `then` desde un módulo ESM porque el bundler de vitest
|
|
13
|
+
// trata al namespace del módulo como un thenable y cuelga el import.
|
|
14
|
+
// Por compatibilidad con la documentación del DSL, el index re-expone
|
|
15
|
+
// `seq` también bajo el alias `then` vía objeto namespace (ver
|
|
16
|
+
// `tactics` exportado desde index.ts).
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.seq = seq;
|
|
19
|
+
exports.orElse = orElse;
|
|
20
|
+
exports.repeat_ = repeat_;
|
|
21
|
+
exports.tryAlt = tryAlt;
|
|
22
|
+
const types_1 = require("./types");
|
|
23
|
+
// ---------- seq ----------
|
|
24
|
+
// Aplica los tactics en secuencia. Si alguno falla, propaga el error
|
|
25
|
+
// (estado intermedio descartado). Equivalente a `then` en Coq.
|
|
26
|
+
function seq(...tactics) {
|
|
27
|
+
return (state) => {
|
|
28
|
+
let cur = state;
|
|
29
|
+
for (const t of tactics) {
|
|
30
|
+
cur = t(cur);
|
|
31
|
+
}
|
|
32
|
+
return cur;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
// ---------- orElse ----------
|
|
36
|
+
// Devuelve el resultado del primer tactic que no lanza. Si todos
|
|
37
|
+
// fallan, lanza TacticError con el último mensaje.
|
|
38
|
+
function orElse(...tactics) {
|
|
39
|
+
return (state) => {
|
|
40
|
+
let lastErr = null;
|
|
41
|
+
for (const t of tactics) {
|
|
42
|
+
try {
|
|
43
|
+
return t(state);
|
|
44
|
+
}
|
|
45
|
+
catch (e) {
|
|
46
|
+
if (e instanceof Error) {
|
|
47
|
+
lastErr = e;
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
throw e;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
throw new types_1.TacticError('orElse', `todas las alternativas fallaron${lastErr ? `: ${lastErr.message}` : ''}`);
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
// ---------- repeat_ ----------
|
|
57
|
+
// Aplica `t` mientras pueda. Detiene cuando lanza o cuando alcanza
|
|
58
|
+
// `max` iteraciones (default 100). Nunca falla: si t no aplica ni
|
|
59
|
+
// una vez, devuelve el estado original.
|
|
60
|
+
function repeat_(t, max = 100) {
|
|
61
|
+
return (state) => {
|
|
62
|
+
let cur = state;
|
|
63
|
+
let i = 0;
|
|
64
|
+
while (i < max) {
|
|
65
|
+
let next;
|
|
66
|
+
try {
|
|
67
|
+
next = t(cur);
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
return cur;
|
|
71
|
+
}
|
|
72
|
+
// Guard contra punto fijo: si el estado no cambia (mismas goals + history),
|
|
73
|
+
// paramos para evitar bucles tipo `repeat_(trivial())` cuando el goal ya
|
|
74
|
+
// está cerrado.
|
|
75
|
+
if (next === cur)
|
|
76
|
+
return cur;
|
|
77
|
+
if (next.done)
|
|
78
|
+
return next;
|
|
79
|
+
cur = next;
|
|
80
|
+
i++;
|
|
81
|
+
}
|
|
82
|
+
return cur;
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
// ---------- tryAlt ----------
|
|
86
|
+
// Aplica `t` ignorando la falla. Util para "intenta esto, sigue
|
|
87
|
+
// adelante si no aplica". Nombre `tryAlt` por colisión con keyword.
|
|
88
|
+
function tryAlt(t) {
|
|
89
|
+
return (state) => {
|
|
90
|
+
try {
|
|
91
|
+
return t(state);
|
|
92
|
+
}
|
|
93
|
+
catch {
|
|
94
|
+
return state;
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=combinators.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"combinators.js","sourceRoot":"","sources":["../../src/tactic-dsl/combinators.ts"],"names":[],"mappings":";AAAA,+DAA+D;AAC/D,2BAA2B;AAC3B,+DAA+D;AAC/D,EAAE;AACF,mEAAmE;AACnE,6DAA6D;AAC7D,oCAAoC;AACpC,EAAE;AACF,mEAAmE;AACnE,gEAAgE;AAChE,iEAAiE;AACjE,qEAAqE;AACrE,sEAAsE;AACtE,+DAA+D;AAC/D,uCAAuC;;AASvC,kBAQC;AAMD,wBAmBC;AAOD,0BAqBC;AAMD,wBAQC;AAlFD,mCAAsC;AAGtC,4BAA4B;AAC5B,qEAAqE;AACrE,+DAA+D;AAE/D,SAAgB,GAAG,CAAC,GAAG,OAAiB;IACtC,OAAO,CAAC,KAAK,EAAE,EAAE;QACf,IAAI,GAAG,GAAG,KAAK,CAAC;QAChB,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;YACxB,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;QACf,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC,CAAC;AACJ,CAAC;AAED,+BAA+B;AAC/B,iEAAiE;AACjE,mDAAmD;AAEnD,SAAgB,MAAM,CAAC,GAAG,OAAiB;IACzC,OAAO,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B;AAC/B,gEAAgE;AAChE,oEAAoE;AAEpE,SAAgB,MAAM,CAAC,CAAS;IAC9B,OAAO,CAAC,KAAK,EAAE,EAAE;QACf,IAAI,CAAC;YACH,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC;QAClB,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { ProofState, Tactic } from './types';
|
|
2
|
+
import { apply, assumption, caseAnalysis, destruct, exact, induction, intro, left as leftTactic, rewrite, rfl, right as rightTactic, simp, split, trivial, unfold } from './tactics';
|
|
3
|
+
import { orElse, repeat_, seq, tryAlt } from './combinators';
|
|
4
|
+
export type { Formula, Goal, ProofState, Tactic, TacticInvocation } from './types';
|
|
5
|
+
export { TacticError, parseFormula, formulaToString, formulaEq, normalizeFormula } from './types';
|
|
6
|
+
export type { DefDictionary } from './tactics';
|
|
7
|
+
export { intro, exact, assumption, apply, rewrite, rfl, trivial, split, destruct, induction, caseAnalysis, unfold, simp, };
|
|
8
|
+
export { leftTactic as left, rightTactic as right };
|
|
9
|
+
export declare const case_: typeof caseAnalysis;
|
|
10
|
+
export { seq, orElse, repeat_, tryAlt };
|
|
11
|
+
export declare const T: {
|
|
12
|
+
intro: typeof intro;
|
|
13
|
+
exact: typeof exact;
|
|
14
|
+
assumption: typeof assumption;
|
|
15
|
+
apply: typeof apply;
|
|
16
|
+
rewrite: typeof rewrite;
|
|
17
|
+
rfl: typeof rfl;
|
|
18
|
+
trivial: typeof trivial;
|
|
19
|
+
split: typeof split;
|
|
20
|
+
left: typeof leftTactic;
|
|
21
|
+
right: typeof rightTactic;
|
|
22
|
+
destruct: typeof destruct;
|
|
23
|
+
induction: typeof induction;
|
|
24
|
+
caseAnalysis: typeof caseAnalysis;
|
|
25
|
+
case_: typeof caseAnalysis;
|
|
26
|
+
unfold: typeof unfold;
|
|
27
|
+
simp: typeof simp;
|
|
28
|
+
seq: typeof seq;
|
|
29
|
+
then: typeof seq;
|
|
30
|
+
orElse: typeof orElse;
|
|
31
|
+
repeat_: typeof repeat_;
|
|
32
|
+
tryAlt: typeof tryAlt;
|
|
33
|
+
};
|
|
34
|
+
export declare function startProof(goal: string, hyps?: Record<string, string>): ProofState;
|
|
35
|
+
export declare function runTactic(state: ProofState, t: Tactic): ProofState;
|
|
36
|
+
export declare function isProven(state: ProofState): boolean;
|
|
37
|
+
export declare function summary(state: ProofState): string;
|
|
38
|
+
export declare function _resetCounters(): void;
|
|
39
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tactic-dsl/index.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAQ,UAAU,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACxD,OAAO,EAEL,KAAK,EACL,UAAU,EACV,YAAY,EACZ,QAAQ,EACR,KAAK,EACL,SAAS,EACT,KAAK,EACL,IAAI,IAAI,UAAU,EAClB,OAAO,EACP,GAAG,EACH,KAAK,IAAI,WAAW,EACpB,IAAI,EACJ,KAAK,EACL,OAAO,EACP,MAAM,EACP,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE7D,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AACnF,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,eAAe,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAClG,YAAY,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAG/C,OAAO,EACL,KAAK,EACL,KAAK,EACL,UAAU,EACV,KAAK,EACL,OAAO,EACP,GAAG,EACH,OAAO,EACP,KAAK,EACL,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,MAAM,EACN,IAAI,GACL,CAAC;AACF,OAAO,EAAE,UAAU,IAAI,IAAI,EAAE,WAAW,IAAI,KAAK,EAAE,CAAC;AAGpD,eAAO,MAAM,KAAK,qBAAe,CAAC;AAIlC,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;AAKxC,eAAO,MAAM,CAAC;;;;;;;;;;;;;;;;;;;;;;CAwBb,CAAC;AAIF,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,GAAG,UAAU,CAkBtF;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,UAAU,EAAE,CAAC,EAAE,MAAM,GAAG,UAAU,CAElE;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAEnD;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAcjD;AA6BD,wBAAgB,cAAc,IAAI,IAAI,CAGrC"}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// ============================================================
|
|
3
|
+
// Tactic DSL — entry point
|
|
4
|
+
// ============================================================
|
|
5
|
+
//
|
|
6
|
+
// Pequeño DSL al estilo Lean/Coq para construir pruebas hacia atrás
|
|
7
|
+
// (backwards) a partir de un goal. El motor:
|
|
8
|
+
// - mantiene una lista de goals abiertos
|
|
9
|
+
// - cada tactic transforma el goal frontal
|
|
10
|
+
// - los combinators (seq/orElse/repeat_/tryAlt) componen tactics
|
|
11
|
+
//
|
|
12
|
+
// La meta-prueba se considera completa cuando no quedan goals.
|
|
13
|
+
// El estado lleva un `history` que registra invocaciones para que
|
|
14
|
+
// el caller pueda renderizar el proof script reproducible.
|
|
15
|
+
//
|
|
16
|
+
// Nombres: la API original (Coq/Lean) usa `then` para encadenar
|
|
17
|
+
// tactics. Por interop con vitest/ESM (un módulo ES con export
|
|
18
|
+
// `then` se trata como thenable y bloquea el import), el combinador
|
|
19
|
+
// se llama `seq` a nivel de export. Para mantener el lenguaje
|
|
20
|
+
// Coq-like, exportamos un namespace `T` con `T.then = seq`.
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.T = exports.tryAlt = exports.repeat_ = exports.orElse = exports.seq = exports.case_ = exports.right = exports.left = exports.simp = exports.unfold = exports.caseAnalysis = exports.induction = exports.destruct = exports.split = exports.trivial = exports.rfl = exports.rewrite = exports.apply = exports.assumption = exports.exact = exports.intro = exports.normalizeFormula = exports.formulaEq = exports.formulaToString = exports.parseFormula = exports.TacticError = void 0;
|
|
23
|
+
exports.startProof = startProof;
|
|
24
|
+
exports.runTactic = runTactic;
|
|
25
|
+
exports.isProven = isProven;
|
|
26
|
+
exports.summary = summary;
|
|
27
|
+
exports._resetCounters = _resetCounters;
|
|
28
|
+
const types_1 = require("./types");
|
|
29
|
+
const tactics_1 = require("./tactics");
|
|
30
|
+
Object.defineProperty(exports, "apply", { enumerable: true, get: function () { return tactics_1.apply; } });
|
|
31
|
+
Object.defineProperty(exports, "assumption", { enumerable: true, get: function () { return tactics_1.assumption; } });
|
|
32
|
+
Object.defineProperty(exports, "caseAnalysis", { enumerable: true, get: function () { return tactics_1.caseAnalysis; } });
|
|
33
|
+
Object.defineProperty(exports, "destruct", { enumerable: true, get: function () { return tactics_1.destruct; } });
|
|
34
|
+
Object.defineProperty(exports, "exact", { enumerable: true, get: function () { return tactics_1.exact; } });
|
|
35
|
+
Object.defineProperty(exports, "induction", { enumerable: true, get: function () { return tactics_1.induction; } });
|
|
36
|
+
Object.defineProperty(exports, "intro", { enumerable: true, get: function () { return tactics_1.intro; } });
|
|
37
|
+
Object.defineProperty(exports, "left", { enumerable: true, get: function () { return tactics_1.left; } });
|
|
38
|
+
Object.defineProperty(exports, "rewrite", { enumerable: true, get: function () { return tactics_1.rewrite; } });
|
|
39
|
+
Object.defineProperty(exports, "rfl", { enumerable: true, get: function () { return tactics_1.rfl; } });
|
|
40
|
+
Object.defineProperty(exports, "right", { enumerable: true, get: function () { return tactics_1.right; } });
|
|
41
|
+
Object.defineProperty(exports, "simp", { enumerable: true, get: function () { return tactics_1.simp; } });
|
|
42
|
+
Object.defineProperty(exports, "split", { enumerable: true, get: function () { return tactics_1.split; } });
|
|
43
|
+
Object.defineProperty(exports, "trivial", { enumerable: true, get: function () { return tactics_1.trivial; } });
|
|
44
|
+
Object.defineProperty(exports, "unfold", { enumerable: true, get: function () { return tactics_1.unfold; } });
|
|
45
|
+
const combinators_1 = require("./combinators");
|
|
46
|
+
Object.defineProperty(exports, "orElse", { enumerable: true, get: function () { return combinators_1.orElse; } });
|
|
47
|
+
Object.defineProperty(exports, "repeat_", { enumerable: true, get: function () { return combinators_1.repeat_; } });
|
|
48
|
+
Object.defineProperty(exports, "seq", { enumerable: true, get: function () { return combinators_1.seq; } });
|
|
49
|
+
Object.defineProperty(exports, "tryAlt", { enumerable: true, get: function () { return combinators_1.tryAlt; } });
|
|
50
|
+
var types_2 = require("./types");
|
|
51
|
+
Object.defineProperty(exports, "TacticError", { enumerable: true, get: function () { return types_2.TacticError; } });
|
|
52
|
+
Object.defineProperty(exports, "parseFormula", { enumerable: true, get: function () { return types_2.parseFormula; } });
|
|
53
|
+
Object.defineProperty(exports, "formulaToString", { enumerable: true, get: function () { return types_2.formulaToString; } });
|
|
54
|
+
Object.defineProperty(exports, "formulaEq", { enumerable: true, get: function () { return types_2.formulaEq; } });
|
|
55
|
+
Object.defineProperty(exports, "normalizeFormula", { enumerable: true, get: function () { return types_2.normalizeFormula; } });
|
|
56
|
+
// Alias `case_` para `caseAnalysis` (case es palabra reservada en JS).
|
|
57
|
+
exports.case_ = tactics_1.caseAnalysis;
|
|
58
|
+
// Namespace `T` con todos los tactics y combinators. Aquí sí podemos
|
|
59
|
+
// exponer `then` porque la propiedad vive sobre un objeto, no sobre
|
|
60
|
+
// el module namespace.
|
|
61
|
+
exports.T = {
|
|
62
|
+
// tactics
|
|
63
|
+
intro: tactics_1.intro,
|
|
64
|
+
exact: tactics_1.exact,
|
|
65
|
+
assumption: tactics_1.assumption,
|
|
66
|
+
apply: tactics_1.apply,
|
|
67
|
+
rewrite: tactics_1.rewrite,
|
|
68
|
+
rfl: tactics_1.rfl,
|
|
69
|
+
trivial: tactics_1.trivial,
|
|
70
|
+
split: tactics_1.split,
|
|
71
|
+
left: tactics_1.left,
|
|
72
|
+
right: tactics_1.right,
|
|
73
|
+
destruct: tactics_1.destruct,
|
|
74
|
+
induction: tactics_1.induction,
|
|
75
|
+
caseAnalysis: tactics_1.caseAnalysis,
|
|
76
|
+
case_: tactics_1.caseAnalysis,
|
|
77
|
+
unfold: tactics_1.unfold,
|
|
78
|
+
simp: tactics_1.simp,
|
|
79
|
+
// combinators
|
|
80
|
+
seq: combinators_1.seq,
|
|
81
|
+
then: combinators_1.seq, // alias Coq-style
|
|
82
|
+
orElse: // alias Coq-style
|
|
83
|
+
combinators_1.orElse,
|
|
84
|
+
repeat_: combinators_1.repeat_,
|
|
85
|
+
tryAlt: combinators_1.tryAlt,
|
|
86
|
+
};
|
|
87
|
+
let stateCounter = 0;
|
|
88
|
+
function startProof(goal, hyps = {}) {
|
|
89
|
+
// sanity: el goal debe parsearse limpio.
|
|
90
|
+
(0, types_1.parseFormula)(goal);
|
|
91
|
+
stateCounter++;
|
|
92
|
+
const normalizedHyps = {};
|
|
93
|
+
for (const [n, t] of Object.entries(hyps)) {
|
|
94
|
+
normalizedHyps[n] = (0, types_1.normalizeFormula)(t);
|
|
95
|
+
}
|
|
96
|
+
const g = {
|
|
97
|
+
id: `g${stateCounter}`,
|
|
98
|
+
hyps: normalizedHyps,
|
|
99
|
+
concl: (0, types_1.normalizeFormula)(goal),
|
|
100
|
+
};
|
|
101
|
+
return {
|
|
102
|
+
goals: [g],
|
|
103
|
+
history: [],
|
|
104
|
+
done: false,
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
function runTactic(state, t) {
|
|
108
|
+
return t(state);
|
|
109
|
+
}
|
|
110
|
+
function isProven(state) {
|
|
111
|
+
return state.done && state.goals.length === 0;
|
|
112
|
+
}
|
|
113
|
+
function summary(state) {
|
|
114
|
+
if (state.done && state.goals.length === 0) {
|
|
115
|
+
const steps = state.history.map((h) => ` - ${h.tactic}(${formatArgs(h.args)})`);
|
|
116
|
+
return `Proof complete.\nHistory (${state.history.length} steps):\n${steps.join('\n')}`;
|
|
117
|
+
}
|
|
118
|
+
const open = state.goals
|
|
119
|
+
.map((g, idx) => {
|
|
120
|
+
const hyps = Object.entries(g.hyps)
|
|
121
|
+
.map(([n, t]) => ` ${n} : ${t}`)
|
|
122
|
+
.join('\n');
|
|
123
|
+
return `Goal ${idx + 1}/${state.goals.length} (${g.id}):\n${hyps}\n ⊢ ${g.concl}`;
|
|
124
|
+
})
|
|
125
|
+
.join('\n\n');
|
|
126
|
+
return open;
|
|
127
|
+
}
|
|
128
|
+
function formatArgs(args) {
|
|
129
|
+
return args
|
|
130
|
+
.map((a) => {
|
|
131
|
+
if (a === null || a === undefined)
|
|
132
|
+
return '';
|
|
133
|
+
if (Array.isArray(a)) {
|
|
134
|
+
const items = a;
|
|
135
|
+
return `[${items.map((x) => formatScalar(x)).join(',')}]`;
|
|
136
|
+
}
|
|
137
|
+
return formatScalar(a);
|
|
138
|
+
})
|
|
139
|
+
.filter((s) => s.length > 0)
|
|
140
|
+
.join(', ');
|
|
141
|
+
}
|
|
142
|
+
function formatScalar(x) {
|
|
143
|
+
if (typeof x === 'string')
|
|
144
|
+
return x;
|
|
145
|
+
if (typeof x === 'number' || typeof x === 'boolean')
|
|
146
|
+
return String(x);
|
|
147
|
+
if (x === null || x === undefined)
|
|
148
|
+
return '';
|
|
149
|
+
// fallback seguro para evitar [object Object]
|
|
150
|
+
try {
|
|
151
|
+
return JSON.stringify(x);
|
|
152
|
+
}
|
|
153
|
+
catch {
|
|
154
|
+
return '';
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
// Test-only helper para resetear contadores y obtener determinismo.
|
|
158
|
+
function _resetCounters() {
|
|
159
|
+
stateCounter = 0;
|
|
160
|
+
(0, tactics_1._resetGoalCounter)();
|
|
161
|
+
}
|
|
162
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tactic-dsl/index.ts"],"names":[],"mappings":";AAAA,+DAA+D;AAC/D,2BAA2B;AAC3B,+DAA+D;AAC/D,EAAE;AACF,oEAAoE;AACpE,6CAA6C;AAC7C,2CAA2C;AAC3C,6CAA6C;AAC7C,mEAAmE;AACnE,EAAE;AACF,+DAA+D;AAC/D,kEAAkE;AAClE,2DAA2D;AAC3D,EAAE;AACF,gEAAgE;AAChE,+DAA+D;AAC/D,oEAAoE;AACpE,8DAA8D;AAC9D,4DAA4D;;;AAoF5D,gCAkBC;AAED,8BAEC;AAED,4BAEC;AAED,0BAcC;AA6BD,wCAGC;AA5JD,mCAAyD;AAEzD,uCAiBmB;AAYjB,sFA3BA,eAAK,OA2BA;AADL,2FAzBA,oBAAU,OAyBA;AAQV,6FAhCA,sBAAY,OAgCA;AAFZ,yFA7BA,kBAAQ,OA6BA;AAPR,sFArBA,eAAK,OAqBA;AAQL,0FA5BA,mBAAS,OA4BA;AATT,sFAlBA,eAAK,OAkBA;AAcgB,qFA/Bb,cAAU,OA+BO;AAVzB,wFApBA,iBAAO,OAoBA;AACP,oFApBA,aAAG,OAoBA;AASuC,sFA5BjC,eAAW,OA4B2B;AAF/C,qFAzBA,cAAI,OAyBA;AALJ,sFAnBA,eAAK,OAmBA;AADL,wFAjBA,iBAAO,OAiBA;AAKP,uFArBA,gBAAM,OAqBA;AAnBR,+CAA6D;AA6B/C,uFA7BL,oBAAM,OA6BK;AAAE,wFA7BL,qBAAO,OA6BK;AAApB,oFA7BiB,iBAAG,OA6BjB;AAAmB,uFA7BA,oBAAM,OA6BA;AA1BrC,iCAAkG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C;IACZ,CAAC;AACH,CAAC;AAED,oEAAoE;AACpE,SAAgB,cAAc;IAC5B,YAAY,GAAG,CAAC,CAAC;IACjB,IAAA,2BAAiB,GAAE,CAAC;AACtB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Tactic } from './types';
|
|
2
|
+
export declare function _resetGoalCounter(): void;
|
|
3
|
+
export declare function intro(name?: string): Tactic;
|
|
4
|
+
export declare function exact(term: string): Tactic;
|
|
5
|
+
export declare function assumption(): Tactic;
|
|
6
|
+
export declare function apply(thm: string, args?: string[]): Tactic;
|
|
7
|
+
export declare function rewrite(eq: string, dir?: 'left-to-right' | 'right-to-left'): Tactic;
|
|
8
|
+
export declare function rfl(): Tactic;
|
|
9
|
+
export declare function trivial(): Tactic;
|
|
10
|
+
export declare function split(): Tactic;
|
|
11
|
+
export declare function left(): Tactic;
|
|
12
|
+
export declare function right(): Tactic;
|
|
13
|
+
export declare function destruct(name: string): Tactic;
|
|
14
|
+
export declare function induction(name: string): Tactic;
|
|
15
|
+
export declare function caseAnalysis(name: string): Tactic;
|
|
16
|
+
export interface DefDictionary {
|
|
17
|
+
[name: string]: string;
|
|
18
|
+
}
|
|
19
|
+
export declare function unfold(def: string, dict?: DefDictionary): Tactic;
|
|
20
|
+
export declare function simp(): Tactic;
|
|
21
|
+
//# sourceMappingURL=tactics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tactics.d.ts","sourceRoot":"","sources":["../../src/tactic-dsl/tactics.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAA6B,MAAM,EAAoB,MAAM,SAAS,CAAC;AASnF,wBAAgB,iBAAiB,IAAI,IAAI,CAExC;AAwCD,wBAAgB,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CA2B3C;AAaD,wBAAgB,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAiB1C;AAKD,wBAAgB,UAAU,IAAI,MAAM,CA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