diff options
| author | Kai Stevenson <kai@kaistevenson.com> | 2023-06-13 21:24:31 -0700 |
|---|---|---|
| committer | Kai Stevenson <kai@kaistevenson.com> | 2023-06-13 21:24:31 -0700 |
| commit | c97957b76a6ff95aa413ed5cf1a39ec76aad9a60 (patch) | |
| tree | b78c8bc4dc777b86c8f6bdf6469c29fb357f03bd /src/eval.c | |
| parent | c427a114bf95620cb9f1b439a8a6e1db14a74fb0 (diff) | |
added implication elim rule
Diffstat (limited to 'src/eval.c')
| -rw-r--r-- | src/eval.c | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -61,6 +61,24 @@ char just_is_sound(line_t line, lineSet_t lines) { return 0; } return peq(prop, *w.propA) || peq(prop, *w.propB); + case IMPLICATION_ELIM: + wl = lines.lines[just.references[0] - 1]; + xl = lines.lines[just.references[1] - 1]; + w = wl.proposition; + x = xl.proposition; + if (!seqlt(line.scope, wl.scope) || !seqlt(line.scope, xl.scope)) { + return 0; + } + /* find the positions of the arguments */ + if (!w.isSimple && peq(prop, *w.propB) && w.relation == IMPLICATION && peq(x, *w.propA)) { + return 1; + } + else if (!x.isSimple && peq(prop, *x.propB) && x.relation == IMPLICATION && peq(w, *x.propA)) { + return 1; + } + else { + return 0; + } default: return 0; } |
