Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 24 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,15 @@
<!-- font awesome -->
<!-- <script src="https://use.fontawesome.com/b8ae54b59e.js"></script> -->
<script type="text/javascript">
function createProb() {
function createProb() {
createProbFrom(
document.getElementById("probpremises").value,
document.getElementById("probconc").value
);
}

function createProbFrom(pstr, conc) {
predicateSettings = (document.getElementById("folradio").checked);
var pstr = document.getElementById("probpremises").value;
pstr = pstr.replace(/^[,;\s]*/,'');
pstr = pstr.replace(/[,;\s]*$/,'');
var prems = pstr.split(/[,;\s]*[,;][,;\s]*/);
Expand All @@ -57,7 +63,7 @@
if (!(w.isWellFormed)) {
alert('Premise ' + (a+1) + ', ' + fixWffInputStr(prems[a]) + ', is not well formed.');
return;
}
}
if ((predicateSettings) && (!(w.allFreeVars.length == 0))) {
alert('Premise ' + (a+1) + ' is not closed.');
return;
Expand All @@ -68,8 +74,7 @@
});
}
}
var conc = fixWffInputStr(document.getElementById("probconc").value);
var cw = parseIt(conc);
var cw = parseIt(fixWffInputStr(conc));
if (!(cw.isWellFormed)) {
alert('The conclusion ' + fixWffInputStr(conc) + ', is not well formed.');
return;
Expand All @@ -91,7 +96,21 @@
var tp = document.getElementById("theproof");
tp.innerHTML = '';
makeProof(tp, sofar, wffToString(cw, false));
}

var params = {};
location.search.substring(1).split("&").forEach(function(arg) {
var eq = arg.indexOf("=")
var key = decodeURIComponent(arg.substring(0, eq) || arg);
var val = decodeURIComponent(arg.substring(eq + 1));
if (key) params[key] = val;
});

window.addEventListener("load", function(e) {
if (params.prems) {
createProbFrom(params.prems, params.conc || "#");
}
});
</script>
<style type="text/css">
#probpremises {
Expand Down