-
Notifications
You must be signed in to change notification settings - Fork 0
/
eprover.js
35 lines (30 loc) · 1.09 KB
/
eprover.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
/* eslint-disable */
// System on TPTP Webworker
onmessage = async function(request) {
const formData = new FormData();
formData.append("TPTPProblem", "");
formData.append("ProblemSource", "FORMULAE");
formData.append("FORMULAEProblem", request.data.Task);
formData.append("QuietFlag", "-q01");
formData.append("ForceSystem", "-force");
formData.append("SubmitButton", "RunSelectedSystems");
formData.append("System___E---", "E---");
const re = /--cpu-limit=(\d+)/;
for(let a in request.data.Args) {
let m = request.data.Args[a].match(re);
if(m) {
formData.append("TimeLimit___E---", m[1]);
}
}
const systemOnTPTP = new Request("https://tptp.org/cgi-bin/SystemOnTPTPFormReply", {
method: 'POST',
body: formData
});
fetch(systemOnTPTP).then(async function(response) {
if (response && response.status === 200) {
const text = await response.text();
postMessage({ Req: "proverOut", error: false, html: text});
postMessage({ Req: "proverDone" });
}
});
}