From 43bfe5935b3f1d38775c3bc65262aca5683c0fb5 Mon Sep 17 00:00:00 2001 From: Kai Stevenson Date: Sun, 11 Jun 2023 23:33:40 -0700 Subject: added parsing of justifications --- operetta.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'operetta.c') 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) { -- cgit v1.3.1