summaryrefslogtreecommitdiff
path: root/operetta.c
diff options
context:
space:
mode:
authorKai Stevenson <kai@kaistevenson.com>2023-06-11 23:33:40 -0700
committerKai Stevenson <kai@kaistevenson.com>2023-06-11 23:33:40 -0700
commit43bfe5935b3f1d38775c3bc65262aca5683c0fb5 (patch)
treec2290c617bc40cc5f4a33c56d54548a6d9084253 /operetta.c
parentd063e3c2c6f4b1566c28d0ea92186f356017f99f (diff)
added parsing of justifications
Diffstat (limited to 'operetta.c')
-rw-r--r--operetta.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/operetta.c b/operetta.c
index 4c50434..4192ffb 100644
--- a/operetta.c
+++ b/operetta.c
@@ -13,6 +13,8 @@ int main(int argc, char** argv) {
lineSet_t lines = parse_lines(content, lineCount);
for (int i = 0; i < lines.count; i++) {
write_prop(lines.lines[i].proposition);
+ printf(" BECAUSE: ");
+ write_just(lines.lines[i].justification);
printf("\n");
}
free(content);
@@ -29,6 +31,12 @@ void write_prop(prop_t prop) {
printf(")");
}
}
+void write_just(just_t just) {
+ printf("%s", jrtos(just.rule));
+ for (int i = 0; i < just.referencesCount; i++) {
+ printf(" %d", just.references[i]);
+ }
+}
char* read_file(char* path) {
FILE* file = fopen(path, "r");
if (file == NULL) {