@stevenvo780/st-lang 2.7.1 → 3.0.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/ast/nodes.d.ts +35 -2
- package/dist/ast/nodes.d.ts.map +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -1
- package/dist/index.js.map +1 -1
- package/dist/lexer/lexer.d.ts.map +1 -1
- package/dist/lexer/lexer.js +4 -0
- package/dist/lexer/lexer.js.map +1 -1
- package/dist/lexer/tokens.d.ts +8 -0
- package/dist/lexer/tokens.d.ts.map +1 -1
- package/dist/lexer/tokens.js +23 -0
- package/dist/lexer/tokens.js.map +1 -1
- package/dist/parser/parser.d.ts +6 -0
- package/dist/parser/parser.d.ts.map +1 -1
- package/dist/parser/parser.js +171 -6
- package/dist/parser/parser.js.map +1 -1
- package/dist/profiles/classical/cdcl.d.ts +34 -0
- package/dist/profiles/classical/cdcl.d.ts.map +1 -0
- package/dist/profiles/classical/cdcl.js +843 -0
- package/dist/profiles/classical/cdcl.js.map +1 -0
- package/dist/profiles/classical/dpll.d.ts +11 -1
- package/dist/profiles/classical/dpll.d.ts.map +1 -1
- package/dist/profiles/classical/dpll.js +54 -17
- package/dist/profiles/classical/dpll.js.map +1 -1
- package/dist/profiles/classical/first-order.d.ts.map +1 -1
- package/dist/profiles/classical/first-order.js +20 -10
- package/dist/profiles/classical/first-order.js.map +1 -1
- package/dist/profiles/classical/parallel-sat.d.ts +62 -0
- package/dist/profiles/classical/parallel-sat.d.ts.map +1 -0
- package/dist/profiles/classical/parallel-sat.js +630 -0
- package/dist/profiles/classical/parallel-sat.js.map +1 -0
- package/dist/profiles/classical/propositional.d.ts.map +1 -1
- package/dist/profiles/classical/propositional.js +35 -19
- package/dist/profiles/classical/propositional.js.map +1 -1
- package/dist/profiles/classical/sat-preprocess.d.ts +17 -0
- package/dist/profiles/classical/sat-preprocess.d.ts.map +1 -0
- package/dist/profiles/classical/sat-preprocess.js +372 -0
- package/dist/profiles/classical/sat-preprocess.js.map +1 -0
- package/dist/profiles/classical/undecidability-detector.d.ts +13 -0
- package/dist/profiles/classical/undecidability-detector.d.ts.map +1 -0
- package/dist/profiles/classical/undecidability-detector.js +277 -0
- package/dist/profiles/classical/undecidability-detector.js.map +1 -0
- package/dist/profiles/paraconsistent/belnap.d.ts.map +1 -1
- package/dist/profiles/paraconsistent/belnap.js +4 -2
- package/dist/profiles/paraconsistent/belnap.js.map +1 -1
- package/dist/profiles/shared/tableau-engine.d.ts.map +1 -1
- package/dist/profiles/shared/tableau-engine.js +3 -1
- package/dist/profiles/shared/tableau-engine.js.map +1 -1
- package/dist/protocol/handler.d.ts.map +1 -1
- package/dist/protocol/handler.js +327 -88
- package/dist/protocol/handler.js.map +1 -1
- package/dist/runtime/formula-factory.d.ts.map +1 -1
- package/dist/runtime/formula-factory.js +3 -2
- package/dist/runtime/formula-factory.js.map +1 -1
- package/dist/runtime/interpreter.d.ts +33 -0
- package/dist/runtime/interpreter.d.ts.map +1 -1
- package/dist/runtime/interpreter.js +516 -5
- package/dist/runtime/interpreter.js.map +1 -1
- package/dist/tests/benchmark-cdcl.test.d.ts +2 -0
- package/dist/tests/benchmark-cdcl.test.d.ts.map +1 -0
- package/dist/tests/benchmark-cdcl.test.js +172 -0
- package/dist/tests/benchmark-cdcl.test.js.map +1 -0
- package/dist/tests/limits.test.js +11 -4
- package/dist/tests/limits.test.js.map +1 -1
- package/dist/tests/parallel-sat.test.d.ts +2 -0
- package/dist/tests/parallel-sat.test.d.ts.map +1 -0
- package/dist/tests/parallel-sat.test.js +351 -0
- package/dist/tests/parallel-sat.test.js.map +1 -0
- package/dist/tests/stress-cdcl.test.d.ts +2 -0
- package/dist/tests/stress-cdcl.test.d.ts.map +1 -0
- package/dist/tests/stress-cdcl.test.js +792 -0
- package/dist/tests/stress-cdcl.test.js.map +1 -0
- package/dist/tests/stress-extreme.test.d.ts +2 -0
- package/dist/tests/stress-extreme.test.d.ts.map +1 -0
- package/dist/tests/stress-extreme.test.js +1005 -0
- package/dist/tests/stress-extreme.test.js.map +1 -0
- package/dist/tests/v3-features.test.d.ts +2 -0
- package/dist/tests/v3-features.test.d.ts.map +1 -0
- package/dist/tests/v3-features.test.js +529 -0
- package/dist/tests/v3-features.test.js.map +1 -0
- package/dist/tests/v3-stress.test.d.ts +2 -0
- package/dist/tests/v3-stress.test.d.ts.map +1 -0
- package/dist/tests/v3-stress.test.js +755 -0
- package/dist/tests/v3-stress.test.js.map +1 -0
- package/dist/text-layer/compiler.d.ts +4 -1
- package/dist/text-layer/compiler.d.ts.map +1 -1
- package/dist/text-layer/compiler.js +35 -0
- package/dist/text-layer/compiler.js.map +1 -1
- package/dist/types/index.d.ts +27 -1
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,630 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// ============================================================
|
|
3
|
+
// Parallel SAT Solver — Portfolio Racing con Workers
|
|
4
|
+
// Compatible con Node.js (worker_threads) y Browser (Web Workers)
|
|
5
|
+
// ============================================================
|
|
6
|
+
//
|
|
7
|
+
// Estrategia: lanza N workers con el mismo problema pero diferentes
|
|
8
|
+
// heurísticas (semillas VSIDS, políticas de restart, etc).
|
|
9
|
+
// El primero que resuelva gana; los demás se terminan.
|
|
10
|
+
//
|
|
11
|
+
// Fallback: si workers no están disponibles, ejecuta secuencialmente.
|
|
12
|
+
// ============================================================
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.MAX_WORKERS = exports.PARALLEL_THRESHOLD = void 0;
|
|
15
|
+
exports.packClauses = packClauses;
|
|
16
|
+
exports.unpackClauses = unpackClauses;
|
|
17
|
+
exports.workersAvailable = workersAvailable;
|
|
18
|
+
exports.parallelSolve = parallelSolve;
|
|
19
|
+
exports.tryParallelSolve = tryParallelSolve;
|
|
20
|
+
// ── Serialización de cláusulas ──────────────────────────────
|
|
21
|
+
/**
|
|
22
|
+
* Empaqueta un array de Int32Array clauses en un solo buffer plano.
|
|
23
|
+
* Formato: [clauseLen, lit1, lit2, ..., clauseLen, lit1, ...]
|
|
24
|
+
* Esto permite pasar por SharedArrayBuffer o structured clone sin overhead.
|
|
25
|
+
*/
|
|
26
|
+
function packClauses(clauses) {
|
|
27
|
+
let totalLen = 0;
|
|
28
|
+
for (const c of clauses)
|
|
29
|
+
totalLen += 1 + c.length;
|
|
30
|
+
const packed = new Int32Array(totalLen);
|
|
31
|
+
let offset = 0;
|
|
32
|
+
for (const c of clauses) {
|
|
33
|
+
packed[offset++] = c.length;
|
|
34
|
+
for (let i = 0; i < c.length; i++)
|
|
35
|
+
packed[offset++] = c[i];
|
|
36
|
+
}
|
|
37
|
+
return packed;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Desempaqueta un buffer plano de vuelta a Int32Array[].
|
|
41
|
+
*/
|
|
42
|
+
function unpackClauses(packed) {
|
|
43
|
+
const clauses = [];
|
|
44
|
+
let offset = 0;
|
|
45
|
+
while (offset < packed.length) {
|
|
46
|
+
const len = packed[offset++];
|
|
47
|
+
clauses.push(packed.slice(offset, offset + len));
|
|
48
|
+
offset += len;
|
|
49
|
+
}
|
|
50
|
+
return clauses;
|
|
51
|
+
}
|
|
52
|
+
let _workersAvailable = null;
|
|
53
|
+
/**
|
|
54
|
+
* Comprueba si el entorno soporta workers.
|
|
55
|
+
*/
|
|
56
|
+
function workersAvailable() {
|
|
57
|
+
if (_workersAvailable !== null)
|
|
58
|
+
return _workersAvailable;
|
|
59
|
+
try {
|
|
60
|
+
// Node.js — verificar worker_threads sin require()
|
|
61
|
+
if (typeof process !== 'undefined' && process.versions?.node) {
|
|
62
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
63
|
+
require('worker_threads');
|
|
64
|
+
_workersAvailable = true;
|
|
65
|
+
return true;
|
|
66
|
+
}
|
|
67
|
+
// Browser
|
|
68
|
+
if (typeof globalThis !== 'undefined' && 'Worker' in globalThis) {
|
|
69
|
+
_workersAvailable = true;
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
catch {
|
|
74
|
+
// worker_threads no disponible (browser bundle sin polyfill, etc.)
|
|
75
|
+
}
|
|
76
|
+
_workersAvailable = false;
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
// ── Código inline del Worker ────────────────────────────────
|
|
80
|
+
// Este string contiene el solver completo self-contained.
|
|
81
|
+
// Se evalúa dentro del worker sin necesidad de importar módulos.
|
|
82
|
+
// ─────────────────────────────────────────────────────────────
|
|
83
|
+
function getWorkerCode() {
|
|
84
|
+
return `
|
|
85
|
+
'use strict';
|
|
86
|
+
|
|
87
|
+
// ── Worker SAT Solver (self-contained) ──
|
|
88
|
+
|
|
89
|
+
function litToIdx(lit, nv) {
|
|
90
|
+
return lit > 0 ? lit - 1 : nv + (-lit) - 1;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function luby(i) {
|
|
94
|
+
let size = 1, seq = 0;
|
|
95
|
+
while (size < i + 1) size = 2 * size + 1;
|
|
96
|
+
while (size - 1 !== i) { size = (size - 1) >> 1; seq++; if (i >= size) i -= size; }
|
|
97
|
+
return 1 << seq;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function unpackClauses(packed) {
|
|
101
|
+
const clauses = [];
|
|
102
|
+
let offset = 0;
|
|
103
|
+
while (offset < packed.length) {
|
|
104
|
+
const len = packed[offset++];
|
|
105
|
+
clauses.push(packed.slice(offset, offset + len));
|
|
106
|
+
offset += len;
|
|
107
|
+
}
|
|
108
|
+
return clauses;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function workerSolve(task) {
|
|
112
|
+
const { clauseData, numVars, atomNames, timeoutMs, heuristicSeed, restartPolicy } = task;
|
|
113
|
+
const startTime = Date.now();
|
|
114
|
+
|
|
115
|
+
const allClauses = unpackClauses(new Int32Array(clauseData));
|
|
116
|
+
const originalCount = allClauses.length;
|
|
117
|
+
|
|
118
|
+
const stats = {
|
|
119
|
+
decisions: 0, propagations: 0, conflicts: 0,
|
|
120
|
+
learnedClauses: 0, restarts: 0, preprocessEliminated: 0, solveTimeMs: 0,
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
if (allClauses.length === 0) {
|
|
124
|
+
const model = {};
|
|
125
|
+
for (let i = 0; i < atomNames.length && i < numVars; i++) model[atomNames[i]] = true;
|
|
126
|
+
stats.solveTimeMs = Date.now() - startTime;
|
|
127
|
+
return { satisfiable: true, model, stats };
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// Detect empty clause
|
|
131
|
+
for (const c of allClauses) {
|
|
132
|
+
if (c.length === 0) {
|
|
133
|
+
stats.solveTimeMs = Date.now() - startTime;
|
|
134
|
+
return { satisfiable: false, stats };
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
const varVal = new Int8Array(numVars + 1);
|
|
139
|
+
const varLevel = new Int32Array(numVars + 1).fill(-1);
|
|
140
|
+
const varAnte = new Int32Array(numVars + 1).fill(-1);
|
|
141
|
+
const trail = [];
|
|
142
|
+
const trailLim = [];
|
|
143
|
+
let qHead = 0;
|
|
144
|
+
const phase = new Int8Array(numVars + 1);
|
|
145
|
+
|
|
146
|
+
// Watched literals
|
|
147
|
+
const watchSize = 2 * numVars;
|
|
148
|
+
const watches = new Array(watchSize);
|
|
149
|
+
|
|
150
|
+
function rebuildWatches() {
|
|
151
|
+
for (let i = 0; i < watchSize; i++) watches[i] = [];
|
|
152
|
+
for (let ci = 0; ci < allClauses.length; ci++) {
|
|
153
|
+
const c = allClauses[ci];
|
|
154
|
+
if (c.length >= 2) {
|
|
155
|
+
watches[litToIdx(c[0], numVars)].push(ci);
|
|
156
|
+
watches[litToIdx(c[1], numVars)].push(ci);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
rebuildWatches();
|
|
161
|
+
|
|
162
|
+
// VSIDS with seeded initial activity
|
|
163
|
+
const activity = new Float64Array(numVars + 1);
|
|
164
|
+
let varInc = 1.0;
|
|
165
|
+
const VAR_DECAY = 0.95;
|
|
166
|
+
|
|
167
|
+
for (const c of allClauses) {
|
|
168
|
+
for (let i = 0; i < c.length; i++) activity[Math.abs(c[i])] += 1.0;
|
|
169
|
+
}
|
|
170
|
+
// Apply heuristic seed: perturb activities slightly
|
|
171
|
+
if (heuristicSeed > 0) {
|
|
172
|
+
let s = heuristicSeed;
|
|
173
|
+
for (let v = 1; v <= numVars; v++) {
|
|
174
|
+
s = (s * 1103515245 + 12345) & 0x7fffffff;
|
|
175
|
+
activity[v] += (s % 1000) / 10000.0;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
function bumpVar(v) { activity[v] += varInc; if (activity[v] > 1e100) { for (let i = 1; i <= numVars; i++) activity[i] *= 1e-100; varInc *= 1e-100; } }
|
|
180
|
+
function decayAct() { varInc /= VAR_DECAY; }
|
|
181
|
+
function currentDL() { return trailLim.length; }
|
|
182
|
+
function litIsTrue(lit) { return lit > 0 ? varVal[lit] === 1 : varVal[-lit] === -1; }
|
|
183
|
+
function litIsFalse(lit) { return lit > 0 ? varVal[lit] === -1 : varVal[-lit] === 1; }
|
|
184
|
+
|
|
185
|
+
function enqueue(lit, lev, reason) {
|
|
186
|
+
const v = Math.abs(lit);
|
|
187
|
+
if (varVal[v] !== 0) return litIsTrue(lit);
|
|
188
|
+
varVal[v] = lit > 0 ? 1 : -1;
|
|
189
|
+
varLevel[v] = lev;
|
|
190
|
+
varAnte[v] = reason;
|
|
191
|
+
trail.push(lit);
|
|
192
|
+
phase[v] = lit > 0 ? 1 : 0;
|
|
193
|
+
stats.propagations++;
|
|
194
|
+
return true;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
function propagate() {
|
|
198
|
+
while (qHead < trail.length) {
|
|
199
|
+
const p = trail[qHead++];
|
|
200
|
+
const falseLit = -p;
|
|
201
|
+
const wIdx = litToIdx(falseLit, numVars);
|
|
202
|
+
const wl = watches[wIdx];
|
|
203
|
+
let j = 0;
|
|
204
|
+
for (let i = 0; i < wl.length; i++) {
|
|
205
|
+
const ci = wl[i];
|
|
206
|
+
const c = allClauses[ci];
|
|
207
|
+
if (!c || c.length < 2) { wl[j++] = ci; continue; }
|
|
208
|
+
if (c[0] === falseLit) { c[0] = c[1]; c[1] = falseLit; }
|
|
209
|
+
if (litIsTrue(c[0])) { wl[j++] = ci; continue; }
|
|
210
|
+
let found = false;
|
|
211
|
+
for (let k = 2; k < c.length; k++) {
|
|
212
|
+
if (!litIsFalse(c[k])) {
|
|
213
|
+
c[1] = c[k]; c[k] = falseLit;
|
|
214
|
+
watches[litToIdx(c[1], numVars)].push(ci);
|
|
215
|
+
found = true; break;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
if (found) continue;
|
|
219
|
+
wl[j++] = ci;
|
|
220
|
+
if (litIsFalse(c[0])) {
|
|
221
|
+
for (let r = i + 1; r < wl.length; r++) wl[j++] = wl[r];
|
|
222
|
+
wl.length = j; qHead = trail.length; return ci;
|
|
223
|
+
}
|
|
224
|
+
if (!enqueue(c[0], currentDL(), ci)) {
|
|
225
|
+
for (let r = i + 1; r < wl.length; r++) wl[j++] = wl[r];
|
|
226
|
+
wl.length = j; qHead = trail.length; return ci;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
wl.length = j;
|
|
230
|
+
}
|
|
231
|
+
return -1;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
function analyzeConflict(conflictCi) {
|
|
235
|
+
const dl = currentDL();
|
|
236
|
+
const seen = new Uint8Array(numVars + 1);
|
|
237
|
+
const outLits = [];
|
|
238
|
+
let counter = 0, btLevel = 0;
|
|
239
|
+
function addLits(ci, skipVar) {
|
|
240
|
+
const c = allClauses[ci];
|
|
241
|
+
for (let i = 0; i < c.length; i++) {
|
|
242
|
+
const v = Math.abs(c[i]);
|
|
243
|
+
if (v === skipVar || seen[v]) continue;
|
|
244
|
+
seen[v] = 1; bumpVar(v);
|
|
245
|
+
if (varLevel[v] === dl) counter++;
|
|
246
|
+
else if (varLevel[v] > 0) { outLits.push(c[i]); if (varLevel[v] > btLevel) btLevel = varLevel[v]; }
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
addLits(conflictCi, 0);
|
|
250
|
+
let ti = trail.length - 1, assertLit = 0;
|
|
251
|
+
while (counter > 0) {
|
|
252
|
+
while (ti >= 0 && !seen[Math.abs(trail[ti])]) ti--;
|
|
253
|
+
if (ti < 0) break;
|
|
254
|
+
const p = trail[ti--], v = Math.abs(p);
|
|
255
|
+
seen[v] = 0; counter--;
|
|
256
|
+
if (counter === 0) assertLit = -p;
|
|
257
|
+
else if (varAnte[v] >= 0) addLits(varAnte[v], v);
|
|
258
|
+
}
|
|
259
|
+
const learned = [];
|
|
260
|
+
if (assertLit !== 0) learned.push(assertLit);
|
|
261
|
+
learned.push(...outLits);
|
|
262
|
+
if (learned.length === 0) return { learned: new Int32Array(0), btLevel: -1 };
|
|
263
|
+
if (learned.length <= 1) btLevel = 0;
|
|
264
|
+
if (learned.length >= 3) {
|
|
265
|
+
let mx = 1;
|
|
266
|
+
for (let i = 2; i < learned.length; i++) if (varLevel[Math.abs(learned[i])] > varLevel[Math.abs(learned[mx])]) mx = i;
|
|
267
|
+
if (mx !== 1) { const tmp = learned[1]; learned[1] = learned[mx]; learned[mx] = tmp; }
|
|
268
|
+
}
|
|
269
|
+
decayAct();
|
|
270
|
+
return { learned: new Int32Array(learned), btLevel };
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
function backtrack(target) {
|
|
274
|
+
if (currentDL() <= target) return;
|
|
275
|
+
const btPoint = target < trailLim.length ? trailLim[target] : trail.length;
|
|
276
|
+
for (let i = trail.length - 1; i >= btPoint; i--) {
|
|
277
|
+
const v = Math.abs(trail[i]);
|
|
278
|
+
varVal[v] = 0; varLevel[v] = -1; varAnte[v] = -1;
|
|
279
|
+
}
|
|
280
|
+
trail.length = btPoint; trailLim.length = target; qHead = btPoint;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
function pickBranch() {
|
|
284
|
+
let best = 0, bestAct = -1;
|
|
285
|
+
for (let v = 1; v <= numVars; v++) {
|
|
286
|
+
if (varVal[v] === 0 && activity[v] > bestAct) { bestAct = activity[v]; best = v; }
|
|
287
|
+
}
|
|
288
|
+
return best;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
function addLearned(learned) {
|
|
292
|
+
const ci = allClauses.length;
|
|
293
|
+
allClauses.push(learned);
|
|
294
|
+
stats.learnedClauses++;
|
|
295
|
+
if (learned.length >= 2) {
|
|
296
|
+
watches[litToIdx(learned[0], numVars)].push(ci);
|
|
297
|
+
watches[litToIdx(learned[1], numVars)].push(ci);
|
|
298
|
+
}
|
|
299
|
+
return ci;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
function reduceDB() {
|
|
303
|
+
const learnedCount = allClauses.length - originalCount;
|
|
304
|
+
if (learnedCount < 100) return;
|
|
305
|
+
const locked = new Uint8Array(allClauses.length);
|
|
306
|
+
for (let v = 1; v <= numVars; v++) {
|
|
307
|
+
if (varVal[v] !== 0 && varAnte[v] >= originalCount) locked[varAnte[v]] = 1;
|
|
308
|
+
}
|
|
309
|
+
const removable = [];
|
|
310
|
+
for (let ci = originalCount; ci < allClauses.length; ci++) {
|
|
311
|
+
if (!locked[ci] && allClauses[ci].length > 2) removable.push(ci);
|
|
312
|
+
}
|
|
313
|
+
if (removable.length < 50) return;
|
|
314
|
+
removable.sort((a, b) => allClauses[b].length - allClauses[a].length);
|
|
315
|
+
const toRemove = new Set(removable.slice(0, Math.floor(removable.length / 2)));
|
|
316
|
+
const oldToNew = new Map();
|
|
317
|
+
const newClauses = [];
|
|
318
|
+
for (let ci = 0; ci < allClauses.length; ci++) {
|
|
319
|
+
if (!toRemove.has(ci)) { oldToNew.set(ci, newClauses.length); newClauses.push(allClauses[ci]); }
|
|
320
|
+
}
|
|
321
|
+
for (let v = 1; v <= numVars; v++) {
|
|
322
|
+
if (varAnte[v] >= 0) { const m = oldToNew.get(varAnte[v]); varAnte[v] = m !== undefined ? m : -1; }
|
|
323
|
+
}
|
|
324
|
+
allClauses.length = 0; allClauses.push(...newClauses);
|
|
325
|
+
rebuildWatches();
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
// Process initial unit clauses
|
|
329
|
+
for (let ci = 0; ci < allClauses.length; ci++) {
|
|
330
|
+
if (allClauses[ci].length === 1) {
|
|
331
|
+
if (!enqueue(allClauses[ci][0], 0, ci)) {
|
|
332
|
+
stats.solveTimeMs = Date.now() - startTime;
|
|
333
|
+
return { satisfiable: false, stats };
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
let conflict = propagate();
|
|
339
|
+
if (conflict !== -1) {
|
|
340
|
+
stats.solveTimeMs = Date.now() - startTime;
|
|
341
|
+
return { satisfiable: false, stats };
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
// Main CDCL loop with configurable restart policy
|
|
345
|
+
let lubyIdx = 0;
|
|
346
|
+
const RESTART_BASE = restartPolicy === 2 ? 200 : 100;
|
|
347
|
+
let conflictsUntilRestart = restartPolicy === 1
|
|
348
|
+
? RESTART_BASE
|
|
349
|
+
: RESTART_BASE * luby(lubyIdx);
|
|
350
|
+
let conflictsSinceRestart = 0;
|
|
351
|
+
let nextReduceDB = originalCount * 3;
|
|
352
|
+
const GEOMETRIC_FACTOR = 1.5;
|
|
353
|
+
|
|
354
|
+
while (true) {
|
|
355
|
+
if (Date.now() - startTime > timeoutMs) {
|
|
356
|
+
stats.solveTimeMs = Date.now() - startTime;
|
|
357
|
+
return { satisfiable: false, stats };
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
const v = pickBranch();
|
|
361
|
+
if (v === 0) break;
|
|
362
|
+
|
|
363
|
+
stats.decisions++;
|
|
364
|
+
trailLim.push(trail.length);
|
|
365
|
+
// Diversify: use seed to sometimes flip polarity
|
|
366
|
+
let lit;
|
|
367
|
+
if (heuristicSeed > 0 && stats.decisions % (3 + heuristicSeed % 5) === 0) {
|
|
368
|
+
lit = phase[v] === 1 ? -v : v; // flip
|
|
369
|
+
} else {
|
|
370
|
+
lit = phase[v] === 1 ? v : -v;
|
|
371
|
+
}
|
|
372
|
+
enqueue(lit, currentDL(), -1);
|
|
373
|
+
conflict = propagate();
|
|
374
|
+
|
|
375
|
+
while (conflict !== -1) {
|
|
376
|
+
stats.conflicts++;
|
|
377
|
+
conflictsSinceRestart++;
|
|
378
|
+
if (currentDL() === 0) {
|
|
379
|
+
stats.solveTimeMs = Date.now() - startTime;
|
|
380
|
+
return { satisfiable: false, stats };
|
|
381
|
+
}
|
|
382
|
+
const { learned, btLevel } = analyzeConflict(conflict);
|
|
383
|
+
if (learned.length === 0 || btLevel < 0) {
|
|
384
|
+
stats.solveTimeMs = Date.now() - startTime;
|
|
385
|
+
return { satisfiable: false, stats };
|
|
386
|
+
}
|
|
387
|
+
backtrack(btLevel);
|
|
388
|
+
const lci = addLearned(learned);
|
|
389
|
+
enqueue(learned[0], learned.length === 1 ? 0 : btLevel, lci);
|
|
390
|
+
conflict = propagate();
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
if (conflictsSinceRestart >= conflictsUntilRestart) {
|
|
394
|
+
stats.restarts++;
|
|
395
|
+
if (restartPolicy === 1) {
|
|
396
|
+
conflictsUntilRestart = Math.floor(conflictsUntilRestart * GEOMETRIC_FACTOR);
|
|
397
|
+
} else {
|
|
398
|
+
lubyIdx++;
|
|
399
|
+
conflictsUntilRestart = RESTART_BASE * luby(lubyIdx);
|
|
400
|
+
}
|
|
401
|
+
conflictsSinceRestart = 0;
|
|
402
|
+
backtrack(0);
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
if (allClauses.length > nextReduceDB) {
|
|
406
|
+
reduceDB();
|
|
407
|
+
nextReduceDB = originalCount + allClauses.length * 2;
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
// SAT — build model
|
|
412
|
+
const model = {};
|
|
413
|
+
for (let i = 0; i < atomNames.length && i < numVars; i++) {
|
|
414
|
+
model[atomNames[i]] = varVal[i + 1] === 1 || varVal[i + 1] === 0;
|
|
415
|
+
}
|
|
416
|
+
stats.solveTimeMs = Date.now() - startTime;
|
|
417
|
+
return { satisfiable: true, model, stats };
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
// ── Worker message handler ──
|
|
421
|
+
|
|
422
|
+
if (typeof require !== 'undefined') {
|
|
423
|
+
// Node.js worker_threads
|
|
424
|
+
try {
|
|
425
|
+
const { parentPort } = require('worker_threads');
|
|
426
|
+
if (parentPort) {
|
|
427
|
+
parentPort.on('message', function(msg) {
|
|
428
|
+
try {
|
|
429
|
+
const result = workerSolve(msg);
|
|
430
|
+
result.workerId = msg.workerId || 0;
|
|
431
|
+
parentPort.postMessage(result);
|
|
432
|
+
} catch (e) {
|
|
433
|
+
parentPort.postMessage({ satisfiable: false, error: e.message, workerId: msg.workerId || 0 });
|
|
434
|
+
}
|
|
435
|
+
});
|
|
436
|
+
}
|
|
437
|
+
} catch(e) {}
|
|
438
|
+
} else if (typeof self !== 'undefined') {
|
|
439
|
+
// Browser Web Worker
|
|
440
|
+
self.onmessage = function(ev) {
|
|
441
|
+
try {
|
|
442
|
+
const result = workerSolve(ev.data);
|
|
443
|
+
result.workerId = ev.data.workerId || 0;
|
|
444
|
+
self.postMessage(result);
|
|
445
|
+
} catch (e) {
|
|
446
|
+
self.postMessage({ satisfiable: false, error: e.message, workerId: ev.data.workerId || 0 });
|
|
447
|
+
}
|
|
448
|
+
};
|
|
449
|
+
}
|
|
450
|
+
`;
|
|
451
|
+
}
|
|
452
|
+
// ── Creación de Workers ─────────────────────────────────────
|
|
453
|
+
function createNodeWorker(code) {
|
|
454
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
455
|
+
const wt = require('worker_threads');
|
|
456
|
+
const w = new wt.Worker(code, { eval: true });
|
|
457
|
+
return {
|
|
458
|
+
postMessage: (msg) => w.postMessage(msg),
|
|
459
|
+
terminate: () => void w.terminate(),
|
|
460
|
+
onMessage: (cb) => {
|
|
461
|
+
w.on('message', cb);
|
|
462
|
+
},
|
|
463
|
+
onError: (cb) => {
|
|
464
|
+
w.on('error', cb);
|
|
465
|
+
},
|
|
466
|
+
};
|
|
467
|
+
}
|
|
468
|
+
function createBrowserWorker(code) {
|
|
469
|
+
const blob = new Blob([code], { type: 'application/javascript' });
|
|
470
|
+
const url = URL.createObjectURL(blob);
|
|
471
|
+
// Browser Worker — globalThis access requiere any cast porque no tenemos lib:dom
|
|
472
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any
|
|
473
|
+
const W = globalThis.Worker;
|
|
474
|
+
const w = new W(url);
|
|
475
|
+
return {
|
|
476
|
+
postMessage: (msg) => w.postMessage(msg),
|
|
477
|
+
terminate: () => {
|
|
478
|
+
w.terminate();
|
|
479
|
+
URL.revokeObjectURL(url);
|
|
480
|
+
},
|
|
481
|
+
onMessage: (cb) => {
|
|
482
|
+
w.onmessage = (ev) => cb(ev.data);
|
|
483
|
+
},
|
|
484
|
+
onError: (cb) => {
|
|
485
|
+
w.onerror = (ev) => cb(new Error(ev.message));
|
|
486
|
+
},
|
|
487
|
+
};
|
|
488
|
+
}
|
|
489
|
+
function spawnWorker() {
|
|
490
|
+
const code = getWorkerCode();
|
|
491
|
+
try {
|
|
492
|
+
if (typeof process !== 'undefined' && process.versions?.node) {
|
|
493
|
+
return createNodeWorker(code);
|
|
494
|
+
}
|
|
495
|
+
if (typeof globalThis !== 'undefined' && 'Worker' in globalThis) {
|
|
496
|
+
return createBrowserWorker(code);
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
catch {
|
|
500
|
+
// Workers no disponibles
|
|
501
|
+
}
|
|
502
|
+
return null;
|
|
503
|
+
}
|
|
504
|
+
const PORTFOLIO_CONFIGS = [
|
|
505
|
+
{ heuristicSeed: 0, restartPolicy: 0 }, // Default (Luby)
|
|
506
|
+
{ heuristicSeed: 42, restartPolicy: 1 }, // Geometric restarts
|
|
507
|
+
{ heuristicSeed: 137, restartPolicy: 0 }, // Luby + seed perturbation
|
|
508
|
+
{ heuristicSeed: 7919, restartPolicy: 2 }, // Fixed restarts + big seed
|
|
509
|
+
];
|
|
510
|
+
// ── Solver Paralelo Principal ───────────────────────────────
|
|
511
|
+
/**
|
|
512
|
+
* Umbral mínimo de variables para activar paralelismo.
|
|
513
|
+
* Por debajo de este umbral, el overhead de workers no compensa.
|
|
514
|
+
*/
|
|
515
|
+
exports.PARALLEL_THRESHOLD = 80;
|
|
516
|
+
/**
|
|
517
|
+
* Número máximo de workers a lanzar (limitado por configs de portfolio).
|
|
518
|
+
*/
|
|
519
|
+
exports.MAX_WORKERS = 4;
|
|
520
|
+
/**
|
|
521
|
+
* Resuelve SAT en paralelo con portfolio racing.
|
|
522
|
+
*
|
|
523
|
+
* @param clauses Cláusulas ya codificadas (post-preprocessing)
|
|
524
|
+
* @param numVars Número de variables
|
|
525
|
+
* @param atomNames Nombres de los átomos originales
|
|
526
|
+
* @param timeoutMs Timeout global
|
|
527
|
+
* @returns Promise con el resultado
|
|
528
|
+
*/
|
|
529
|
+
function parallelSolve(clauses, numVars, atomNames, timeoutMs) {
|
|
530
|
+
return new Promise((resolve) => {
|
|
531
|
+
if (!workersAvailable()) {
|
|
532
|
+
// Fallback: no se resuelve aquí, el caller usará cdclSolve secuencial
|
|
533
|
+
resolve({ satisfiable: false, stats: undefined });
|
|
534
|
+
return;
|
|
535
|
+
}
|
|
536
|
+
const packed = packClauses(clauses);
|
|
537
|
+
const numWorkers = Math.min(exports.MAX_WORKERS, PORTFOLIO_CONFIGS.length);
|
|
538
|
+
const workers = [];
|
|
539
|
+
let resolved = false;
|
|
540
|
+
let completedCount = 0;
|
|
541
|
+
// Timeout global
|
|
542
|
+
const timer = setTimeout(() => {
|
|
543
|
+
if (!resolved) {
|
|
544
|
+
resolved = true;
|
|
545
|
+
terminateAll();
|
|
546
|
+
resolve({ satisfiable: false });
|
|
547
|
+
}
|
|
548
|
+
}, timeoutMs);
|
|
549
|
+
function terminateAll() {
|
|
550
|
+
for (const w of workers) {
|
|
551
|
+
try {
|
|
552
|
+
w.terminate();
|
|
553
|
+
}
|
|
554
|
+
catch {
|
|
555
|
+
// ignore
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
clearTimeout(timer);
|
|
559
|
+
}
|
|
560
|
+
for (let i = 0; i < numWorkers; i++) {
|
|
561
|
+
const w = spawnWorker();
|
|
562
|
+
if (!w)
|
|
563
|
+
continue;
|
|
564
|
+
workers.push(w);
|
|
565
|
+
const config = PORTFOLIO_CONFIGS[i];
|
|
566
|
+
w.onMessage((data) => {
|
|
567
|
+
const result = data;
|
|
568
|
+
completedCount++;
|
|
569
|
+
if (!resolved) {
|
|
570
|
+
// Estrategia: el primero que encuentre SAT gana inmediatamente.
|
|
571
|
+
// Si es UNSAT, esperar a que TODOS confirmen UNSAT.
|
|
572
|
+
if (result.satisfiable) {
|
|
573
|
+
resolved = true;
|
|
574
|
+
terminateAll();
|
|
575
|
+
resolve({
|
|
576
|
+
satisfiable: true,
|
|
577
|
+
model: result.model,
|
|
578
|
+
stats: result.stats,
|
|
579
|
+
});
|
|
580
|
+
}
|
|
581
|
+
else if (completedCount >= workers.length) {
|
|
582
|
+
// Todos dijeron UNSAT
|
|
583
|
+
resolved = true;
|
|
584
|
+
terminateAll();
|
|
585
|
+
resolve({
|
|
586
|
+
satisfiable: false,
|
|
587
|
+
stats: result.stats,
|
|
588
|
+
});
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
});
|
|
592
|
+
w.onError(() => {
|
|
593
|
+
completedCount++;
|
|
594
|
+
if (!resolved && completedCount >= workers.length) {
|
|
595
|
+
resolved = true;
|
|
596
|
+
terminateAll();
|
|
597
|
+
resolve({ satisfiable: false });
|
|
598
|
+
}
|
|
599
|
+
});
|
|
600
|
+
w.postMessage({
|
|
601
|
+
clauseData: Array.from(packed), // Structured clone friendly
|
|
602
|
+
numVars,
|
|
603
|
+
atomNames,
|
|
604
|
+
timeoutMs: timeoutMs - 10, // Worker timeout ligeramente menor
|
|
605
|
+
heuristicSeed: config.heuristicSeed,
|
|
606
|
+
restartPolicy: config.restartPolicy,
|
|
607
|
+
workerId: i,
|
|
608
|
+
});
|
|
609
|
+
}
|
|
610
|
+
// Si no se pudieron crear workers, fallback inmediato
|
|
611
|
+
if (workers.length === 0) {
|
|
612
|
+
clearTimeout(timer);
|
|
613
|
+
resolve({ satisfiable: false, stats: undefined });
|
|
614
|
+
}
|
|
615
|
+
});
|
|
616
|
+
}
|
|
617
|
+
/**
|
|
618
|
+
* Versión síncrona que intenta paralelismo y cae a secuencial.
|
|
619
|
+
* Para integración transparente con el flujo actual de cdcl().
|
|
620
|
+
*
|
|
621
|
+
* NOTA: Esta función solo es útil si el caller puede manejar
|
|
622
|
+
* la Promise. Si no, usar cdclSolve directamente.
|
|
623
|
+
*/
|
|
624
|
+
function tryParallelSolve(clauses, numVars, atomNames, timeoutMs) {
|
|
625
|
+
if (!workersAvailable() || numVars < exports.PARALLEL_THRESHOLD) {
|
|
626
|
+
return null; // Caller debe usar solver secuencial
|
|
627
|
+
}
|
|
628
|
+
return parallelSolve(clauses, numVars, atomNames, timeoutMs);
|
|
629
|
+
}
|
|
630
|
+
//# sourceMappingURL=parallel-sat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parallel-sat.js","sourceRoot":"","sources":["../../../src/profiles/classical/parallel-sat.ts"],"names":[],"mappings":";AAAA,+DAA+D;AAC/D,qDAAqD;AACrD,kEAAkE;AAClE,+DAA+D;AAC/D,EAAE;AACF,oEAAoE;AACpE,2DAA2D;AAC3D,uDAAuD;AACvD,EAAE;AACF,sEAAsE;AACtE,+DAA+D;;;AAkC/D,kCAUC;AAKD,sCASC;AAgBD,4CAoBC;AAydD,sC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ACtD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACzB,YAAY,CAAC,KAAK,CAAC,CAAC;YACpB,OAAO,CAAC,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;QACpD,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,gBAAgB,CAC9B,OAAqB,EACrB,OAAe,EACf,SAAmB,EACnB,SAAiB;IAEjB,IAAI,CAAC,gBAAgB,EAAE,IAAI,OAAO,GAAG,0BAAkB,EAAE,CAAC;QACxD,OAAO,IAAI,CAAC,CAAC,qCAAqC;IACpD,CAAC;IACD,OAAO,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;AAC/D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"propositional.d.ts","sourceRoot":"","sources":["../../../src/profiles/classical/propositional.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,OAAO,EACP,UAAU,EACV,SAAS,EACT,MAAM,EACN,YAAY,EACZ,gBAAgB,EAEhB,SAAS,EAGV,MAAM,aAAa,CAAC;AASrB,wBAAgB,YAAY,CAAC,CAAC,EAAE,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC,CAEpD;AAkBD,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,GAAG,OAAO,CAqCnE;AAyBD;;GAEG;AACH,wBAAiB,sBAAsB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC,SAAS,CAAC,CAc7E;
|
|
1
|
+
{"version":3,"file":"propositional.d.ts","sourceRoot":"","sources":["../../../src/profiles/classical/propositional.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,OAAO,EACP,UAAU,EACV,SAAS,EACT,MAAM,EACN,YAAY,EACZ,gBAAgB,EAEhB,SAAS,EAGV,MAAM,aAAa,CA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