aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--inc/term.h8
-rw-r--r--makefile5
-rw-r--r--src/main.c102
-rw-r--r--src/term.c47
-rw-r--r--tests/1.in1
-rw-r--r--tests/1.red1
-rw-r--r--tests/1.trans1
-rw-r--r--tests/2.in1
-rw-r--r--tests/2.red1
-rw-r--r--tests/2.trans1
-rw-r--r--tests/3.in1
-rw-r--r--tests/3.red1
-rw-r--r--tests/3.trans1
13 files changed, 158 insertions, 13 deletions
diff --git a/inc/term.h b/inc/term.h
index 6ce204b..578e734 100644
--- a/inc/term.h
+++ b/inc/term.h
@@ -22,11 +22,13 @@ struct term {
} u;
};
+void to_barendregt(struct term *term);
+void to_bruijn(struct term *term);
struct term *new_term(term_type type);
+struct term *duplicate_term(struct term *term);
+int alpha_equivalency(struct term *a, struct term *b);
+void free_term(struct term *term);
void print_term(struct term *term);
void print_scheme(struct term *term);
-void free_term(struct term *term);
-void to_barendregt(struct term *term);
-void to_bruijn(struct term *term);
#endif
diff --git a/makefile b/makefile
index 3e39b22..144fa09 100644
--- a/makefile
+++ b/makefile
@@ -15,6 +15,9 @@ CFLAGS_DEBUG = -Wno-error -g -Og -Wno-unused -fsanitize=address -fsanitize=undef
CFLAGS_WARNINGS = -Wall -Wextra -Wshadow -Wpointer-arith -Wwrite-strings -Wredundant-decls -Wnested-externs -Wformat=2 -Wmissing-declarations -Wstrict-prototypes -Wmissing-prototypes -Wcast-qual -Wswitch-default -Wswitch-enum -Wunreachable-code -Wundef -Wold-style-definition -Wvla -pedantic -Wno-switch-enum
CFLAGS = $(CFLAGS_WARNINGS) -std=c99 -fno-profile-generate -fno-omit-frame-pointer -fno-common -fno-asynchronous-unwind-tables -mno-red-zone -Ofast -D_DEFAULT_SOURCE -I$(INC) #$(CFLAGS_DEBUG)
+ifdef TEST # TODO: Somehow clean automagically
+CFLAGS += -DTEST
+endif
all: compile sync
@@ -23,8 +26,6 @@ compile: $(BUILD) $(OBJS) $(BUILD)/calm
clean:
@rm -rf $(BUILD)/*
-test:
-
sync: # Ugly hack
@$(MAKE) $(BUILD)/calm --always-make --dry-run | grep -wE 'gcc|g\+\+' | grep -w '\-c' | jq -nR '[inputs|{directory:".", command:., file: match(" [^ ]+$$").string[1:]}]' >compile_commands.json
@$(TG) -R --exclude=.git --exclude=build .
diff --git a/src/main.c b/src/main.c
index 7e6b2e1..b0cfff4 100644
--- a/src/main.c
+++ b/src/main.c
@@ -6,16 +6,9 @@
#include <term.h>
#include <reducer.h>
+#ifndef TEST
int main(void)
{
- /* struct term *term = */
- /* parse("([((1 0) 0)] ([[([0] 0)]] [([(0 0)] [(0 0)])]))"); */
- // 1-2-6-1-1-4-9-3-1-2-6-2-5-7-1-2-6-3-4-5-11-5-10-9-4-8-10
-
- /* struct term *term = parse( */
- /* "(([[(([([[((1 0) [[[0]]])]] ((((0 [[(((0 ([([(0 [[0]])] ((((0 (([[[((0 2) 1)]]] [[[[3]]]]) [[[[(2 3)]]]])) [(0 [[(([[[((0 2) 1)]]] ([[[[[(2 ((((4 3) 2) 1) 0))]]]]] 1)) ([[[[[(1 ((((4 3) 2) 1) 0))]]]]] 0))]])]) [(0 [[(([[[((0 2) 1)]]] ([[[[[(1 ((((4 3) 2) 1) 0))]]]]] 1)) ([[[[[(0 ((((4 3) 2) 1) 0))]]]]] 1))]])]) [(0 [[(([[[((0 2) 1)]]] ([[[[[(0 ((((4 3) 2) 1) 0))]]]]] 1)) ([[[[[(2 ((((4 3) 2) 1) 0))]]]]] 1))]])]))] (([(0 0)] [[((((0 [[[[3]]]]) [([[[[[(2 ((((4 3) 2) 1) 0))]]]]] ([((3 3) 0)] 0))]) [([[[[[(1 ((((4 3) 2) 1) 0))]]]]] ([((3 3) 0)] 0))]) [([[[[[(0 ((((4 3) 2) 1) 0))]]]]] ([((3 3) 0)] 0))])]]) 1))) ([([(0 [[0]])] ((((0 (([[[((0 2) 1)]]] [[[[3]]]]) [[[[(1 3)]]]])) [(0 [[(([[[((0 2) 1)]]] ([[[[[(2 ((((4 3) 2) 1) 0))]]]]] 1)) ([[[[[(0 ((((4 3) 2) 1) 0))]]]]] 1))]])]) [(0 [[(([[[((0 2) 1)]]] ([[[[[(1 ((((4 3) 2) 1) 0))]]]]] 1)) ([[[[[(2 ((((4 3) 2) 1) 0))]]]]] 0))]])]) [(0 [[(([[[((0 2) 1)]]] ([[[[[(0 ((((4 3) 2) 1) 0))]]]]] 1)) ([[[[[(1 ((((4 3) 2) 1) 0))]]]]] 1))]])]))] (([(0 0)] [[((((0 [[[[3]]]]) [([[[[[(2 ((((4 3) 2) 1) 0))]]]]] ([((3 3) 0)] 0))]) [([[[[[(1 ((((4 3) 2) 1) 0))]]]]] ([((3 3) 0)] 0))]) [([[[[[(0 ((((4 3) 2) 1) 0))]]]]] ([((3 3) 0)] 0))])]]) 1))) (([(0 0)] [[((((0 [[[[3]]]]) [([[[[[(2 ((((4 3) 2) 1) 0))]]]]] ([((3 3) 0)] 0))]) [([[[[[(1 ((((4 3) 2) 1) 0))]]]]] ([((3 3) 0)] 0))]) [([[[[[(0 ((((4 3) 2) 1) 0))]]]]] ([((3 3) 0)] 0))])]]) 1))]]) [[[((((1 ([(((1 ([[[[[(1 ((((4 3) 2) 1) 0))]]]]] ((3 0) [[[2]]]))) ([[[[[(0 ((((4 3) 2) 1) 0))]]]]] ((3 0) [[[0]]]))) ([[[[[(2 ((((4 3) 2) 1) 0))]]]]] ((3 0) [[[0]]])))] 1)) [(((1 ([[[[[(0 ((((4 3) 2) 1) 0))]]]]] ((3 0) [[[2]]]))) ([[[[[(2 ((((4 3) 2) 1) 0))]]]]] ((3 0) [[[0]]]))) ([[[[[(1 ((((4 3) 2) 1) 0))]]]]] ((3 0) [[[2]]])))]) [(([[[[[[((((5 2) 1) 0) ((((4 3) 2) 1) 0))]]]]]] 1) ((3 0) [[[0]]]))]) [(((1 ([[[[[(1 ((((4 3) 2) 1) 0))]]]]] ((3 0) [[[2]]]))) ([[[[[(0 ((((4 3) 2) 1) 0))]]]]] ((3 0) [[[0]]]))) ([[[[[(2 ((((4 3) 2) 1) 0))]]]]] ((3 0) [[[0]]])))])]]]) [[[((((1 ([(((1 ([[[[[(0 ((((4 3) 2) 1) 0))]]]]] ((3 0) [[[0]]]))) ([[[[[(2 ((((4 3) 2) 1) 0))]]]]] ((3 0) [[[1]]]))) ([[[[[(1 ((((4 3) 2) 1) 0))]]]]] ((3 0) [[[0]]])))] 1)) [(([[[[[[((((5 2) 1) 0) ((((4 3) 2) 1) 0))]]]]]] 1) ((3 0) [[[0]]]))]) [(((1 ([[[[[(1 ((((4 3) 2) 1) 0))]]]]] ((3 0) [[[0]]]))) ([[[[[(0 ((((4 3) 2) 1) 0))]]]]] ((3 0) [[[1]]]))) ([[[[[(2 ((((4 3) 2) 1) 0))]]]]] ((3 0) [[[1]]])))]) [(((1 ([[[[[(0 ((((4 3) 2) 1) 0))]]]]] ((3 0) [[[0]]]))) ([[[[[(2 ((((4 3) 2) 1) 0))]]]]] ((3 0) [[[1]]]))) ([[[[[(1 ((((4 3) 2) 1) 0))]]]]] ((3 0) [[[0]]])))])]]]) [[[((((1 ([(([[[[[[((((5 2) 1) 0) ((((4 3) 2) 1) 0))]]]]]] 1) ((3 0) [[[0]]]))] 1)) [(((1 ([[[[[(1 ((((4 3) 2) 1) 0))]]]]] ((3 0) [[[2]]]))) ([[[[[(0 ((((4 3) 2) 1) 0))]]]]] ((3 0) [[[0]]]))) ([[[[[(2 ((((4 3) 2) 1) 0))]]]]] ((3 0) [[[0]]])))]) [(((1 ([[[[[(0 ((((4 3) 2) 1) 0))]]]]] ((3 0) [[[0]]]))) ([[[[[(2 ((((4 3) 2) 1) 0))]]]]] ((3 0) [[[1]]]))) ([[[[[(1 ((((4 3) 2) 1) 0))]]]]] ((3 0) [[[0]]])))]) [(([[[[[[((((5 2) 1) 0) ((((4 3) 2) 1) 0))]]]]]] 1) ((3 0) [[[0]]]))])]]]))] 1) ([((((0 [[[[3]]]]) [[[[[(2 4)]]]]]) [[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) 2) 1) 0))]]]]] 1)) ([[[[[(1 ((((4 3) 2) 1) 0))]]]]] 0))]])]) [(0 [[(([[[((0 2) 1)]]] ([[[[[(1 ((((4 3) 2) 1) 0))]]]]] 1)) ([[[[[(0 ((((4 3) 2) 1) 0))]]]]] 1))]])]) [(0 [[(([[[((0 2) 1)]]] ([[[[[(0 ((((4 3) 2) 1) 0))]]]]] 1)) ([[[[[(2 ((((4 3) 2) 1) 0))]]]]] 1))]])]))] 1)) ([(0 [[0]])] 0)))))]]]) [[[[(0 (2 (1 3)))]]]]) (([([(1 [((1 1) 0)])] [(1 [((1 1) 0)])])] [[((([([(1 [((1 1) 0)])] [(1 [((1 1) 0)])])] [[[((([((0 [[[[[0]]]]]) [[1]])] 1) 0) (([[[((0 2) 1)]]] ([(0 [[1]])] 1)) ((2 ([(0 [[0]])] 1)) 0)))]]]) 0) (1 0))]]) [((0 [((0 [[1]]) [((0 [[0]]) [((0 [[0]]) [((0 [[0]]) [((0 [[0]]) [((0 [[1]]) [((0 [[1]]) [((0 [[0]]) [[0]])])])])])])])])]) [((0 [((0 [[0]]) [((0 [[1]]) [((0 [[0]]) [((0 [[0]]) [((0 [[0]]) [((0 [[1]]) [((0 [[1]]) [((0 [[0]]) [[0]])])])])])])])])]) [[0]])])]))");
// 1-1-1-2-6-1-2-6-1-3-2-5-6-2-6-2-6-1-1-1-2-6-1-1-3-3-1-1-2-6-1-2-6-1-3-2-5-6-2-6-1-1-1-2-6-1-2-6-1-3-2-5-6-2-6-2-6-1-1-1-2-6-1-1-3-3-3-2-5-5-5-6-1-1-3-2-5-6-2-6-2-6-2-6-2-6-3-1-1-2-6-2-6-2-5-5-5-6-1-1-3-2-5-6-2-6-2-6-2-6-2-6-3-1-1-1-2-6-1-1-1-1-3-3-2-5-5-6-2-6-2-6-2-6-1-3-2-5-6-3-1-3-2-5-6-2-5-6-2-6-3-1-1-2-6-2-6-2-5-5-7-1-1-4-9-3-1-2-6-1-3-4-5-6-1-1-3-2-5-6-2-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3-3-1-2-6-1-3-3-1-2-6-1-3-3-1-2-6-1-3-3-1-2-6-1-3-3-1-2-6-1-3-3-1-2-6-1-3-3-1-2-6-1-3-3-1-2-6-1-3-3-1-2-6-1-3-3-1-2-6-1-3-3-1-2-6-1-3-3-1-2-6-1-3-3-1-2-6-1-3-3-1-2-6-1-3-3-1-2-6-1-3-3-1-2-6-1-3-3-1-2-6-1-3-3-1-2-6-1-3-3-1-2-6-1-3-3-1-2-6-1-3-3-1-2-6-1-3-3-1-2-6-1-3-3-1-2-6-1-3-3-1-2-6-1-3-3-1-2-6-1-3-3-1-2-6-1-3-3-1-2-6-1-3-3-1
@@ -30,3 +23,96 @@ int main(void)
/* free_term(reduced); */
return 0;
}
+#else
+#define TESTS 2
+#define TESTDIR "./tests/"
+
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <time.h>
+
+static char *read_file(const char *path)
+{
+ FILE *f = fopen(path, "rb");
+ if (!f) {
+ fprintf(stderr, "Can't open file %s: %s\n", path,
+ strerror(errno));
+ return 0;
+ }
+ fseek(f, 0, SEEK_END);
+ long fsize = ftell(f);
+ fseek(f, 0, SEEK_SET);
+
+ char *string = malloc(fsize + 1);
+ int ret = fread(string, fsize, 1, f);
+ fclose(f);
+
+ if (ret != 1) {
+ fprintf(stderr, "Can't read file %s: %s\n", path,
+ strerror(errno));
+ return 0;
+ }
+
+ string[fsize] = 0;
+ return string;
+}
+
+int main(void)
+{
+ struct {
+ struct term *in;
+ struct term *res;
+ struct term *red;
+ char *trans;
+ struct {
+ int alpha;
+ int trans;
+ } equivalency;
+ } tests[TESTS] = { 0 };
+ char in_template[] = TESTDIR "x.in";
+ char red_template[] = TESTDIR "x.red";
+ char trans_template[] = TESTDIR "x.trans";
+ int offset = strlen(TESTDIR);
+ for (int i = 0; i < TESTS; i++) {
+ char ch = '0' + i + 1;
+ in_template[offset] = ch;
+ red_template[offset] = ch;
+ trans_template[offset] = ch;
+ tests[i].trans = read_file(trans_template);
+
+ char *in = read_file(in_template);
+ tests[i].in = parse(in);
+ free(in);
+
+ char *red = read_file(red_template);
+ tests[i].red = parse(red);
+ to_bruijn(tests[i].red);
+ free(red);
+ }
+
+ clock_t begin = clock();
+ for (int i = 0; i < TESTS; i++)
+ tests[i].res = reduce(tests[i].in);
+ clock_t end = clock();
+
+ for (int i = 0; i < TESTS; i++) {
+ to_bruijn(tests[i].res);
+ tests[i].equivalency.alpha =
+ alpha_equivalency(tests[i].res, tests[i].red);
+ tests[i].equivalency.trans = 1; // TODO
+ }
+
+ printf("=== SUMMARY ===\n");
+ printf("Reduced tests in %.5fs\n",
+ (double)(end - begin) / CLOCKS_PER_SEC);
+ for (int i = 0; i < TESTS; i++) {
+ if (!tests[i].equivalency.alpha ||
+ !tests[i].equivalency.trans) {
+ printf("Test %d: [failed]\n\talpha-equivalency: %d\n\ttrans-equivalency: %d\n",
+ i, tests[i].equivalency.alpha,
+ tests[i].equivalency.trans);
+ }
+ }
+}
+#endif
diff --git a/src/term.c b/src/term.c
index 52f606b..5189073 100644
--- a/src/term.c
+++ b/src/term.c
@@ -100,6 +100,53 @@ struct term *new_term(term_type type)
return term;
}
+struct term *duplicate_term(struct term *term)
+{
+ switch (term->type) {
+ case ABS:;
+ struct term *abs = new_term(ABS);
+ abs->u.abs.name = term->u.abs.name;
+ abs->u.abs.term = duplicate_term(term->u.abs.term);
+ return abs;
+ case APP:;
+ struct term *app = new_term(APP);
+ app->u.app.lhs = duplicate_term(term->u.app.lhs);
+ app->u.app.rhs = duplicate_term(term->u.app.rhs);
+ return app;
+ case VAR:;
+ struct term *var = new_term(VAR);
+ var->u.var.name = term->u.var.name;
+ var->u.var.type = term->u.var.type;
+ return var;
+ default:
+ fprintf(stderr, "Invalid type %d\n", term->type);
+ }
+ return 0;
+}
+
+int alpha_equivalency(struct term *a, struct term *b)
+{
+ if (a->type != b->type)
+ return 0;
+
+ switch (a->type) {
+ case ABS:
+ assert(!a->u.abs.name); // TODO: Only bruijn right now
+ return a->u.abs.name == b->u.abs.name &&
+ alpha_equivalency(a->u.abs.term, b->u.abs.term);
+ case APP:
+ return alpha_equivalency(a->u.app.lhs, b->u.app.lhs) &&
+ alpha_equivalency(a->u.app.rhs, b->u.app.rhs);
+ case VAR:;
+ assert(a->u.var.type == BRUIJN_INDEX &&
+ b->u.var.type == BRUIJN_INDEX);
+ return a->u.var.name == b->u.var.name;
+ default:
+ fprintf(stderr, "Invalid type %d\n", a->type);
+ }
+ return 0;
+}
+
void free_term(struct term *term)
{
switch (term->type) {
diff --git a/tests/1.in b/tests/1.in
new file mode 100644
index 0000000..770aae2
--- /dev/null
+++ b/tests/1.in
@@ -0,0 +1 @@
+([((1 0) 0)] ([[([0] 0)]] [([(0 0)] [(0 0)])]))
diff --git a/tests/1.red b/tests/1.red
new file mode 100644
index 0000000..73dac44
--- /dev/null
+++ b/tests/1.red
@@ -0,0 +1 @@
+((0 [0]) [0])
diff --git a/tests/1.trans b/tests/1.trans
new file mode 100644
index 0000000..2a30d16
--- /dev/null
+++ b/tests/1.trans
@@ -0,0 +1 @@
+1-2-6-1-1-4-9-3-1-2-6-2-5-7-1-2-6-3-4-5-11-5-10-9-4-8-10
diff --git a/tests/2.in b/tests/2.in
new file mode 100644
index 0000000..3739629
--- /dev/null
+++ b/tests/2.in
@@ -0,0 +1 @@
+(([[(([([[((1 0) [[[0]]])]] ((((0 [[(((0 ([([(0 [[0]])] ((((0 (([[[((0 2) 1)]]] [[[[3]]]]) [[[[(2 3)]]]])) [(0 [[(([[[((0 2) 1)]]] ([[[[[(2 ((((4 3) 2) 1) 0))]]]]] 1)) ([[[[[(1 ((((4 3) 2) 1) 0))]]]]] 0))]])]) [(0 [[(([[[((0 2) 1)]]] ([[[[[(1 ((((4 3) 2) 1) 0))]]]]] 1)) ([[[[[(0 ((((4 3) 2) 1) 0))]]]]] 1))]])]) [(0 [[(([[[((0 2) 1)]]] ([[[[[(0 ((((4 3) 2) 1) 0))]]]]] 1)) ([[[[[(2 ((((4 3) 2) 1) 0))]]]]] 1))]])]))] (([(0 0)] [[((((0 [[[[3]]]]) [([[[[[(2 ((((4 3) 2) 1) 0))]]]]] ([((3 3) 0)] 0))]) [([[[[[(1 ((((4 3) 2) 1) 0))]]]]] ([((3 3) 0)] 0))]) [([[[[[(0 ((((4 3) 2) 1) 0))]]]]] ([((3 3) 0)] 0))])]]) 1))) ([([(0 [[0]])] ((((0 (([[[((0 2) 1)]]] [[[[3]]]]) [[[[(1 3)]]]])) [(0 [[(([[[((0 2) 1)]]] ([[[[[(2 ((((4 3) 2) 1) 0))]]]]] 1)) ([[[[[(0 ((((4 3) 2) 1) 0))]]]]] 1))]])]) [(0 [[(([[[((0 2) 1)]]] ([[[[[(1 ((((4 3) 2) 1) 0))]]]]] 1)) ([[[[[(2 ((((4 3) 2) 1) 0))]]]]] 0))]])]) [(0 [[(([[[((0 2) 1)]]] ([[[[[(0 ((((4 3) 2) 1) 0))]]]]] 1)) ([[[[[(1 ((((4 3) 2) 1) 0))]]]]] 1))]])]))] (([(0 0)] [[((((0 [[[[3]]]]) [([[[[[(2 ((((4 3) 2) 1) 0))]]]]] ([((3 3) 0)] 0))]) [([[[[[(1 ((((4 3) 2) 1) 0))]]]]] ([((3 3) 0)] 0))]) [([[[[[(0 ((((4 3) 2) 1) 0))]]]]] ([((3 3) 0)] 0))])]]) 1))) (([(0 0)] [[((((0 [[[[3]]]]) [([[[[[(2 ((((4 3) 2) 1) 0))]]]]] ([((3 3) 0)] 0))]) [([[[[[(1 ((((4 3) 2) 1) 0))]]]]] ([((3 3) 0)] 0))]) [([[[[[(0 ((((4 3) 2) 1) 0))]]]]] ([((3 3) 0)] 0))])]]) 1))]]) [[[((((1 ([(((1 ([[[[[(1 ((((4 3) 2) 1) 0))]]]]] ((3 0) [[[2]]]))) ([[[[[(0 ((((4 3) 2) 1) 0))]]]]] ((3 0) [[[0]]]))) ([[[[[(2 ((((4 3) 2) 1) 0))]]]]] ((3 0) [[[0]]])))] 1)) [(((1 ([[[[[(0 ((((4 3) 2) 1) 0))]]]]] ((3 0) [[[2]]]))) ([[[[[(2 ((((4 3) 2) 1) 0))]]]]] ((3 0) [[[0]]]))) ([[[[[(1 ((((4 3) 2) 1) 0))]]]]] ((3 0) [[[2]]])))]) [(([[[[[[((((5 2) 1) 0) ((((4 3) 2) 1) 0))]]]]]] 1) ((3 0) [[[0]]]))]) [(((1 ([[[[[(1 ((((4 3) 2) 1) 0))]]]]] ((3 0) [[[2]]]))) ([[[[[(0 ((((4 3) 2) 1) 0))]]]]] ((3 0) [[[0]]]))) ([[[[[(2 ((((4 3) 2) 1) 0))]]]]] ((3 0) [[[0]]])))])]]]) [[[((((1 ([(((1 ([[[[[(0 ((((4 3) 2) 1) 0))]]]]] ((3 0) [[[0]]]))) ([[[[[(2 ((((4 3) 2) 1) 0))]]]]] ((3 0) [[[1]]]))) ([[[[[(1 ((((4 3) 2) 1) 0))]]]]] ((3 0) [[[0]]])))] 1)) [(([[[[[[((((5 2) 1) 0) ((((4 3) 2) 1) 0))]]]]]] 1) ((3 0) [[[0]]]))]) [(((1 ([[[[[(1 ((((4 3) 2) 1) 0))]]]]] ((3 0) [[[0]]]))) ([[[[[(0 ((((4 3) 2) 1) 0))]]]]] ((3 0) [[[1]]]))) ([[[[[(2 ((((4 3) 2) 1) 0))]]]]] ((3 0) [[[1]]])))]) [(((1 ([[[[[(0 ((((4 3) 2) 1) 0))]]]]] ((3 0) [[[0]]]))) ([[[[[(2 ((((4 3) 2) 1) 0))]]]]] ((3 0) [[[1]]]))) ([[[[[(1 ((((4 3) 2) 1) 0))]]]]] ((3 0) [[[0]]])))])]]]) [[[((((1 ([(([[[[[[((((5 2) 1) 0) ((((4 3) 2) 1) 0))]]]]]] 1) ((3 0) [[[0]]]))] 1)) [(((1 ([[[[[(1 ((((4 3) 2) 1) 0))]]]]] ((3 0) [[[2]]]))) ([[[[[(0 ((((4 3) 2) 1) 0))]]]]] ((3 0) [[[0]]]))) ([[[[[(2 ((((4 3) 2) 1) 0))]]]]] ((3 0) [[[0]]])))]) [(((1 ([[[[[(0 ((((4 3) 2) 1) 0))]]]]] ((3 0) [[[0]]]))) ([[[[[(2 ((((4 3) 2) 1) 0))]]]]] ((3 0) [[[1]]]))) ([[[[[(1 ((((4 3) 2) 1) 0))]]]]] ((3 0) [[[0]]])))]) [(([[[[[[((((5 2) 1) 0) ((((4 3) 2) 1) 0))]]]]]] 1) ((3 0) [[[0]]]))])]]]))] 1) ([((((0 [[[[3]]]]) [[[[[(2 4)]]]]]) [[[[[(1 4)]]]] ]) [[[[[(0 4)]]]]])] 0))]] [[[[(2 (2 (1 3)))]]]]) [[[[(1 3)]]]])
diff --git a/tests/2.red b/tests/2.red
new file mode 100644
index 0000000..bc83b7c
--- /dev/null
+++ b/tests/2.red
@@ -0,0 +1 @@
+[[[[(0 (2 (1 3)))]]]]
diff --git a/tests/2.trans b/tests/2.trans
new file mode 100644
index 0000000..1147e5d
--- /dev/null
+++ b/tests/2.trans
@@ -0,0 +1 @@
+1-1-2-6-2-6-1-1-2-6-1-2-6-2-6-1-1-3-1-1-1-1-3-3-2-5-5-6-2-6-2-6-2-6-1-3-2-5-6-2-5-6-2-6-1-1-1-1-3-3-1-2-6-1-1-1-1-3-3-2-5-5-6-2-6-2-6-2-6-1-3-2-5-6-2-5-5-6-2-6-2-6-2-6-1-3-2-5-6-1-1-2-6-2-6-2-7-2-7-2-7-2-7-1-1-1-1-3-3-2-5-5-6-2-6-2-6-3-4-5-9-1-1-1-1-3-1-1-3-1-4-6-2-5-6-2-6-1-1-1-1-3-3-3-3-2-5-5-5-5-6-2-6-2-6-2-6-3-1-2-6-1-1-1-3-2-5-6-2-6-2-6-3-1-2-6-2-5-5-5-6-2-6-2-6-2-6-1-3-4-5-9-1-1-1-1-3-1-1-3-1-3-2-5-6-2-5-6-2-6-1-1-1-1-3-3-4-5-5-6-2-6-2-6-2-6-3-1-2-6-1-1-1-3-2-5-6-2-6-2-6-3-1-2-6-2-5-5-5-6-2-6-2-6-2-6-1-3-3-4-5-5-9-1-1-1-1-3-1-1-3-3-2-5-5-6-2-6-1-1-1-3-2-5-6-2-6-2-6-3-1-1-2-6-1-3-2-5-6-2-6-1-1-1-1-3-3-3-4-5-5-5-6-2-6-2-6-2-6-3-2-5-5-5-6-2-6-2-6-2-6-3-3-3-4-5-5-5-10-10-10-11-5-11-5-11-5-11-5
diff --git a/tests/3.in b/tests/3.in
new file mode 100644
index 0000000..544aef9
--- /dev/null
+++ b/tests/3.in
@@ -0,0 +1 @@
+((([([(1 [((1 1) 0)])] [(1 [((1 1) 0)])])] [[[((([((0 [[[[[0]]]]]) [[1]])] 0) [[0]]) ((([((((0 [[1]]) [[[0]]]) [[[0]]]) [0])] 1) [[0]]) (([[[((0 2) 1)]]] ([(0 [[1]])] 0)) ((2 ([([(0 [[0]])] ((((0 (([[[((0 2) 1)]]] [[[[3]]]]) [[[[(2 3)]]]])) [(0 [[(([[[((0 2) 1)]]] ([[[[[(2 ((((4 3) 2) 1) 0))]]]]] 1)) ([[[[[(1 ((((4 3) 2) 1) 0))]]]]] 0))]])]) [(0 [[(([[[((0 2) 1)]]] ([[[[[(1 ((((4 3) 2) 1) 0))]]]]] 1)) ([[[[[(0 ((((4 3) 2) 1) 0))]]]]] 1))]])]) [(0 [[(([[[((0 2) 1)]]] ([[[[[(0 ((((4 3) 2) 1) 0))]]]]] 1)) ([[[[[(2 ((((4 3) 2) 1) 0))]]]]] 1))]])]))] 1)) ([(0 [[0]])] 0)))))]]]) [[[[(0 (2 (1 3)))]]]]) (([([(1 [((1 1) 0)])] [(1 [((1 1) 0)])])] [[((([([(1 [((1 1) 0)])] [(1 [((1 1) 0)])])] [[[((([((0 [[[[[0]]]]]) [[1]])] 1) 0) (([[[((0 2) 1)]]] ([(0 [[1]])] 1)) ((2 ([(0 [[0]])] 1)) 0)))]]]) 0) (1 0))]]) [((0 [((0 [[1]]) [((0 [[0]]) [((0 [[0]]) [((0 [[0]]) [((0 [[0]]) [((0 [[1]]) [((0 [[1]]) [((0 [[0]]) [[0]])])])])])])])])]) [((0 [((0 [[0]]) [((0 [[1]]) [((0 [[0]]) [((0 [[0]]) [((0 [[0]]) [((0 [[1]]) [((0 [[1]]) [((0 [[0]]) [[0]])])])])])])])])]) [[0]])])]))
diff --git a/tests/3.red b/tests/3.red
new file mode 100644
index 0000000..78cc9df
--- /dev/null
+++ b/tests/3.red
@@ -0,0 +1 @@
+[((0 [((0 [[1]]) [((0 [[0]]) [((0 [[0]]) [((0 [[0]]) [((0 [[0]]) [((0 [[1]]) [((0 [[1]]) [((0 [[0]]) [[0]])])])])])])])])]) [((0 [((0 [[0]]) [((0 [[1]]) [((0 [[0]]) [((0 [[0]]) [((0 [[0]]) [((0 [[1]]) [((0 [[1]]) [((0 [[0]]) [[0]])])])])])])])])]) [((0 [((0 [[1]]) [((0 [[0]]) [((0 [[0]]) [((0 [[0]]) [((0 [[0]]) [((0 [[1]]) [((0 [[1]]) [((0 [[0]]) [[0]])])])])])])])])]) [((0 [((0 [[0]]) [((0 [[1]]) [((0 [[0]]) [((0 [[0]]) [((0 [[0]]) [((0 [[1]]) [((0 [[1]]) [((0 [[0]]) [[0]])])])])])])])])]) [((0 [((0 [[1]]) [((0 [[0]]) [((0 [[0]]) [((0 [[0]]) [((0 [[0]]) [((0 [[1]]) [((0 [[1]]) [((0 [[0]]) [[0]])])])])])])])])]) [((0 [((0 [[0]]) [((0 [[1]]) [((0 [[0]]) [((0 [[0]]) [((0 [[0]]) [((0 [[1]]) [((0 [[1]]) [((0 [[0]]) [[0]])])])])])])])])]) [[0]])])])])])])]
diff --git a/tests/3.trans b/tests/3.trans
new file mode 100644
index 0000000..003ebc3
--- /dev/null
+++ b/tests/3.trans
@@ -0,0 +1 @@
+1-1-1-2-6-1-2-6-1-3-2-5-6-2-6-2-6-1-1-1-2-6-1-1-3-3-1-1-2-6-1-2-6-1-3-2-5-6-2-6-1-1-1-2-6-1-2-6-1-3-2-5-6-2-6-2-6-1-1-1-2-6-1-1-3-3-3-2-5-5-5-6-1-1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