-
Notifications
You must be signed in to change notification settings - Fork 0
/
worker.js
47 lines (26 loc) · 820 Bytes
/
worker.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
importScripts('satforhuman.js');
importScripts('sat.js');
importScripts('UIDPLLsend.js');
importScripts('scheme_interpreter.js');
var inputFormula;
var inputChosenLiterals;
onmessage = function(event)
{
inputFormula = event.data.inputFormula;
inputChosenLiterals = event.data.inputChosenLiterals;
}
UIpostMessage = postMessage;
function load()
{
scheme.loadfile("formula-expand.scm");
scheme.loadfile("formula_to_cnf.scm");
scheme.loadfile("formula_check_syntax.scm");
}
function testSAT() {
var inputFormulaExpandedCNF = satforHuman_formulagetExpandedCNF(inputFormula);
var valuation = satforHuman_getValuation(inputFormulaExpandedCNF, inputChosenLiterals);
postMessage({valuation: valuation});
self.close();
}
load();
setTimeout(testSAT, 100);