@stevenvo780/st-lang 2.5.1 → 2.6.1
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/bin/st +0 -0
- package/dist/cli/index.js +12 -2
- package/dist/cli/index.js.map +1 -1
- package/dist/profiles/arithmetic/index.d.ts.map +1 -1
- package/dist/profiles/arithmetic/index.js +6 -18
- package/dist/profiles/arithmetic/index.js.map +1 -1
- package/dist/profiles/classical/first-order.d.ts +2 -3
- package/dist/profiles/classical/first-order.d.ts.map +1 -1
- package/dist/profiles/classical/first-order.js +42 -396
- package/dist/profiles/classical/first-order.js.map +1 -1
- package/dist/profiles/classical/propositional.d.ts +1 -0
- package/dist/profiles/classical/propositional.d.ts.map +1 -1
- package/dist/profiles/classical/propositional.js +30 -9
- package/dist/profiles/classical/propositional.js.map +1 -1
- package/dist/profiles/intuitionistic/propositional.d.ts +1 -2
- package/dist/profiles/intuitionistic/propositional.d.ts.map +1 -1
- package/dist/profiles/intuitionistic/propositional.js +18 -14
- package/dist/profiles/intuitionistic/propositional.js.map +1 -1
- package/dist/profiles/paraconsistent/belnap.d.ts +0 -2
- package/dist/profiles/paraconsistent/belnap.d.ts.map +1 -1
- package/dist/profiles/paraconsistent/belnap.js +33 -33
- package/dist/profiles/paraconsistent/belnap.js.map +1 -1
- package/dist/profiles/probabilistic/basic.d.ts.map +1 -1
- package/dist/profiles/probabilistic/basic.js +6 -17
- package/dist/profiles/probabilistic/basic.js.map +1 -1
- package/dist/profiles/shared/tableau-engine.d.ts.map +1 -1
- package/dist/profiles/shared/tableau-engine.js +27 -0
- package/dist/profiles/shared/tableau-engine.js.map +1 -1
- package/dist/runtime/interpreter.d.ts +4 -4
- package/dist/runtime/interpreter.d.ts.map +1 -1
- package/dist/runtime/interpreter.js +197 -475
- package/dist/runtime/interpreter.js.map +1 -1
- package/dist/tests/limits.test.d.ts +2 -0
- package/dist/tests/limits.test.d.ts.map +1 -0
- package/dist/tests/limits.test.js +198 -0
- package/dist/tests/limits.test.js.map +1 -0
- package/dist/tests/profiles.test.js +14 -6
- package/dist/tests/profiles.test.js.map +1 -1
- package/dist/utils/memo.d.ts +9 -0
- package/dist/utils/memo.d.ts.map +1 -0
- package/dist/utils/memo.js +43 -0
- package/dist/utils/memo.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.memoizeString = memoizeString;
|
|
4
|
+
exports.memoizeHash = memoizeHash;
|
|
5
|
+
exports.memoizeAtoms = memoizeAtoms;
|
|
6
|
+
/**
|
|
7
|
+
* Cache central para derivaciones y operaciones frecuentes sobre AST.
|
|
8
|
+
* ST genera fórmulas inmutables en su mayoría, por lo que podemos usar
|
|
9
|
+
* la referencia del objeto Formula como clave en un WeakMap, evitando
|
|
10
|
+
* pérdidas de memoria y logrando cacheo O(1).
|
|
11
|
+
*/
|
|
12
|
+
const stringCache = new WeakMap();
|
|
13
|
+
const hashCache = new WeakMap();
|
|
14
|
+
const atomsCache = new WeakMap();
|
|
15
|
+
/**
|
|
16
|
+
* Función genérica de memoización para operaciones que toman FormData y
|
|
17
|
+
* devuelven un string.
|
|
18
|
+
*/
|
|
19
|
+
function memoizeString(f, compute) {
|
|
20
|
+
let cached = stringCache.get(f);
|
|
21
|
+
if (cached !== undefined)
|
|
22
|
+
return cached;
|
|
23
|
+
cached = compute(f);
|
|
24
|
+
stringCache.set(f, cached);
|
|
25
|
+
return cached;
|
|
26
|
+
}
|
|
27
|
+
function memoizeHash(f, compute) {
|
|
28
|
+
let cached = hashCache.get(f);
|
|
29
|
+
if (cached !== undefined)
|
|
30
|
+
return cached;
|
|
31
|
+
cached = compute(f);
|
|
32
|
+
hashCache.set(f, cached);
|
|
33
|
+
return cached;
|
|
34
|
+
}
|
|
35
|
+
function memoizeAtoms(f, compute) {
|
|
36
|
+
let cached = atomsCache.get(f);
|
|
37
|
+
if (cached !== undefined)
|
|
38
|
+
return cached;
|
|
39
|
+
cached = compute(f);
|
|
40
|
+
atomsCache.set(f, cached);
|
|
41
|
+
return cached;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=memo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memo.js","sourceRoot":"","sources":["../../src/utils/memo.ts"],"names":[],"mappings":";;AAiBA,sCAMC;AAED,kCAMC;AAED,oCAMC;AArCD;;;;;GAKG;AAEH,MAAM,WAAW,GAAG,IAAI,OAAO,EAAmB,CAAC;AACnD,MAAM,SAAS,GAAG,IAAI,OAAO,EAAmB,CAAC;AACjD,MAAM,UAAU,GAAG,IAAI,OAAO,EAAwB,CAAC;AAEvD;;;GAGG;AACH,SAAgB,aAAa,CAAC,CAAU,EAAE,OAA+B;IACvE,IAAI,MAAM,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAChC,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,MAAM,CAAC;IACxC,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACpB,WAAW,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IAC3B,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAgB,WAAW,CAAC,CAAU,EAAE,OAA+B;IACrE,IAAI,MAAM,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAC9B,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,MAAM,CAAC;IACxC,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACpB,SAAS,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IACzB,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAgB,YAAY,CAAC,CAAU,EAAE,OAAoC;IAC3E,IAAI,MAAM,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAC/B,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,MAAM,CAAC;IACxC,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACpB,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IAC1B,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stevenvo780/st-lang",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.1",
|
|
4
4
|
"description": "ST — Lenguaje ejecutable con nucleo logico y capa textual. Motor multi-perfil (11 lógicas), derivaciones, tablas de verdad, contramodelos, aliases modales, Belnap 4-valores y capa textual para formalización de documentos.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|