diff options
| author | Kai Stevenson <kai@kaistevenson.com> | 2023-06-13 01:59:43 -0700 |
|---|---|---|
| committer | Kai Stevenson <kai@kaistevenson.com> | 2023-06-13 01:59:43 -0700 |
| commit | 2f7ac38cca2ebab41b8adb76b69e0949eeae488d (patch) | |
| tree | 6395841e2dbc557f619635f9b04fdd6e26a9985c /eval.c | |
| parent | 8f4eb9fc953512365f9258ffd5d11ed8950f77a9 (diff) | |
fixed bugs, just_is_sound works for conjunct intro
Diffstat (limited to 'eval.c')
| -rw-r--r-- | eval.c | 37 |
1 files changed, 37 insertions, 0 deletions
@@ -0,0 +1,37 @@ +#include <stdlib.h> +#include "eval.h" +#include "parse.h" +char just_is_sound(prop_t prop, just_t just, lineSet_t lines) { + prop_t a; + prop_t b; + if (!prop.isSimple) { + a = *prop.propA; + b = *prop.propB; + } + prop_t w; + prop_t x; + prop_t y; + prop_t z; + if (just.referencesCount > 0) { + w = lines.lines[just.references[0] - 1].proposition; + } + if (just.referencesCount > 1) { + x = lines.lines[just.references[1] - 1].proposition; + } + if (just.referencesCount > 2) { + y = lines.lines[just.references[2] - 1].proposition; + } + if (just.referencesCount > 3) { + z = lines.lines[just.references[3] - 1].proposition; + } + switch (just.rule) { + case PREMISE_R: + return 1; + case ASSUMPTION_R: + return 1; + case CONJUNCT_INTRO: + return (peq(a, w) && peq(b, x)) || (peq(a, x) && peq(b, w)); + default: + return 0; + } +} |
