@stevenvo780/st-lang 4.9.0 → 4.10.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/logic/profiles/natural-deduction-nk/formula.d.ts +18 -0
- package/dist/logic/profiles/natural-deduction-nk/formula.d.ts.map +1 -0
- package/dist/logic/profiles/natural-deduction-nk/formula.js +102 -0
- package/dist/logic/profiles/natural-deduction-nk/formula.js.map +1 -0
- package/dist/logic/profiles/natural-deduction-nk/index.d.ts +5 -0
- package/dist/logic/profiles/natural-deduction-nk/index.d.ts.map +1 -0
- package/dist/logic/profiles/natural-deduction-nk/index.js +28 -0
- package/dist/logic/profiles/natural-deduction-nk/index.js.map +1 -0
- package/dist/logic/profiles/natural-deduction-nk/prover.d.ts +49 -0
- package/dist/logic/profiles/natural-deduction-nk/prover.d.ts.map +1 -0
- package/dist/logic/profiles/natural-deduction-nk/prover.js +557 -0
- package/dist/logic/profiles/natural-deduction-nk/prover.js.map +1 -0
- package/dist/logic/profiles/natural-deduction-nk/types.d.ts +48 -0
- package/dist/logic/profiles/natural-deduction-nk/types.d.ts.map +1 -0
- package/dist/logic/profiles/natural-deduction-nk/types.js +35 -0
- package/dist/logic/profiles/natural-deduction-nk/types.js.map +1 -0
- package/dist/reasoning/automata/dfa.d.ts +17 -0
- package/dist/reasoning/automata/dfa.d.ts.map +1 -0
- package/dist/reasoning/automata/dfa.js +276 -0
- package/dist/reasoning/automata/dfa.js.map +1 -0
- package/dist/reasoning/automata/index.d.ts +8 -0
- package/dist/reasoning/automata/index.d.ts.map +1 -0
- package/dist/reasoning/automata/index.js +64 -0
- package/dist/reasoning/automata/index.js.map +1 -0
- package/dist/reasoning/automata/languages.d.ts +10 -0
- package/dist/reasoning/automata/languages.d.ts.map +1 -0
- package/dist/reasoning/automata/languages.js +78 -0
- package/dist/reasoning/automata/languages.js.map +1 -0
- package/dist/reasoning/automata/nfa.d.ts +8 -0
- package/dist/reasoning/automata/nfa.d.ts.map +1 -0
- package/dist/reasoning/automata/nfa.js +122 -0
- package/dist/reasoning/automata/nfa.js.map +1 -0
- package/dist/reasoning/automata/pda.d.ts +10 -0
- package/dist/reasoning/automata/pda.d.ts.map +1 -0
- package/dist/reasoning/automata/pda.js +169 -0
- package/dist/reasoning/automata/pda.js.map +1 -0
- package/dist/reasoning/automata/regex.d.ts +6 -0
- package/dist/reasoning/automata/regex.d.ts.map +1 -0
- package/dist/reasoning/automata/regex.js +259 -0
- package/dist/reasoning/automata/regex.js.map +1 -0
- package/dist/reasoning/automata/types.d.ts +69 -0
- package/dist/reasoning/automata/types.d.ts.map +1 -0
- package/dist/reasoning/automata/types.js +29 -0
- package/dist/reasoning/automata/types.js.map +1 -0
- package/dist/reasoning/computability/index.d.ts +239 -0
- package/dist/reasoning/computability/index.d.ts.map +1 -0
- package/dist/reasoning/computability/index.js +851 -0
- package/dist/reasoning/computability/index.js.map +1 -0
- package/dist/reasoning/number-theory/crt.d.ts +9 -0
- package/dist/reasoning/number-theory/crt.d.ts.map +1 -0
- package/dist/reasoning/number-theory/crt.js +39 -0
- package/dist/reasoning/number-theory/crt.js.map +1 -0
- package/dist/reasoning/number-theory/diophantine.d.ts +10 -0
- package/dist/reasoning/number-theory/diophantine.d.ts.map +1 -0
- package/dist/reasoning/number-theory/diophantine.js +87 -0
- package/dist/reasoning/number-theory/diophantine.js.map +1 -0
- package/dist/reasoning/number-theory/factorization.d.ts +12 -0
- package/dist/reasoning/number-theory/factorization.d.ts.map +1 -0
- package/dist/reasoning/number-theory/factorization.js +136 -0
- package/dist/reasoning/number-theory/factorization.js.map +1 -0
- package/dist/reasoning/number-theory/gcd.d.ts +8 -0
- package/dist/reasoning/number-theory/gcd.d.ts.map +1 -0
- package/dist/reasoning/number-theory/gcd.js +51 -0
- package/dist/reasoning/number-theory/gcd.js.map +1 -0
- package/dist/reasoning/number-theory/index.d.ts +9 -0
- package/dist/reasoning/number-theory/index.d.ts.map +1 -0
- package/dist/reasoning/number-theory/index.js +46 -0
- package/dist/reasoning/number-theory/index.js.map +1 -0
- package/dist/reasoning/number-theory/modular.d.ts +6 -0
- package/dist/reasoning/number-theory/modular.d.ts.map +1 -0
- package/dist/reasoning/number-theory/modular.js +75 -0
- package/dist/reasoning/number-theory/modular.js.map +1 -0
- package/dist/reasoning/number-theory/primality.d.ts +6 -0
- package/dist/reasoning/number-theory/primality.d.ts.map +1 -0
- package/dist/reasoning/number-theory/primality.js +144 -0
- package/dist/reasoning/number-theory/primality.js.map +1 -0
- package/dist/reasoning/number-theory/symbols.d.ts +3 -0
- package/dist/reasoning/number-theory/symbols.d.ts.map +1 -0
- package/dist/reasoning/number-theory/symbols.js +57 -0
- package/dist/reasoning/number-theory/symbols.js.map +1 -0
- package/dist/reasoning/real-analysis/index.d.ts +127 -0
- package/dist/reasoning/real-analysis/index.d.ts.map +1 -0
- package/dist/reasoning/real-analysis/index.js +638 -0
- package/dist/reasoning/real-analysis/index.js.map +1 -0
- package/dist/reasoning/topology/index.d.ts +41 -0
- package/dist/reasoning/topology/index.d.ts.map +1 -0
- package/dist/reasoning/topology/index.js +739 -0
- package/dist/reasoning/topology/index.js.map +1 -0
- package/dist/tests/logic/profiles/natural-deduction-nk/nk.test.d.ts +2 -0
- package/dist/tests/logic/profiles/natural-deduction-nk/nk.test.d.ts.map +1 -0
- package/dist/tests/logic/profiles/natural-deduction-nk/nk.test.js +288 -0
- package/dist/tests/logic/profiles/natural-deduction-nk/nk.test.js.map +1 -0
- package/dist/tests/reasoning/automata/automata.test.d.ts +2 -0
- package/dist/tests/reasoning/automata/automata.test.d.ts.map +1 -0
- package/dist/tests/reasoning/automata/automata.test.js +310 -0
- package/dist/tests/reasoning/automata/automata.test.js.map +1 -0
- package/dist/tests/reasoning/computability/computability.test.d.ts +2 -0
- package/dist/tests/reasoning/computability/computability.test.d.ts.map +1 -0
- package/dist/tests/reasoning/computability/computability.test.js +246 -0
- package/dist/tests/reasoning/computability/computability.test.js.map +1 -0
- package/dist/tests/reasoning/number-theory/number-theory.test.d.ts +2 -0
- package/dist/tests/reasoning/number-theory/number-theory.test.d.ts.map +1 -0
- package/dist/tests/reasoning/number-theory/number-theory.test.js +170 -0
- package/dist/tests/reasoning/number-theory/number-theory.test.js.map +1 -0
- package/dist/tests/reasoning/real-analysis/real-analysis.test.d.ts +2 -0
- package/dist/tests/reasoning/real-analysis/real-analysis.test.d.ts.map +1 -0
- package/dist/tests/reasoning/real-analysis/real-analysis.test.js +197 -0
- package/dist/tests/reasoning/real-analysis/real-analysis.test.js.map +1 -0
- package/dist/tests/reasoning/topology/topology.test.d.ts +2 -0
- package/dist/tests/reasoning/topology/topology.test.d.ts.map +1 -0
- package/dist/tests/reasoning/topology/topology.test.js +327 -0
- package/dist/tests/reasoning/topology/topology.test.js.map +1 -0
- package/dist/tests/tooling/exporters/lean4/lean4-exporter.test.d.ts +2 -0
- package/dist/tests/tooling/exporters/lean4/lean4-exporter.test.d.ts.map +1 -0
- package/dist/tests/tooling/exporters/lean4/lean4-exporter.test.js +473 -0
- package/dist/tests/tooling/exporters/lean4/lean4-exporter.test.js.map +1 -0
- package/dist/tooling/exporters/lean4/index.d.ts +47 -0
- package/dist/tooling/exporters/lean4/index.d.ts.map +1 -0
- package/dist/tooling/exporters/lean4/index.js +423 -0
- package/dist/tooling/exporters/lean4/index.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { NKFormula } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Clave sintáctica estable para deduplicación / memoización.
|
|
4
|
+
*/
|
|
5
|
+
export declare function formulaKey(f: NKFormula): string;
|
|
6
|
+
export declare function formulaEquals(a: NKFormula, b: NKFormula): boolean;
|
|
7
|
+
export declare function formulaToString(f: NKFormula): string;
|
|
8
|
+
/**
|
|
9
|
+
* Recolecta los átomos proposicionales que aparecen en `f`.
|
|
10
|
+
*/
|
|
11
|
+
export declare function collectAtoms(f: NKFormula, out?: Set<string>): Set<string>;
|
|
12
|
+
export declare const atom: (name: string) => NKFormula;
|
|
13
|
+
export declare const bottom: () => NKFormula;
|
|
14
|
+
export declare const not: (arg: NKFormula) => NKFormula;
|
|
15
|
+
export declare const and: (left: NKFormula, right: NKFormula) => NKFormula;
|
|
16
|
+
export declare const or: (left: NKFormula, right: NKFormula) => NKFormula;
|
|
17
|
+
export declare const implies: (left: NKFormula, right: NKFormula) => NKFormula;
|
|
18
|
+
//# sourceMappingURL=formula.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formula.d.ts","sourceRoot":"","sources":["../../../../src/logic/profiles/natural-deduction-nk/formula.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC;;GAEG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,SAAS,GAAG,MAAM,CAe/C;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,GAAG,OAAO,CAEjE;AAED,wBAAgB,eAAe,CAAC,CAAC,EAAE,SAAS,GAAG,MAAM,CAepD;AAOD;;GAEG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,SAAS,EAAE,GAAG,GAAE,GAAG,CAAC,MAAM,CAAa,GAAG,GAAG,CAAC,MAAM,CAAC,CAepF;AAID,eAAO,MAAM,IAAI,GAAI,MAAM,MAAM,KAAG,SAAqC,CAAC;AAC1E,eAAO,MAAM,MAAM,QAAO,SAAiC,CAAC;AAC5D,eAAO,MAAM,GAAG,GAAI,KAAK,SAAS,KAAG,SAAmC,CAAC;AACzE,eAAO,MAAM,GAAG,GAAI,MAAM,SAAS,EAAE,OAAO,SAAS,KAAG,SAItD,CAAC;AACH,eAAO,MAAM,EAAE,GAAI,MAAM,SAAS,EAAE,OAAO,SAAS,KAAG,SAIrD,CAAC;AACH,eAAO,MAAM,OAAO,GAAI,MAAM,SAAS,EAAE,OAAO,SAAS,KAAG,SAI1D,CAAC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// ============================================================
|
|
3
|
+
// Helpers de fórmulas clásicas (NK)
|
|
4
|
+
// ============================================================
|
|
5
|
+
//
|
|
6
|
+
// Estructuralmente idéntico al de NJ; la diferencia con la
|
|
7
|
+
// lógica intuicionista no está en la sintaxis sino en las reglas
|
|
8
|
+
// admisibles.
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.implies = exports.or = exports.and = exports.not = exports.bottom = exports.atom = void 0;
|
|
11
|
+
exports.formulaKey = formulaKey;
|
|
12
|
+
exports.formulaEquals = formulaEquals;
|
|
13
|
+
exports.formulaToString = formulaToString;
|
|
14
|
+
exports.collectAtoms = collectAtoms;
|
|
15
|
+
/**
|
|
16
|
+
* Clave sintáctica estable para deduplicación / memoización.
|
|
17
|
+
*/
|
|
18
|
+
function formulaKey(f) {
|
|
19
|
+
switch (f.kind) {
|
|
20
|
+
case 'atom':
|
|
21
|
+
return `A(${f.name})`;
|
|
22
|
+
case 'bottom':
|
|
23
|
+
return '⊥';
|
|
24
|
+
case 'not':
|
|
25
|
+
return `N(${formulaKey(f.arg)})`;
|
|
26
|
+
case 'and':
|
|
27
|
+
return `&(${formulaKey(f.left)},${formulaKey(f.right)})`;
|
|
28
|
+
case 'or':
|
|
29
|
+
return `|(${formulaKey(f.left)},${formulaKey(f.right)})`;
|
|
30
|
+
case 'implies':
|
|
31
|
+
return `>(${formulaKey(f.left)},${formulaKey(f.right)})`;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
function formulaEquals(a, b) {
|
|
35
|
+
return formulaKey(a) === formulaKey(b);
|
|
36
|
+
}
|
|
37
|
+
function formulaToString(f) {
|
|
38
|
+
switch (f.kind) {
|
|
39
|
+
case 'atom':
|
|
40
|
+
return f.name;
|
|
41
|
+
case 'bottom':
|
|
42
|
+
return '⊥';
|
|
43
|
+
case 'not':
|
|
44
|
+
return `¬${parens(f.arg)}`;
|
|
45
|
+
case 'and':
|
|
46
|
+
return `(${formulaToString(f.left)} ∧ ${formulaToString(f.right)})`;
|
|
47
|
+
case 'or':
|
|
48
|
+
return `(${formulaToString(f.left)} ∨ ${formulaToString(f.right)})`;
|
|
49
|
+
case 'implies':
|
|
50
|
+
return `(${formulaToString(f.left)} → ${formulaToString(f.right)})`;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function parens(f) {
|
|
54
|
+
if (f.kind === 'atom' || f.kind === 'bottom')
|
|
55
|
+
return formulaToString(f);
|
|
56
|
+
return `(${formulaToString(f)})`;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Recolecta los átomos proposicionales que aparecen en `f`.
|
|
60
|
+
*/
|
|
61
|
+
function collectAtoms(f, out = new Set()) {
|
|
62
|
+
switch (f.kind) {
|
|
63
|
+
case 'atom':
|
|
64
|
+
out.add(f.name);
|
|
65
|
+
return out;
|
|
66
|
+
case 'bottom':
|
|
67
|
+
return out;
|
|
68
|
+
case 'not':
|
|
69
|
+
return collectAtoms(f.arg, out);
|
|
70
|
+
case 'and':
|
|
71
|
+
case 'or':
|
|
72
|
+
case 'implies':
|
|
73
|
+
collectAtoms(f.left, out);
|
|
74
|
+
return collectAtoms(f.right, out);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
// Constructores ergonómicos -----------------------------------
|
|
78
|
+
const atom = (name) => ({ kind: 'atom', name });
|
|
79
|
+
exports.atom = atom;
|
|
80
|
+
const bottom = () => ({ kind: 'bottom' });
|
|
81
|
+
exports.bottom = bottom;
|
|
82
|
+
const not = (arg) => ({ kind: 'not', arg });
|
|
83
|
+
exports.not = not;
|
|
84
|
+
const and = (left, right) => ({
|
|
85
|
+
kind: 'and',
|
|
86
|
+
left,
|
|
87
|
+
right,
|
|
88
|
+
});
|
|
89
|
+
exports.and = and;
|
|
90
|
+
const or = (left, right) => ({
|
|
91
|
+
kind: 'or',
|
|
92
|
+
left,
|
|
93
|
+
right,
|
|
94
|
+
});
|
|
95
|
+
exports.or = or;
|
|
96
|
+
const implies = (left, right) => ({
|
|
97
|
+
kind: 'implies',
|
|
98
|
+
left,
|
|
99
|
+
right,
|
|
100
|
+
});
|
|
101
|
+
exports.implies = implies;
|
|
102
|
+
//# sourceMappingURL=formula.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formula.js","sourceRoot":"","sources":["../../../../src/logic/profiles/natural-deduction-nk/formula.ts"],"names":[],"mappings":";AAAA,+DAA+D;AAC/D,oCAAoC;AACpC,+DAA+D;AAC/D,EAAE;AACF,2DAA2D;AAC3D,iEAAiE;AACjE,cAAc;;;AAOd,gCAeC;AAED,sCAEC;AAED,0CAeC;AAUD,oCAeC;AAhED;;GAEG;AACH,SAAgB,UAAU,CAAC,CAAY;IACrC,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC;QACf,KAAK,MAAM;YACT,OAAO,KAAK,CAAC,CAAC,IAAI,GAAG,CAAC;QACxB,KAAK,QAAQ;YACX,OAAO,GAAG,CAAC;QACb,KAAK,KAAK;YACR,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;QACnC,KAAK,KAAK;YACR,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC;QAC3D,KAAK,IAAI;YACP,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC;QAC3D,KAAK,SAAS;YACZ,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC;IAC7D,CAAC;AACH,CAAC;AAED,SAAgB,aAAa,CAAC,CAAY,EAAE,CAAY;IACtD,OAAO,UAAU,CAAC,CAAC,CAAC,KAAK,UAAU,CAAC,CAAC,CAAC,CAAC;A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ulaEquals, formulaToString, collectAtoms, atom, bottom, not, and, or, implies, } from './formula';
|
|
4
|
+
export { proveClassically, proveIntuitOnly, verifyProof, provedPeirce, provedDNE, provedLEM, nkToNJ, } from './prover';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/logic/profiles/natural-deduction-nk/index.ts"],"names":[],"mappings":"AAIA,YAAY,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAE/C,OAAO,EACL,UAAU,EACV,aAAa,EACb,eAAe,EACf,YAAY,EACZ,IAAI,EACJ,MAAM,EACN,GAAG,EACH,GAAG,EACH,EAAE,EACF,OAAO,GACR,MAAM,WAAW,CAAC;AAEnB,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,WAAW,EACX,YAAY,EACZ,SAAS,EACT,SAAS,EACT,MAAM,GACP,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// ============================================================
|
|
3
|
+
// Natural Deduction NK (classical) — Entrada pública
|
|
4
|
+
// ============================================================
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.nkToNJ = exports.provedLEM = exports.provedDNE = exports.provedPeirce = exports.verifyProof = exports.proveIntuitOnly = exports.proveClassically = exports.implies = exports.or = exports.and = exports.not = exports.bottom = exports.atom = exports.collectAtoms = exports.formulaToString = exports.formulaEquals = exports.formulaKey = exports.CLASSICAL_ONLY_RULES = void 0;
|
|
7
|
+
var types_1 = require("./types");
|
|
8
|
+
Object.defineProperty(exports, "CLASSICAL_ONLY_RULES", { enumerable: true, get: function () { return types_1.CLASSICAL_ONLY_RULES; } });
|
|
9
|
+
var formula_1 = require("./formula");
|
|
10
|
+
Object.defineProperty(exports, "formulaKey", { enumerable: true, get: function () { return formula_1.formulaKey; } });
|
|
11
|
+
Object.defineProperty(exports, "formulaEquals", { enumerable: true, get: function () { return formula_1.formulaEquals; } });
|
|
12
|
+
Object.defineProperty(exports, "formulaToString", { enumerable: true, get: function () { return formula_1.formulaToString; } });
|
|
13
|
+
Object.defineProperty(exports, "collectAtoms", { enumerable: true, get: function () { return formula_1.collectAtoms; } });
|
|
14
|
+
Object.defineProperty(exports, "atom", { enumerable: true, get: function () { return formula_1.atom; } });
|
|
15
|
+
Object.defineProperty(exports, "bottom", { enumerable: true, get: function () { return formula_1.bottom; } });
|
|
16
|
+
Object.defineProperty(exports, "not", { enumerable: true, get: function () { return formula_1.not; } });
|
|
17
|
+
Object.defineProperty(exports, "and", { enumerable: true, get: function () { return formula_1.and; } });
|
|
18
|
+
Object.defineProperty(exports, "or", { enumerable: true, get: function () { return formula_1.or; } });
|
|
19
|
+
Object.defineProperty(exports, "implies", { enumerable: true, get: function () { return formula_1.implies; } });
|
|
20
|
+
var prover_1 = require("./prover");
|
|
21
|
+
Object.defineProperty(exports, "proveClassically", { enumerable: true, get: function () { return prover_1.proveClassically; } });
|
|
22
|
+
Object.defineProperty(exports, "proveIntuitOnly", { enumerable: true, get: function () { return prover_1.proveIntuitOnly; } });
|
|
23
|
+
Object.defineProperty(exports, "verifyProof", { enumerable: true, get: function () { return prover_1.verifyProof; } });
|
|
24
|
+
Object.defineProperty(exports, "provedPeirce", { enumerable: true, get: function () { return prover_1.provedPeirce; } });
|
|
25
|
+
Object.defineProperty(exports, "provedDNE", { enumerable: true, get: function () { return prover_1.provedDNE; } });
|
|
26
|
+
Object.defineProperty(exports, "provedLEM", { enumerable: true, get: function () { return prover_1.provedLEM; } });
|
|
27
|
+
Object.defineProperty(exports, "nkToNJ", { enumerable: true, get: function () { return prover_1.nkToNJ; } });
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/logic/profiles/natural-deduction-nk/index.ts"],"names":[],"mappings":";AAAA,+DAA+D;AAC/D,qDAAqD;AACrD,+DAA+D;;;AAG/D,iCAA+C;AAAtC,6GAAA,oBAAoB,OAAA;AAE7B,qCAWmB;AAVjB,qGAAA,UAAU,OAAA;AACV,wGAAA,aAAa,OAAA;AACb,0GAAA,eAAe,OAAA;AACf,uGAAA,YAAY,OAAA;AACZ,+FAAA,IAAI,OAAA;AACJ,iGAAA,MAAM,OAAA;AACN,8FAAA,GAAG,OAAA;AACH,8FAAA,GAAG,OAAA;AACH,6FAAA,EAAE,OAAA;AACF,kGAAA,OAAO,OAAA;AAGT,mCAQkB;AAPhB,0GAAA,gBAAgB,OAAA;AAChB,yGAAA,eAAe,OAAA;AACf,qGAAA,WAAW,OAAA;AACX,sGAAA,YAAY,OAAA;AACZ,mGAAA,SAAS,OAAA;AACT,mGAAA,SAAS,OAAA;AACT,gGAAA,MAAM,OAAA"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { NKFormula, NKProof } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* API pública: prueba clásica.
|
|
4
|
+
*
|
|
5
|
+
* Devuelve un árbol NK que demuestra `goal` a partir de las
|
|
6
|
+
* `premises` dadas, o `null` si no encontró prueba.
|
|
7
|
+
*/
|
|
8
|
+
export declare function proveClassically(premises: NKFormula[], goal: NKFormula, options?: {
|
|
9
|
+
budget?: number;
|
|
10
|
+
}): NKProof | null;
|
|
11
|
+
/**
|
|
12
|
+
* Variante restringida: intenta probar usando sólo reglas
|
|
13
|
+
* intuicionistas (NJ). Útil internamente para `nkToNJ`.
|
|
14
|
+
*/
|
|
15
|
+
export declare function proveIntuitOnly(premises: NKFormula[], goal: NKFormula, options?: {
|
|
16
|
+
budget?: number;
|
|
17
|
+
}): NKProof | null;
|
|
18
|
+
/**
|
|
19
|
+
* Verifica recursivamente el árbol NK. Comprueba cada regla
|
|
20
|
+
* localmente contra su conclusión y contexto.
|
|
21
|
+
*/
|
|
22
|
+
export declare function verifyProof(proof: NKProof, initialContext?: NKFormula[]): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Devuelve una prueba NK de la ley de Peirce: ((P→Q)→P)→P.
|
|
25
|
+
*/
|
|
26
|
+
export declare function provedPeirce(): NKProof;
|
|
27
|
+
/**
|
|
28
|
+
* Devuelve una prueba NK de la eliminación de doble negación: ¬¬P → P.
|
|
29
|
+
*/
|
|
30
|
+
export declare function provedDNE(): NKProof;
|
|
31
|
+
/**
|
|
32
|
+
* Devuelve una prueba NK del tercero excluido: P ∨ ¬P.
|
|
33
|
+
*/
|
|
34
|
+
export declare function provedLEM(): NKProof;
|
|
35
|
+
/**
|
|
36
|
+
* Indica si una prueba NK puede traducirse a NJ sin pérdida.
|
|
37
|
+
* Si contiene alguna regla puramente clásica, la traducción
|
|
38
|
+
* falla con `reason`. Si es puramente intuicionista, se
|
|
39
|
+
* devuelve la prueba intacta (cast estructural a NJProof).
|
|
40
|
+
*
|
|
41
|
+
* No intentamos la traducción de Glivenko ni doble-negación
|
|
42
|
+
* uniforme aquí: el objetivo es detectar si la prueba ya está
|
|
43
|
+
* en el fragmento intuicionista.
|
|
44
|
+
*/
|
|
45
|
+
export declare function nkToNJ(proof: NKProof): {
|
|
46
|
+
converted?: NKProof;
|
|
47
|
+
reason?: string;
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=prover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prover.d.ts","sourceRoot":"","sources":["../../../../src/logic/profiles/natural-deduction-nk/prover.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAgC,MAAM,SAAS,CAAC;AA8Q3E;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,SAAS,EAAE,EACrB,IAAI,EAAE,SAAS,EACf,OAAO,GAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAO,GAChC,OAAO,GAAG,IAAI,CAGhB;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,SAAS,EAAE,EACrB,IAAI,EAAE,SAAS,EACf,OAAO,GAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAO,GAChC,OAAO,GAAG,IAAI,CAGhB;AAID;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,cAAc,GAAE,SAAS,EAAO,GAAG,OAAO,CAErF;AAuJD;;GAEG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAatC;AAED;;GAEG;AACH,wBAAgB,SAAS,IAAI,OAAO,CAgBnC;AAED;;GAEG;AACH,wBAAgB,SAAS,IAAI,OAAO,CAUnC;AAID;;;;;;;;;GASG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG;IAAE,SAAS,CAAC,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAU/E"}
|