@stevenvo780/st-lang 4.8.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/logic/profiles/quantum/index.d.ts +153 -0
- package/dist/logic/profiles/quantum/index.d.ts.map +1 -0
- package/dist/logic/profiles/quantum/index.js +788 -0
- package/dist/logic/profiles/quantum/index.js.map +1 -0
- package/dist/namespaces/reasoning.d.ts +2 -1
- package/dist/namespaces/reasoning.d.ts.map +1 -1
- package/dist/namespaces/reasoning.js +3 -1
- package/dist/namespaces/reasoning.js.map +1 -1
- package/dist/proof-systems/certificate/canonical.d.ts +18 -0
- package/dist/proof-systems/certificate/canonical.d.ts.map +1 -0
- package/dist/proof-systems/certificate/canonical.js +79 -0
- package/dist/proof-systems/certificate/canonical.js.map +1 -0
- package/dist/proof-systems/certificate/generate.d.ts +39 -0
- package/dist/proof-systems/certificate/generate.d.ts.map +1 -0
- package/dist/proof-systems/certificate/generate.js +259 -0
- package/dist/proof-systems/certificate/generate.js.map +1 -0
- package/dist/proof-systems/certificate/index.d.ts +7 -0
- package/dist/proof-systems/certificate/index.d.ts.map +1 -0
- package/dist/proof-systems/certificate/index.js +23 -0
- package/dist/proof-systems/certificate/index.js.map +1 -0
- package/dist/proof-systems/certificate/lfsc.d.ts +15 -0
- package/dist/proof-systems/certificate/lfsc.d.ts.map +1 -0
- package/dist/proof-systems/certificate/lfsc.js +395 -0
- package/dist/proof-systems/certificate/lfsc.js.map +1 -0
- package/dist/proof-systems/certificate/rules.d.ts +8 -0
- package/dist/proof-systems/certificate/rules.d.ts.map +1 -0
- package/dist/proof-systems/certificate/rules.js +369 -0
- package/dist/proof-systems/certificate/rules.js.map +1 -0
- package/dist/proof-systems/certificate/types.d.ts +114 -0
- package/dist/proof-systems/certificate/types.d.ts.map +1 -0
- package/dist/proof-systems/certificate/types.js +18 -0
- package/dist/proof-systems/certificate/types.js.map +1 -0
- package/dist/proof-systems/certificate/verify.d.ts +20 -0
- package/dist/proof-systems/certificate/verify.d.ts.map +1 -0
- package/dist/proof-systems/certificate/verify.js +171 -0
- package/dist/proof-systems/certificate/verify.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/ban-logic/analyze.d.ts +31 -0
- package/dist/reasoning/ban-logic/analyze.d.ts.map +1 -0
- package/dist/reasoning/ban-logic/analyze.js +113 -0
- package/dist/reasoning/ban-logic/analyze.js.map +1 -0
- package/dist/reasoning/ban-logic/index.d.ts +7 -0
- package/dist/reasoning/ban-logic/index.d.ts.map +1 -0
- package/dist/reasoning/ban-logic/index.js +66 -0
- package/dist/reasoning/ban-logic/index.js.map +1 -0
- package/dist/reasoning/ban-logic/protocols.d.ts +54 -0
- package/dist/reasoning/ban-logic/protocols.d.ts.map +1 -0
- package/dist/reasoning/ban-logic/protocols.js +219 -0
- package/dist/reasoning/ban-logic/protocols.js.map +1 -0
- package/dist/reasoning/ban-logic/rules.d.ts +83 -0
- package/dist/reasoning/ban-logic/rules.d.ts.map +1 -0
- package/dist/reasoning/ban-logic/rules.js +409 -0
- package/dist/reasoning/ban-logic/rules.js.map +1 -0
- package/dist/reasoning/ban-logic/terms.d.ts +26 -0
- package/dist/reasoning/ban-logic/terms.d.ts.map +1 -0
- package/dist/reasoning/ban-logic/terms.js +262 -0
- package/dist/reasoning/ban-logic/terms.js.map +1 -0
- package/dist/reasoning/ban-logic/types.d.ts +107 -0
- package/dist/reasoning/ban-logic/types.d.ts.map +1 -0
- package/dist/reasoning/ban-logic/types.js +27 -0
- package/dist/reasoning/ban-logic/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/differential-privacy/index.d.ts +121 -0
- package/dist/reasoning/differential-privacy/index.d.ts.map +1 -0
- package/dist/reasoning/differential-privacy/index.js +417 -0
- package/dist/reasoning/differential-privacy/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/logic/profiles/quantum/quantum.test.d.ts +2 -0
- package/dist/tests/logic/profiles/quantum/quantum.test.d.ts.map +1 -0
- package/dist/tests/logic/profiles/quantum/quantum.test.js +209 -0
- package/dist/tests/logic/profiles/quantum/quantum.test.js.map +1 -0
- package/dist/tests/proof-systems/certificate/certificate.test.d.ts +2 -0
- package/dist/tests/proof-systems/certificate/certificate.test.d.ts.map +1 -0
- package/dist/tests/proof-systems/certificate/certificate.test.js +449 -0
- package/dist/tests/proof-systems/certificate/certificate.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/ban-logic/ban-logic.test.d.ts +2 -0
- package/dist/tests/reasoning/ban-logic/ban-logic.test.d.ts.map +1 -0
- package/dist/tests/reasoning/ban-logic/ban-logic.test.js +270 -0
- package/dist/tests/reasoning/ban-logic/ban-logic.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/differential-privacy/differential-privacy.test.d.ts +2 -0
- package/dist/tests/reasoning/differential-privacy/differential-privacy.test.d.ts.map +1 -0
- package/dist/tests/reasoning/differential-privacy/differential-privacy.test.js +388 -0
- package/dist/tests/reasoning/differential-privacy/differential-privacy.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/tests/tooling/mathlib/mathlib.test.d.ts +2 -0
- package/dist/tests/tooling/mathlib/mathlib.test.d.ts.map +1 -0
- package/dist/tests/tooling/mathlib/mathlib.test.js +214 -0
- package/dist/tests/tooling/mathlib/mathlib.test.js.map +1 -0
- package/dist/tests/type-theory/effects/effects.test.d.ts +2 -0
- package/dist/tests/type-theory/effects/effects.test.d.ts.map +1 -0
- package/dist/tests/type-theory/effects/effects.test.js +242 -0
- package/dist/tests/type-theory/effects/effects.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/dist/tooling/mathlib/group.d.ts +27 -0
- package/dist/tooling/mathlib/group.d.ts.map +1 -0
- package/dist/tooling/mathlib/group.js +89 -0
- package/dist/tooling/mathlib/group.js.map +1 -0
- package/dist/tooling/mathlib/index.d.ts +8 -0
- package/dist/tooling/mathlib/index.d.ts.map +1 -0
- package/dist/tooling/mathlib/index.js +40 -0
- package/dist/tooling/mathlib/index.js.map +1 -0
- package/dist/tooling/mathlib/instances.d.ts +29 -0
- package/dist/tooling/mathlib/instances.d.ts.map +1 -0
- package/dist/tooling/mathlib/instances.js +139 -0
- package/dist/tooling/mathlib/instances.js.map +1 -0
- package/dist/tooling/mathlib/lemmas.d.ts +3 -0
- package/dist/tooling/mathlib/lemmas.d.ts.map +1 -0
- package/dist/tooling/mathlib/lemmas.js +72 -0
- package/dist/tooling/mathlib/lemmas.js.map +1 -0
- package/dist/tooling/mathlib/order.d.ts +29 -0
- package/dist/tooling/mathlib/order.d.ts.map +1 -0
- package/dist/tooling/mathlib/order.js +91 -0
- package/dist/tooling/mathlib/order.js.map +1 -0
- package/dist/tooling/mathlib/ring.d.ts +15 -0
- package/dist/tooling/mathlib/ring.d.ts.map +1 -0
- package/dist/tooling/mathlib/ring.js +91 -0
- package/dist/tooling/mathlib/ring.js.map +1 -0
- package/dist/tooling/mathlib/types.d.ts +62 -0
- package/dist/tooling/mathlib/types.d.ts.map +1 -0
- package/dist/tooling/mathlib/types.js +7 -0
- package/dist/tooling/mathlib/types.js.map +1 -0
- package/dist/type-theory/effects/core.d.ts +27 -0
- package/dist/type-theory/effects/core.d.ts.map +1 -0
- package/dist/type-theory/effects/core.js +79 -0
- package/dist/type-theory/effects/core.js.map +1 -0
- package/dist/type-theory/effects/exception.d.ts +18 -0
- package/dist/type-theory/effects/exception.d.ts.map +1 -0
- package/dist/type-theory/effects/exception.js +59 -0
- package/dist/type-theory/effects/exception.js.map +1 -0
- package/dist/type-theory/effects/index.d.ts +11 -0
- package/dist/type-theory/effects/index.d.ts.map +1 -0
- package/dist/type-theory/effects/index.js +50 -0
- package/dist/type-theory/effects/index.js.map +1 -0
- package/dist/type-theory/effects/reader.d.ts +20 -0
- package/dist/type-theory/effects/reader.d.ts.map +1 -0
- package/dist/type-theory/effects/reader.js +62 -0
- package/dist/type-theory/effects/reader.js.map +1 -0
- package/dist/type-theory/effects/state.d.ts +31 -0
- package/dist/type-theory/effects/state.d.ts.map +1 -0
- package/dist/type-theory/effects/state.js +91 -0
- package/dist/type-theory/effects/state.js.map +1 -0
- package/dist/type-theory/effects/types.d.ts +45 -0
- package/dist/type-theory/effects/types.d.ts.map +1 -0
- package/dist/type-theory/effects/types.js +21 -0
- package/dist/type-theory/effects/types.js.map +1 -0
- package/dist/type-theory/effects/writer.d.ts +30 -0
- package/dist/type-theory/effects/writer.d.ts.map +1 -0
- package/dist/type-theory/effects/writer.js +79 -0
- package/dist/type-theory/effects/writer.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// ============================================================
|
|
3
|
+
// ST Automata — Regex parsing + Thompson construction
|
|
4
|
+
// ============================================================
|
|
5
|
+
//
|
|
6
|
+
// Gramática soportada (precedencia: postfix > concat > '|'):
|
|
7
|
+
//
|
|
8
|
+
// expr := term ( '|' term )*
|
|
9
|
+
// term := factor* (concatenación implícita)
|
|
10
|
+
// factor := atom ( '*' | '+' | '?' )*
|
|
11
|
+
// atom := char | '(' expr ')' | '∅' (vacío) | 'ε'
|
|
12
|
+
//
|
|
13
|
+
// Caracteres reservados: ( ) | * + ? → escapar con '\'.
|
|
14
|
+
// '∅' y 'ε' son atómicos opcionales (no son obligatorios para parsear).
|
|
15
|
+
//
|
|
16
|
+
// `regexToNfa` construye un NFA por la construcción de Thompson:
|
|
17
|
+
// para cada operador un fragmento con un único initial y un único accept.
|
|
18
|
+
// ============================================================
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.parseRegex = parseRegex;
|
|
21
|
+
exports.regexToNfa = regexToNfa;
|
|
22
|
+
exports.regexMatches = regexMatches;
|
|
23
|
+
const types_1 = require("./types");
|
|
24
|
+
const nfa_1 = require("./nfa");
|
|
25
|
+
function peek(c) {
|
|
26
|
+
return c.i < c.s.length ? c.s[c.i] : undefined;
|
|
27
|
+
}
|
|
28
|
+
function consume(c) {
|
|
29
|
+
const ch = peek(c);
|
|
30
|
+
if (ch !== undefined)
|
|
31
|
+
c.i++;
|
|
32
|
+
return ch;
|
|
33
|
+
}
|
|
34
|
+
function expect(c, ch) {
|
|
35
|
+
const got = consume(c);
|
|
36
|
+
if (got !== ch)
|
|
37
|
+
throw new Error(`parseRegex: esperaba "${ch}" en pos ${c.i - 1}, vi "${got ?? 'EOF'}"`);
|
|
38
|
+
}
|
|
39
|
+
const POSTFIX = new Set(['*', '+', '?']);
|
|
40
|
+
const SPECIAL = new Set(['(', ')', '|', '*', '+', '?', '\\']);
|
|
41
|
+
function parseExpr(c) {
|
|
42
|
+
let left = parseTerm(c);
|
|
43
|
+
while (peek(c) === '|') {
|
|
44
|
+
consume(c);
|
|
45
|
+
const right = parseTerm(c);
|
|
46
|
+
left = { kind: 'union', left, right };
|
|
47
|
+
}
|
|
48
|
+
return left;
|
|
49
|
+
}
|
|
50
|
+
function parseTerm(c) {
|
|
51
|
+
// term puede ser vacío → ε.
|
|
52
|
+
const atoms = [];
|
|
53
|
+
while (true) {
|
|
54
|
+
const ch = peek(c);
|
|
55
|
+
if (ch === undefined || ch === '|' || ch === ')')
|
|
56
|
+
break;
|
|
57
|
+
atoms.push(parseFactor(c));
|
|
58
|
+
}
|
|
59
|
+
if (atoms.length === 0)
|
|
60
|
+
return { kind: 'epsilon' };
|
|
61
|
+
return atoms.reduce((acc, r) => ({ kind: 'concat', left: acc, right: r }));
|
|
62
|
+
}
|
|
63
|
+
function parseFactor(c) {
|
|
64
|
+
let atom = parseAtom(c);
|
|
65
|
+
while (true) {
|
|
66
|
+
const ch = peek(c);
|
|
67
|
+
if (ch === undefined || !POSTFIX.has(ch))
|
|
68
|
+
break;
|
|
69
|
+
consume(c);
|
|
70
|
+
if (ch === '*')
|
|
71
|
+
atom = { kind: 'star', arg: atom };
|
|
72
|
+
else if (ch === '+')
|
|
73
|
+
atom = { kind: 'plus', arg: atom };
|
|
74
|
+
else if (ch === '?')
|
|
75
|
+
atom = { kind: 'optional', arg: atom };
|
|
76
|
+
}
|
|
77
|
+
return atom;
|
|
78
|
+
}
|
|
79
|
+
function parseAtom(c) {
|
|
80
|
+
const ch = peek(c);
|
|
81
|
+
if (ch === undefined)
|
|
82
|
+
throw new Error('parseRegex: EOF inesperado en atom');
|
|
83
|
+
if (ch === '(') {
|
|
84
|
+
consume(c);
|
|
85
|
+
const inner = parseExpr(c);
|
|
86
|
+
expect(c, ')');
|
|
87
|
+
return inner;
|
|
88
|
+
}
|
|
89
|
+
if (ch === '\\') {
|
|
90
|
+
consume(c);
|
|
91
|
+
const esc = consume(c);
|
|
92
|
+
if (esc === undefined)
|
|
93
|
+
throw new Error('parseRegex: escape colgante');
|
|
94
|
+
return { kind: 'char', c: esc };
|
|
95
|
+
}
|
|
96
|
+
if (ch === '∅') {
|
|
97
|
+
consume(c);
|
|
98
|
+
return { kind: 'empty' };
|
|
99
|
+
}
|
|
100
|
+
if (ch === 'ε') {
|
|
101
|
+
consume(c);
|
|
102
|
+
return { kind: 'epsilon' };
|
|
103
|
+
}
|
|
104
|
+
if (SPECIAL.has(ch)) {
|
|
105
|
+
throw new Error(`parseRegex: caracter "${ch}" reservado en pos ${c.i}`);
|
|
106
|
+
}
|
|
107
|
+
consume(c);
|
|
108
|
+
return { kind: 'char', c: ch };
|
|
109
|
+
}
|
|
110
|
+
function parseRegex(s) {
|
|
111
|
+
const c = { s, i: 0 };
|
|
112
|
+
const r = parseExpr(c);
|
|
113
|
+
if (c.i !== s.length) {
|
|
114
|
+
throw new Error(`parseRegex: tokens restantes en pos ${c.i}: "${s.slice(c.i)}"`);
|
|
115
|
+
}
|
|
116
|
+
return r;
|
|
117
|
+
}
|
|
118
|
+
function emptyFragment(initial, accept) {
|
|
119
|
+
return { initial, accept, edges: new Map(), alphabet: new Set() };
|
|
120
|
+
}
|
|
121
|
+
function addEdge(frag, from, sym, to) {
|
|
122
|
+
let row = frag.edges.get(from);
|
|
123
|
+
if (!row) {
|
|
124
|
+
row = new Map();
|
|
125
|
+
frag.edges.set(from, row);
|
|
126
|
+
}
|
|
127
|
+
let set = row.get(sym);
|
|
128
|
+
if (!set) {
|
|
129
|
+
set = new Set();
|
|
130
|
+
row.set(sym, set);
|
|
131
|
+
}
|
|
132
|
+
set.add(to);
|
|
133
|
+
if (sym !== types_1.EPSILON)
|
|
134
|
+
frag.alphabet.add(sym);
|
|
135
|
+
}
|
|
136
|
+
function mergeEdges(into, other) {
|
|
137
|
+
for (const [from, row] of other.edges) {
|
|
138
|
+
for (const [sym, set] of row) {
|
|
139
|
+
for (const to of set)
|
|
140
|
+
addEdge(into, from, sym, to);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
for (const a of other.alphabet)
|
|
144
|
+
into.alphabet.add(a);
|
|
145
|
+
}
|
|
146
|
+
function buildFragment(r, fresh) {
|
|
147
|
+
if (r.kind === 'epsilon') {
|
|
148
|
+
const init = fresh();
|
|
149
|
+
const acc = fresh();
|
|
150
|
+
const frag = emptyFragment(init, acc);
|
|
151
|
+
addEdge(frag, init, types_1.EPSILON, acc);
|
|
152
|
+
return frag;
|
|
153
|
+
}
|
|
154
|
+
if (r.kind === 'empty') {
|
|
155
|
+
// Lenguaje vacío: dos estados sin conexión. No hay camino al accept.
|
|
156
|
+
const init = fresh();
|
|
157
|
+
const acc = fresh();
|
|
158
|
+
return emptyFragment(init, acc);
|
|
159
|
+
}
|
|
160
|
+
if (r.kind === 'char') {
|
|
161
|
+
const init = fresh();
|
|
162
|
+
const acc = fresh();
|
|
163
|
+
const frag = emptyFragment(init, acc);
|
|
164
|
+
addEdge(frag, init, r.c, acc);
|
|
165
|
+
return frag;
|
|
166
|
+
}
|
|
167
|
+
if (r.kind === 'concat') {
|
|
168
|
+
const A = buildFragment(r.left, fresh);
|
|
169
|
+
const B = buildFragment(r.right, fresh);
|
|
170
|
+
const frag = emptyFragment(A.initial, B.accept);
|
|
171
|
+
mergeEdges(frag, A);
|
|
172
|
+
mergeEdges(frag, B);
|
|
173
|
+
addEdge(frag, A.accept, types_1.EPSILON, B.initial);
|
|
174
|
+
return frag;
|
|
175
|
+
}
|
|
176
|
+
if (r.kind === 'union') {
|
|
177
|
+
const A = buildFragment(r.left, fresh);
|
|
178
|
+
const B = buildFragment(r.right, fresh);
|
|
179
|
+
const init = fresh();
|
|
180
|
+
const acc = fresh();
|
|
181
|
+
const frag = emptyFragment(init, acc);
|
|
182
|
+
mergeEdges(frag, A);
|
|
183
|
+
mergeEdges(frag, B);
|
|
184
|
+
addEdge(frag, init, types_1.EPSILON, A.initial);
|
|
185
|
+
addEdge(frag, init, types_1.EPSILON, B.initial);
|
|
186
|
+
addEdge(frag, A.accept, types_1.EPSILON, acc);
|
|
187
|
+
addEdge(frag, B.accept, types_1.EPSILON, acc);
|
|
188
|
+
return frag;
|
|
189
|
+
}
|
|
190
|
+
if (r.kind === 'star') {
|
|
191
|
+
const A = buildFragment(r.arg, fresh);
|
|
192
|
+
const init = fresh();
|
|
193
|
+
const acc = fresh();
|
|
194
|
+
const frag = emptyFragment(init, acc);
|
|
195
|
+
mergeEdges(frag, A);
|
|
196
|
+
addEdge(frag, init, types_1.EPSILON, A.initial);
|
|
197
|
+
addEdge(frag, init, types_1.EPSILON, acc);
|
|
198
|
+
addEdge(frag, A.accept, types_1.EPSILON, A.initial);
|
|
199
|
+
addEdge(frag, A.accept, types_1.EPSILON, acc);
|
|
200
|
+
return frag;
|
|
201
|
+
}
|
|
202
|
+
if (r.kind === 'plus') {
|
|
203
|
+
// a+ = a · a*
|
|
204
|
+
return buildFragment({ kind: 'concat', left: r.arg, right: { kind: 'star', arg: r.arg } }, fresh);
|
|
205
|
+
}
|
|
206
|
+
if (r.kind === 'optional') {
|
|
207
|
+
// a? = a | ε
|
|
208
|
+
return buildFragment({ kind: 'union', left: r.arg, right: { kind: 'epsilon' } }, fresh);
|
|
209
|
+
}
|
|
210
|
+
// Exhaustivo.
|
|
211
|
+
const _exhaustive = r;
|
|
212
|
+
return _exhaustive;
|
|
213
|
+
}
|
|
214
|
+
function regexToNfa(r) {
|
|
215
|
+
let counter = 0;
|
|
216
|
+
const fresh = () => counter++;
|
|
217
|
+
const frag = buildFragment(r, fresh);
|
|
218
|
+
// Convertir entero → string para encajar con NFA.
|
|
219
|
+
const stateName = (n) => `s${n}`;
|
|
220
|
+
const states = new Set();
|
|
221
|
+
const transitions = new Map();
|
|
222
|
+
// Asegurar que todos los estados conocidos estén poblados, incluso los
|
|
223
|
+
// que sólo aparecen como destino.
|
|
224
|
+
const seen = new Set();
|
|
225
|
+
for (const [from, row] of frag.edges) {
|
|
226
|
+
seen.add(from);
|
|
227
|
+
for (const set of row.values())
|
|
228
|
+
for (const to of set)
|
|
229
|
+
seen.add(to);
|
|
230
|
+
}
|
|
231
|
+
seen.add(frag.initial);
|
|
232
|
+
seen.add(frag.accept);
|
|
233
|
+
for (const n of seen)
|
|
234
|
+
states.add(stateName(n));
|
|
235
|
+
for (const [from, row] of frag.edges) {
|
|
236
|
+
const newRow = new Map();
|
|
237
|
+
for (const [sym, set] of row) {
|
|
238
|
+
const newSet = new Set();
|
|
239
|
+
for (const to of set)
|
|
240
|
+
newSet.add(stateName(to));
|
|
241
|
+
newRow.set(sym, newSet);
|
|
242
|
+
}
|
|
243
|
+
transitions.set(stateName(from), newRow);
|
|
244
|
+
}
|
|
245
|
+
return {
|
|
246
|
+
states,
|
|
247
|
+
alphabet: frag.alphabet,
|
|
248
|
+
transitions,
|
|
249
|
+
initial: stateName(frag.initial),
|
|
250
|
+
accept: new Set([stateName(frag.accept)]),
|
|
251
|
+
epsilon: types_1.EPSILON,
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
/** Atajo: ¿la expresión regular `r` matchea exactamente `s`? */
|
|
255
|
+
function regexMatches(r, s) {
|
|
256
|
+
const nfa = regexToNfa(r);
|
|
257
|
+
return (0, nfa_1.nfaAccepts)(nfa, s);
|
|
258
|
+
}
|
|
259
|
+
//# sourceMappingURL=regex.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"regex.js","sourceRoot":"","sources":["../../../src/reasoning/automata/regex.ts"],"names":[],"mappings":";AAAA,+DAA+D;AAC/D,sDAAsD;AACtD,+DAA+D;AAC/D,EAAE;AACF,6DAA6D;AAC7D,EAAE;AACF,iCAAiC;AACjC,+DAA+D;AAC/D,wCAAwC;AACxC,sDAAsD;AACtD,EAAE;AACF,yDAAyD;AACzD,wEAAwE;AACxE,EAAE;AACF,iEAAiE;AACjE,0EAA0E;AAC1E,+DAA+D;;AAiG/D,gCAOC;AAoHD,gCAwCC;AAGD,oCAGC;AAvQD,mCAAkC;AAClC,+BAAmC;AASnC,SAAS,IAAI,CAAC,CAAS;IACrB,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACjD,CAAC;AAED,SAAS,OAAO,CAAC,CAAS;IACxB,MAAM,EAAE,GAA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AuB,CAAC;QAC9C,KAAK,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,GAAG,EAAE,CAAC;YAC7B,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAC;YACjC,KAAK,MAAM,EAAE,IAAI,GAAG;gBAAE,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;YAChD,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;QAC1B,CAAC;QACD,WAAW,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC;IAC3C,CAAC;IAED,OAAO;QACL,MAAM;QACN,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,WAAW;QACX,OAAO,EAAE,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC;QAChC,MAAM,EAAE,IAAI,GAAG,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;QACzC,OAAO,EAAE,eAAO;KACjB,CAAC;AACJ,CAAC;AAED,gEAAgE;AAChE,SAAgB,YAAY,CAAC,CAAQ,EAAE,CAAS;IAC9C,MAAM,GAAG,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;IAC1B,OAAO,IAAA,gBAAU,EAAC,GAAG,EAAE,CAAC,CAAC,CAAC;AAC5B,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export declare const EPSILON: "\u03B5";
|
|
2
|
+
export type Symbol = string;
|
|
3
|
+
export interface DFA {
|
|
4
|
+
readonly states: Set<string>;
|
|
5
|
+
readonly alphabet: Set<Symbol>;
|
|
6
|
+
/** state → symbol → state. La función puede ser parcial: si falta una
|
|
7
|
+
* arista para (state, symbol), la palabra es rechazada. */
|
|
8
|
+
readonly transitions: Map<string, Map<Symbol, string>>;
|
|
9
|
+
readonly initial: string;
|
|
10
|
+
readonly accept: Set<string>;
|
|
11
|
+
}
|
|
12
|
+
export interface NFA {
|
|
13
|
+
readonly states: Set<string>;
|
|
14
|
+
readonly alphabet: Set<Symbol>;
|
|
15
|
+
/** state → symbol (puede ser EPSILON) → P(states). */
|
|
16
|
+
readonly transitions: Map<string, Map<Symbol, Set<string>>>;
|
|
17
|
+
readonly initial: string;
|
|
18
|
+
readonly accept: Set<string>;
|
|
19
|
+
/** Símbolo usado como ε; default `EPSILON` ('ε'). */
|
|
20
|
+
readonly epsilon?: Symbol;
|
|
21
|
+
}
|
|
22
|
+
export type Regex = {
|
|
23
|
+
kind: 'empty';
|
|
24
|
+
} | {
|
|
25
|
+
kind: 'epsilon';
|
|
26
|
+
} | {
|
|
27
|
+
kind: 'char';
|
|
28
|
+
c: Symbol;
|
|
29
|
+
} | {
|
|
30
|
+
kind: 'concat';
|
|
31
|
+
left: Regex;
|
|
32
|
+
right: Regex;
|
|
33
|
+
} | {
|
|
34
|
+
kind: 'union';
|
|
35
|
+
left: Regex;
|
|
36
|
+
right: Regex;
|
|
37
|
+
} | {
|
|
38
|
+
kind: 'star';
|
|
39
|
+
arg: Regex;
|
|
40
|
+
} | {
|
|
41
|
+
kind: 'plus';
|
|
42
|
+
arg: Regex;
|
|
43
|
+
} | {
|
|
44
|
+
kind: 'optional';
|
|
45
|
+
arg: Regex;
|
|
46
|
+
};
|
|
47
|
+
export interface PDATransition {
|
|
48
|
+
/** Estado origen. */
|
|
49
|
+
readonly state: string;
|
|
50
|
+
/** Símbolo de entrada a consumir; EPSILON = sin consumir. */
|
|
51
|
+
readonly read: Symbol;
|
|
52
|
+
/** Tope de pila a desapilar; EPSILON = sin pop. */
|
|
53
|
+
readonly popTop: Symbol;
|
|
54
|
+
/** Estado destino. */
|
|
55
|
+
readonly nextState: string;
|
|
56
|
+
/** Símbolos a apilar (el último queda en la cima). [] = no push. */
|
|
57
|
+
readonly pushTop: ReadonlyArray<Symbol>;
|
|
58
|
+
}
|
|
59
|
+
export interface PDA {
|
|
60
|
+
readonly states: Set<string>;
|
|
61
|
+
readonly alphabet: Set<Symbol>;
|
|
62
|
+
readonly stackAlphabet: Set<Symbol>;
|
|
63
|
+
readonly transitions: ReadonlyArray<PDATransition>;
|
|
64
|
+
readonly initial: string;
|
|
65
|
+
readonly initialStack: Symbol;
|
|
66
|
+
/** Aceptación por estado final. */
|
|
67
|
+
readonly accept: Set<string>;
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/reasoning/automata/types.ts"],"names":[],"mappings":"AAyBA,eAAO,MAAM,OAAO,EAAG,QAAY,CAAC;AAEpC,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC;AAI5B,MAAM,WAAW,GAAG;IAClB,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC7B,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC/B;gEAC4D;IAC5D,QAAQ,CAAC,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACvD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CAC9B;AAID,MAAM,WAAW,GAAG;IAClB,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC7B,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC/B,sDAAsD;IACtD,QAAQ,CAAC,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAC5D,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC7B,qDAAqD;I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,CAAC,WAAW,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC;IACnD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,mCAAmC;IACnC,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CAC9B"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// ============================================================
|
|
3
|
+
// ST Automata — Tipos
|
|
4
|
+
// ============================================================
|
|
5
|
+
//
|
|
6
|
+
// Modelado clásico de autómatas finitos y de pila:
|
|
7
|
+
//
|
|
8
|
+
// DFA (Deterministic Finite Automaton)
|
|
9
|
+
// · Transición total: state × symbol → state.
|
|
10
|
+
// · Acepta una palabra sii el camino termina en estado final.
|
|
11
|
+
//
|
|
12
|
+
// NFA (Nondeterministic Finite Automaton, con ε-transiciones)
|
|
13
|
+
// · Transición: state × (symbol ∪ {ε}) → P(states).
|
|
14
|
+
// · Acepta sii existe un camino que termina en final.
|
|
15
|
+
//
|
|
16
|
+
// PDA (Pushdown Automaton) — variante "by final state"
|
|
17
|
+
// · Transición: (state, read, popTop) → (nextState, pushTop[]).
|
|
18
|
+
// · `read` o `popTop` pueden ser ε (sin consumir / sin tope).
|
|
19
|
+
// · pushTop se apila en orden inverso (último → top).
|
|
20
|
+
//
|
|
21
|
+
// Notas:
|
|
22
|
+
// • Los símbolos son strings de longitud 1 (chars). El alfabeto
|
|
23
|
+
// se mantiene explícito porque define complement(M).
|
|
24
|
+
// • La constante EPSILON ('ε') vive aquí para reutilizarse.
|
|
25
|
+
// ============================================================
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
exports.EPSILON = void 0;
|
|
28
|
+
exports.EPSILON = 'ε';
|
|
29
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/reasoning/automata/types.ts"],"names":[],"mappings":";AAAA,+DAA+D;AAC/D,sBAAsB;AACtB,+DAA+D;AAC/D,EAAE;AACF,mDAAmD;AACnD,EAAE;AACF,yCAAyC;AACzC,kDAAkD;AAClD,kEAAkE;AAClE,EAAE;AACF,gEAAgE;AAChE,wDAAwD;AACxD,0DAA0D;AAC1D,EAAE;AACF,yDAAyD;AACzD,oEAAoE;AACpE,kEAAkE;AAClE,0DAA0D;AAC1D,EAAE;AACF,SAAS;AACT,kEAAkE;AAClE,yDAAyD;AACzD,8DAA8D;AAC9D,+DAA+D;;;AAElD,QAAA,OAAO,GAAG,GAAY,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { BANFormula, Protocol, ProtocolAnalysis } from './types';
|
|
2
|
+
export interface SaturateOptions {
|
|
3
|
+
/** Máximo de iteraciones del punto fijo. Default: 200. */
|
|
4
|
+
maxIterations?: number;
|
|
5
|
+
/** Máximo de fórmulas nuevas a derivar. Default: 1024. */
|
|
6
|
+
maxDerivations?: number;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Aplica las reglas BAN al estado hasta punto fijo. Devuelve el estado
|
|
10
|
+
* saturado y la lista de derivaciones nuevas (no incluye las iniciales).
|
|
11
|
+
*/
|
|
12
|
+
export declare function saturate(initial: ReadonlyArray<BANFormula>, opts?: SaturateOptions): {
|
|
13
|
+
state: BANFormula[];
|
|
14
|
+
trace: BANFormula[];
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Idealización mínima: cada step `from → to: msg` produce la
|
|
18
|
+
* fórmula `to ◁ msg`. Asumimos que el receptor literalmente ve el
|
|
19
|
+
* mensaje que se le envía.
|
|
20
|
+
*
|
|
21
|
+
* (BAN tradicional pide idealización manual para descartar texto
|
|
22
|
+
* inseguro como nombres en claro; aquí preservamos todos los
|
|
23
|
+
* subtérminos, que es la lectura conservadora.)
|
|
24
|
+
*/
|
|
25
|
+
export declare function idealize(p: Protocol): BANFormula[];
|
|
26
|
+
/**
|
|
27
|
+
* Analiza un protocolo: parte de las assumptions + idealización,
|
|
28
|
+
* satura, y verifica goals.
|
|
29
|
+
*/
|
|
30
|
+
export declare function analyzeProtocol(p: Protocol, opts?: SaturateOptions): ProtocolAnalysis;
|
|
31
|
+
//# sourceMappingURL=analyze.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analyze.d.ts","sourceRoot":"","sources":["../../../src/reasoning/ban-logic/analyze.ts"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEtE,MAAM,WAAW,eAAe;IAC9B,0DAA0D;IAC1D,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,0DAA0D;IAC1D,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAwBD;;;GAGG;AACH,wBAAgB,QAAQ,CACtB,OAAO,EAAE,aAAa,CAAC,UAAU,CAAC,EAClC,IAAI,CAAC,EAAE,eAAe,GACrB;IAAE,KAAK,EAAE,UAAU,EAAE,CAAC;IAAC,KAAK,EAAE,UAAU,EAAE,CAAA;CAAE,CA4C9C;AAED;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,QAAQ,GAAG,UAAU,EAAE,CAElD;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,EAAE,eAAe,GAAG,gBAAgB,CAYrF"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// ============================================================
|
|
3
|
+
// BAN Logic — Saturación de estado + análisis de protocolos
|
|
4
|
+
// ============================================================
|
|
5
|
+
//
|
|
6
|
+
// `saturate(state)` aplica las reglas R1-R10 en forward-chaining
|
|
7
|
+
// hasta punto fijo (o cota de iteraciones). Devuelve la lista de
|
|
8
|
+
// fórmulas inferidas en orden de derivación (trace).
|
|
9
|
+
//
|
|
10
|
+
// `analyzeProtocol(p)` toma un Protocol con assumptions, steps y goals;
|
|
11
|
+
// idealiza los mensajes (cada step produce `P ◁ msg` para el receptor),
|
|
12
|
+
// satura, y reporta cuáles goals quedaron satisfechos.
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.saturate = saturate;
|
|
15
|
+
exports.idealize = idealize;
|
|
16
|
+
exports.analyzeProtocol = analyzeProtocol;
|
|
17
|
+
const rules_1 = require("./rules");
|
|
18
|
+
const terms_1 = require("./terms");
|
|
19
|
+
const STATE_RULES = [
|
|
20
|
+
{ name: 'message-meaning-shared', apply: rules_1.applyMessageMeaningShared },
|
|
21
|
+
{ name: 'message-meaning-public', apply: rules_1.applyMessageMeaningPublic },
|
|
22
|
+
{ name: 'message-meaning-secret', apply: rules_1.applyMessageMeaningSecret },
|
|
23
|
+
{ name: 'nonce-verification', apply: rules_1.applyNonceVerification },
|
|
24
|
+
{ name: 'jurisdiction', apply: rules_1.applyJurisdiction },
|
|
25
|
+
{ name: 'seeing-encrypted', apply: rules_1.applySeeingEncrypted },
|
|
26
|
+
{ name: 'sees-compound', apply: rules_1.applySeesCompound },
|
|
27
|
+
{ name: 'freshness-propagation', apply: rules_1.applyFreshnessPropagation },
|
|
28
|
+
];
|
|
29
|
+
const FOCUS_ONLY_RULES = [
|
|
30
|
+
{ name: 'belief-conj-left', apply: rules_1.applyBeliefConjunction },
|
|
31
|
+
{ name: 'belief-conj-right', apply: rules_1.applyBeliefConjunctionRight },
|
|
32
|
+
{ name: 'said-conj', apply: rules_1.applySaidConjunction },
|
|
33
|
+
];
|
|
34
|
+
/**
|
|
35
|
+
* Aplica las reglas BAN al estado hasta punto fijo. Devuelve el estado
|
|
36
|
+
* saturado y la lista de derivaciones nuevas (no incluye las iniciales).
|
|
37
|
+
*/
|
|
38
|
+
function saturate(initial, opts) {
|
|
39
|
+
const maxIter = opts?.maxIterations ?? 200;
|
|
40
|
+
const maxDeriv = opts?.maxDerivations ?? 1024;
|
|
41
|
+
const state = [];
|
|
42
|
+
const trace = [];
|
|
43
|
+
const tryAdd = (f) => {
|
|
44
|
+
if (state.some((g) => (0, terms_1.formulaEquals)(g, f)))
|
|
45
|
+
return false;
|
|
46
|
+
state.push(f);
|
|
47
|
+
return true;
|
|
48
|
+
};
|
|
49
|
+
for (const f of initial)
|
|
50
|
+
tryAdd(f);
|
|
51
|
+
let iter = 0;
|
|
52
|
+
let changed = true;
|
|
53
|
+
while (changed && iter < maxIter && trace.length < maxDeriv) {
|
|
54
|
+
changed = false;
|
|
55
|
+
iter++;
|
|
56
|
+
// Snapshot del estado para iterar de forma estable.
|
|
57
|
+
const snapshot = state.slice();
|
|
58
|
+
for (const focus of snapshot) {
|
|
59
|
+
// Reglas state+focus.
|
|
60
|
+
for (const rule of STATE_RULES) {
|
|
61
|
+
const out = rule.apply(snapshot, focus);
|
|
62
|
+
if (out && tryAdd(out)) {
|
|
63
|
+
trace.push(out);
|
|
64
|
+
changed = true;
|
|
65
|
+
if (trace.length >= maxDeriv)
|
|
66
|
+
return { state, trace };
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
// Reglas focus-only.
|
|
70
|
+
for (const rule of FOCUS_ONLY_RULES) {
|
|
71
|
+
const out = rule.apply(focus);
|
|
72
|
+
if (out && tryAdd(out)) {
|
|
73
|
+
trace.push(out);
|
|
74
|
+
changed = true;
|
|
75
|
+
if (trace.length >= maxDeriv)
|
|
76
|
+
return { state, trace };
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return { state, trace };
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Idealización mínima: cada step `from → to: msg` produce la
|
|
85
|
+
* fórmula `to ◁ msg`. Asumimos que el receptor literalmente ve el
|
|
86
|
+
* mensaje que se le envía.
|
|
87
|
+
*
|
|
88
|
+
* (BAN tradicional pide idealización manual para descartar texto
|
|
89
|
+
* inseguro como nombres en claro; aquí preservamos todos los
|
|
90
|
+
* subtérminos, que es la lectura conservadora.)
|
|
91
|
+
*/
|
|
92
|
+
function idealize(p) {
|
|
93
|
+
return p.steps.map((s) => (0, terms_1.sees)((0, terms_1.principal)(s.to), s.message));
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Analiza un protocolo: parte de las assumptions + idealización,
|
|
97
|
+
* satura, y verifica goals.
|
|
98
|
+
*/
|
|
99
|
+
function analyzeProtocol(p, opts) {
|
|
100
|
+
const idealized = idealize(p);
|
|
101
|
+
const initial = [...p.initialAssumptions, ...idealized];
|
|
102
|
+
const { state, trace } = saturate(initial, opts);
|
|
103
|
+
const satisfied = [];
|
|
104
|
+
const unsatisfied = [];
|
|
105
|
+
for (const g of p.goals) {
|
|
106
|
+
if ((0, terms_1.hasFormula)(state, g))
|
|
107
|
+
satisfied.push(g);
|
|
108
|
+
else
|
|
109
|
+
unsatisfied.push(g);
|
|
110
|
+
}
|
|
111
|
+
return { satisfied, unsatisfied, trace };
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=analyze.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analyze.js","sourceRoot":"","sources":["../../../src/reasoning/ban-logic/analyze.ts"],"names":[],"mappings":";AAAA,+DAA+D;AAC/D,4DAA4D;AAC5D,+DAA+D;AAC/D,EAAE;AACF,iEAAiE;AACjE,iEAAiE;AACjE,qDAAqD;AACrD,EAAE;AACF,wEAAwE;AACxE,wEAAwE;AACxE,uDAAuD;;AAmDvD,4BA+CC;AAWD,4BAEC;AAMD,0CAYC;AA/HD,mCAYiB;AACjB,mCAAqE;AAerE,MAAM,WAAW,GAAmB;IAClC,EAAE,IAAI,EAAE,wBAAwB,EAAE,KAAK,EAAE,iCAAyB,EAAE;IACpE,EAAE,IAAI,EAAE,wBAAwB,EAAE,KAAK,EAAE,iCAAyB,EAAE;IACpE,EAAE,IAAI,EAAE,wBAAwB,EAAE,KAAK,EAAE,iCAAyB,EAA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AAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,YAAI,EAAC,IAAA,iBAAS,EAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;AAC9D,CAAC;AAED;;;GAGG;AACH,SAAgB,eAAe,CAAC,CAAW,EAAE,IAAsB;IACjE,MAAM,SAAS,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC9B,MAAM,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC,kBAAkB,EAAE,GAAG,SAAS,CAAC,CAAC;IACxD,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAEjD,MAAM,SAAS,GAAiB,EAAE,CAAC;IACnC,MAAM,WAAW,GAAiB,EAAE,CAAC;IACrC,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC;QACxB,IAAI,IAAA,kBAAU,EAAC,KAAK,EAAE,CAAC,CAAC;YAAE,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;;YACvC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IACD,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC;AAC3C,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type { BANFormula, BANRule, BANTerm, Protocol, ProtocolAnalysis, ProtocolStep, } from './types';
|
|
2
|
+
export { atom, compound, encrypted, hashed, key, message, nonce, principal, believes, controls, formulaAnd, fresh, jurisdiction, publicKey, said, saidMessage, sees, sharedKey, sharedSecret, formulaEquals, formulaToString, hasFormula, termEquals, termToString, } from './terms';
|
|
3
|
+
export { applyBeliefConjunction, applyBeliefConjunctionRight, applyFreshnessPropagation, applyJurisdiction, applyMessageMeaningPublic, applyMessageMeaningSecret, applyMessageMeaningShared, applyNonceVerification, applySaidConjunction, applySeeingEncrypted, applySeesCompound, RULES_REGISTRY, } from './rules';
|
|
4
|
+
export type { SaturateOptions } from './analyze';
|
|
5
|
+
export { analyzeProtocol, idealize, saturate } from './analyze';
|
|
6
|
+
export { kerberos, needhamSchroederPublicKey, needhamSchroederSymmetric } from './protocols';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/reasoning/ban-logic/index.ts"],"names":[],"mappings":"AAcA,YAAY,EACV,UAAU,EACV,OAAO,EACP,OAAO,EACP,QAAQ,EACR,gBAAgB,EAChB,YAAY,GACb,MAAM,SAAS,CAAC;AAEjB,OAAO,EAEL,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,MAAM,EACN,GAAG,EACH,OAAO,EACP,KAAK,EACL,SAAS,EAET,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,KAAK,EACL,YAAY,EACZ,SAAS,EACT,IAAI,EACJ,WAAW,EACX,IAAI,EACJ,SAAS,EACT,YAAY,EAEZ,aAAa,EACb,eAAe,EACf,UAAU,EACV,UAAU,EACV,YAAY,GACb,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,sBAAsB,EACtB,2BAA2B,EAC3B,yBAAyB,EACzB,iBAAiB,EACjB,yBAAyB,EACzB,yBAAyB,EACzB,yBAAyB,EACzB,sBAAsB,EACtB,oBAAoB,EACpB,oBAAoB,EACpB,iBAAiB,EACjB,cAAc,GACf,MAAM,SAAS,CAAC;AAEjB,YAAY,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAEhE,OAAO,EAAE,QAAQ,EAAE,yBAAyB,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// ============================================================
|
|
3
|
+
// BAN Logic — Barrel export
|
|
4
|
+
// ============================================================
|
|
5
|
+
//
|
|
6
|
+
// Burrows-Abadi-Needham logic para verificación de protocolos
|
|
7
|
+
// criptográficos de autenticación.
|
|
8
|
+
//
|
|
9
|
+
// API pública:
|
|
10
|
+
// - Constructores de términos y fórmulas (`principal`, `key`, ...)
|
|
11
|
+
// - Reglas de inferencia (R1-R10 y variantes)
|
|
12
|
+
// - `saturate(initial)` para cerrar un estado bajo las reglas
|
|
13
|
+
// - `analyzeProtocol(p)` para evaluar goals de un Protocol
|
|
14
|
+
// - Protocolos pre-armados: Needham-Schroeder symmetric / PK / Kerberos
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.needhamSchroederSymmetric = exports.needhamSchroederPublicKey = exports.kerberos = exports.saturate = exports.idealize = exports.analyzeProtocol = exports.RULES_REGISTRY = exports.applySeesCompound = exports.applySeeingEncrypted = exports.applySaidConjunction = exports.applyNonceVerification = exports.applyMessageMeaningShared = exports.applyMessageMeaningSecret = exports.applyMessageMeaningPublic = exports.applyJurisdiction = exports.applyFreshnessPropagation = exports.applyBeliefConjunctionRight = exports.applyBeliefConjunction = exports.termToString = exports.termEquals = exports.hasFormula = exports.formulaToString = exports.formulaEquals = exports.sharedSecret = exports.sharedKey = exports.sees = exports.saidMessage = exports.said = exports.publicKey = exports.jurisdiction = exports.fresh = exports.formulaAnd = exports.controls = exports.believes = exports.principal = exports.nonce = exports.message = exports.key = exports.hashed = exports.encrypted = exports.compound = exports.atom = void 0;
|
|
17
|
+
var terms_1 = require("./terms");
|
|
18
|
+
// Constructores de términos
|
|
19
|
+
Object.defineProperty(exports, "atom", { enumerable: true, get: function () { return terms_1.atom; } });
|
|
20
|
+
Object.defineProperty(exports, "compound", { enumerable: true, get: function () { return terms_1.compound; } });
|
|
21
|
+
Object.defineProperty(exports, "encrypted", { enumerable: true, get: function () { return terms_1.encrypted; } });
|
|
22
|
+
Object.defineProperty(exports, "hashed", { enumerable: true, get: function () { return terms_1.hashed; } });
|
|
23
|
+
Object.defineProperty(exports, "key", { enumerable: true, get: function () { return terms_1.key; } });
|
|
24
|
+
Object.defineProperty(exports, "message", { enumerable: true, get: function () { return terms_1.message; } });
|
|
25
|
+
Object.defineProperty(exports, "nonce", { enumerable: true, get: function () { return terms_1.nonce; } });
|
|
26
|
+
Object.defineProperty(exports, "principal", { enumerable: true, get: function () { return terms_1.principal; } });
|
|
27
|
+
// Constructores de fórmulas
|
|
28
|
+
Object.defineProperty(exports, "believes", { enumerable: true, get: function () { return terms_1.believes; } });
|
|
29
|
+
Object.defineProperty(exports, "controls", { enumerable: true, get: function () { return terms_1.controls; } });
|
|
30
|
+
Object.defineProperty(exports, "formulaAnd", { enumerable: true, get: function () { return terms_1.formulaAnd; } });
|
|
31
|
+
Object.defineProperty(exports, "fresh", { enumerable: true, get: function () { return terms_1.fresh; } });
|
|
32
|
+
Object.defineProperty(exports, "jurisdiction", { enumerable: true, get: function () { return terms_1.jurisdiction; } });
|
|
33
|
+
Object.defineProperty(exports, "publicKey", { enumerable: true, get: function () { return terms_1.publicKey; } });
|
|
34
|
+
Object.defineProperty(exports, "said", { enumerable: true, get: function () { return terms_1.said; } });
|
|
35
|
+
Object.defineProperty(exports, "saidMessage", { enumerable: true, get: function () { return terms_1.saidMessage; } });
|
|
36
|
+
Object.defineProperty(exports, "sees", { enumerable: true, get: function () { return terms_1.sees; } });
|
|
37
|
+
Object.defineProperty(exports, "sharedKey", { enumerable: true, get: function () { return terms_1.sharedKey; } });
|
|
38
|
+
Object.defineProperty(exports, "sharedSecret", { enumerable: true, get: function () { return terms_1.sharedSecret; } });
|
|
39
|
+
// Equality + printing
|
|
40
|
+
Object.defineProperty(exports, "formulaEquals", { enumerable: true, get: function () { return terms_1.formulaEquals; } });
|
|
41
|
+
Object.defineProperty(exports, "formulaToString", { enumerable: true, get: function () { return terms_1.formulaToString; } });
|
|
42
|
+
Object.defineProperty(exports, "hasFormula", { enumerable: true, get: function () { return terms_1.hasFormula; } });
|
|
43
|
+
Object.defineProperty(exports, "termEquals", { enumerable: true, get: function () { return terms_1.termEquals; } });
|
|
44
|
+
Object.defineProperty(exports, "termToString", { enumerable: true, get: function () { return terms_1.termToString; } });
|
|
45
|
+
var rules_1 = require("./rules");
|
|
46
|
+
Object.defineProperty(exports, "applyBeliefConjunction", { enumerable: true, get: function () { return rules_1.applyBeliefConjunction; } });
|
|
47
|
+
Object.defineProperty(exports, "applyBeliefConjunctionRight", { enumerable: true, get: function () { return rules_1.applyBeliefConjunctionRight; } });
|
|
48
|
+
Object.defineProperty(exports, "applyFreshnessPropagation", { enumerable: true, get: function () { return rules_1.applyFreshnessPropagation; } });
|
|
49
|
+
Object.defineProperty(exports, "applyJurisdiction", { enumerable: true, get: function () { return rules_1.applyJurisdiction; } });
|
|
50
|
+
Object.defineProperty(exports, "applyMessageMeaningPublic", { enumerable: true, get: function () { return rules_1.applyMessageMeaningPublic; } });
|
|
51
|
+
Object.defineProperty(exports, "applyMessageMeaningSecret", { enumerable: true, get: function () { return rules_1.applyMessageMeaningSecret; } });
|
|
52
|
+
Object.defineProperty(exports, "applyMessageMeaningShared", { enumerable: true, get: function () { return rules_1.applyMessageMeaningShared; } });
|
|
53
|
+
Object.defineProperty(exports, "applyNonceVerification", { enumerable: true, get: function () { return rules_1.applyNonceVerification; } });
|
|
54
|
+
Object.defineProperty(exports, "applySaidConjunction", { enumerable: true, get: function () { return rules_1.applySaidConjunction; } });
|
|
55
|
+
Object.defineProperty(exports, "applySeeingEncrypted", { enumerable: true, get: function () { return rules_1.applySeeingEncrypted; } });
|
|
56
|
+
Object.defineProperty(exports, "applySeesCompound", { enumerable: true, get: function () { return rules_1.applySeesCompound; } });
|
|
57
|
+
Object.defineProperty(exports, "RULES_REGISTRY", { enumerable: true, get: function () { return rules_1.RULES_REGISTRY; } });
|
|
58
|
+
var analyze_1 = require("./analyze");
|
|
59
|
+
Object.defineProperty(exports, "analyzeProtocol", { enumerable: true, get: function () { return analyze_1.analyzeProtocol; } });
|
|
60
|
+
Object.defineProperty(exports, "idealize", { enumerable: true, get: function () { return analyze_1.idealize; } });
|
|
61
|
+
Object.defineProperty(exports, "saturate", { enumerable: true, get: function () { return analyze_1.saturate; } });
|
|
62
|
+
var protocols_1 = require("./protocols");
|
|
63
|
+
Object.defineProperty(exports, "kerberos", { enumerable: true, get: function () { return protocols_1.kerberos; } });
|
|
64
|
+
Object.defineProperty(exports, "needhamSchroederPublicKey", { enumerable: true, get: function () { return protocols_1.needhamSchroederPublicKey; } });
|
|
65
|
+
Object.defineProperty(exports, "needhamSchroederSymmetric", { enumerable: true, get: function () { return protocols_1.needhamSchroederSymmetric; } });
|
|
66
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/reasoning/ban-logic/index.ts"],"names":[],"mappings":";AAAA,+DAA+D;AAC/D,4BAA4B;AAC5B,+DAA+D;AAC/D,EAAE;AACF,8DAA8D;AAC9D,mCAAmC;AACnC,EAAE;AACF,eAAe;AACf,qEAAqE;AACrE,gDAAgD;AAChD,gEAAgE;AAChE,6DAA6D;AAC7D,0EAA0E;;;AAW1E,iCA4BiB;AA3Bf,4BAA4B;AAC5B,6FAAA,IAAI,OAAA;AACJ,iGAAA,QAAQ,OAAA;AACR,kGAAA,SAAS,OAAA;AACT,+FAAA,MAAM,OAAA;AACN,4FAAA,GAAG,OAAA;AACH,gGAAA,OAAO,OAAA;AACP,8FAAA,KAAK,OAAA;AACL,kGAAA,SAAS,OAAA;AACT,4BAA4B;AAC5B,iGAAA,QAAQ,OAAA;AACR,iGAAA,QAAQ,OAAA;AACR,mGAAA,UAAU,OAAA;AACV,8FAAA,KAAK,OAAA;AACL,qGAAA,YAAY,OAAA;AACZ,kGAAA,SAAS,OAAA;AACT,6FAAA,IAAI,OAAA;AACJ,oGAAA,WAAW,OAAA;AACX,6FAAA,IAAI,OAAA;AACJ,kGAAA,SAAS,OAAA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