summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Stevenson <kai@kaistevenson.com>2023-06-13 14:50:00 -0700
committerKai Stevenson <kai@kaistevenson.com>2023-06-13 14:50:00 -0700
commit1d3bbec4660dfe4e2117826ceef9b32758b40345 (patch)
tree7c33cdf17774a122af89f3ae7743771f047942a7
parentcaa9d17ea794a0b4823170551545498d458e1fc2 (diff)
restructured project
-rw-r--r--.gitignore1
-rw-r--r--Makefile2
-rw-r--r--examples/operetta_example14
-rw-r--r--src/eval.c (renamed from eval.c)0
-rw-r--r--src/eval.h (renamed from eval.h)0
-rw-r--r--src/lexer.c (renamed from lexer.c)0
-rw-r--r--src/lexer.h (renamed from lexer.h)0
-rw-r--r--src/operetta.c (renamed from operetta.c)0
-rw-r--r--src/operetta.h (renamed from operetta.h)0
-rw-r--r--src/parse.c (renamed from parse.c)0
-rw-r--r--src/parse.h (renamed from parse.h)0
-rw-r--r--src/proposition.c (renamed from proposition.c)0
-rw-r--r--src/proposition.h (renamed from proposition.h)0
-rw-r--r--testfile4
-rw-r--r--testfile25
15 files changed, 16 insertions, 10 deletions
diff --git a/.gitignore b/.gitignore
index c7137bd..ce80e8f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,4 @@ operetta
*.core
vgcore.*
*.dSYM/
+/testfiles/
diff --git a/Makefile b/Makefile
index 94251dc..2eaf791 100644
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,7 @@ PREFIX ?= /usr
BINDIR ?= ${PREFIX}/bin
generate:
- $(CC) -o operetta operetta.c proposition.c parse.c lexer.c eval.c $(CFLAGS)
+ $(CC) -o operetta src/operetta.c src/proposition.c src/parse.c src/lexer.c src/eval.c $(CFLAGS)
install: operetta
install operetta ${DESTDIR}${BINDIR}
diff --git a/examples/operetta_example b/examples/operetta_example
new file mode 100644
index 0000000..c2cf2fc
--- /dev/null
+++ b/examples/operetta_example
@@ -0,0 +1,14 @@
+INPUT:
+A | pr
+C | pr
+ B | as
+ C ^ B | ^i 2, 3
+B->C^B | ->i 3, 4
+
+OUTPUT:
+1. A BECAUSE: PREMISE <SOUND> [0]
+2. C BECAUSE: PREMISE <SOUND> [0]
+3. > B BECAUSE: ASSUMPTION <SOUND> [1]
+4. > (C CONJUNCTION B) BECAUSE: CONJUNCTION INTRODUCTION 2 3 <SOUND> [1]
+5. (B IMPLICATION (C CONJUNCTION B)) BECAUSE: IMPLICATION INTRODUCTION 3 4 <SOUND> [0]
+
diff --git a/eval.c b/src/eval.c
index 9132272..9132272 100644
--- a/eval.c
+++ b/src/eval.c
diff --git a/eval.h b/src/eval.h
index 74e7650..74e7650 100644
--- a/eval.h
+++ b/src/eval.h
diff --git a/lexer.c b/src/lexer.c
index c6c4ffe..c6c4ffe 100644
--- a/lexer.c
+++ b/src/lexer.c
diff --git a/lexer.h b/src/lexer.h
index e5d64dc..e5d64dc 100644
--- a/lexer.h
+++ b/src/lexer.h
diff --git a/operetta.c b/src/operetta.c
index f754895..f754895 100644
--- a/operetta.c
+++ b/src/operetta.c
diff --git a/operetta.h b/src/operetta.h
index 6d348ed..6d348ed 100644
--- a/operetta.h
+++ b/src/operetta.h
diff --git a/parse.c b/src/parse.c
index 830f9c5..830f9c5 100644
--- a/parse.c
+++ b/src/parse.c
diff --git a/parse.h b/src/parse.h
index c6e76ec..c6e76ec 100644
--- a/parse.h
+++ b/src/parse.h
diff --git a/proposition.c b/src/proposition.c
index 6f28fbe..6f28fbe 100644
--- a/proposition.c
+++ b/src/proposition.c
diff --git a/proposition.h b/src/proposition.h
index 2d09688..2d09688 100644
--- a/proposition.h
+++ b/src/proposition.h
diff --git a/testfile b/testfile
deleted file mode 100644
index 5f07502..0000000
--- a/testfile
+++ /dev/null
@@ -1,4 +0,0 @@
-Q | pr
- KAI^PRESTON | as
- ~CAT->(DOG^~RABBIT) | ^e 1 2
-V | pr
diff --git a/testfile2 b/testfile2
deleted file mode 100644
index dbdaa34..0000000
--- a/testfile2
+++ /dev/null
@@ -1,5 +0,0 @@
-A | pr
-C | pr
- B | as
- C ^ B | ^i 2, 3
-B->C^B | ->i 3, 4