diff options
| author | Kai Stevenson <kai@kaistevenson.com> | 2023-06-13 14:50:00 -0700 |
|---|---|---|
| committer | Kai Stevenson <kai@kaistevenson.com> | 2023-06-13 14:50:00 -0700 |
| commit | 1d3bbec4660dfe4e2117826ceef9b32758b40345 (patch) | |
| tree | 7c33cdf17774a122af89f3ae7743771f047942a7 /src/proposition.c | |
| parent | caa9d17ea794a0b4823170551545498d458e1fc2 (diff) | |
restructured project
Diffstat (limited to 'src/proposition.c')
| -rw-r--r-- | src/proposition.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/proposition.c b/src/proposition.c new file mode 100644 index 0000000..6f28fbe --- /dev/null +++ b/src/proposition.c @@ -0,0 +1,48 @@ +#include "proposition.h" +/* a proposition defines a relation between two propositions */ +prop_t init_prop(char isNegative, prop_t* propA, prop_t* propB, tokenType_t relation) { + prop_t prop; + prop.isNegative = isNegative; + prop.propA = propA; + prop.propB = propB; + prop.relation = relation; + prop.isSimple = 0; + return prop; +} +/* a simple proposition is one with only a name */ +prop_t init_simple_prop(char isNegative, char* name) { + prop_t prop; + prop.isNegative = isNegative; + prop.name = name; + prop.isSimple = 1; + return prop; +} +char* jrtos(justRule_t rule) { + switch (rule) { + case PREMISE_R: + return "PREMISE"; + case ASSUMPTION_R: + return "ASSUMPTION"; + case CONJUNCT_INTRO: + return "CONJUNCTION INTRODUCTION"; + case DISJUNCT_INTRO: + return "DISJUNCTION INTRODUCTION"; + case IMPLICATION_INTRO: + return "IMPLICATION INTRODUCTION"; + case CONJUNCT_ELIM: + return "CONJUNCTION ELIMINATION"; + case DISJUNCT_ELIM: + return "DISJUNCTION ELIMINATION"; + case IMPLICATION_ELIM: + return "IMPLICATION ELIMINATION"; + default: + return "ERR"; + } +} +just_t init_just(justRule_t rule, int* references, int referencesCount) { + just_t just; + just.rule = rule; + just.references = references; + just.referencesCount = referencesCount; + return just; +} |
