Skip to content

Commit 93d4687

Browse files
committed
Hide structural rules if they are irrelevant
1 parent 7621e91 commit 93d4687

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/app.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -558,10 +558,10 @@ ProofTree.prototype.image = function (root) {
558558
let applicables = applicableLK(this.conclusion).map(x => x.name)
559559
box.querySelectorAll('button').forEach(but => {
560560
if (but.value === "Z3Rule") { return }
561-
if (but.value === "WeakeningLeft") { return }
562-
if (but.value === "WeakeningRight") { return }
563-
if (but.value === "ContractionLeft") { return }
564-
if (but.value === "ContractionRight") { return }
561+
if (but.value === "WeakeningLeft") { if (this.conclusion.precedents.length > 0) { return } else { but.remove() } }
562+
if (but.value === "WeakeningRight") { if (this.conclusion.antecedents.length > 0) { return } else { but.remove() } }
563+
if (but.value === "ContractionLeft") { if (this.conclusion.precedents.length > 0) { return } else { but.remove() } }
564+
if (but.value === "ContractionRight") { if (this.conclusion.antecedents.length > 0) { return } else { but.remove() } }
565565
if (but.value === "'Auto'") { return }
566566
if (!applicables.includes(but.value)) { but.remove() }
567567
})

0 commit comments

Comments
 (0)