From 1cfb9752290197f8964a550db71403a715200544 Mon Sep 17 00:00:00 2001 From: "kr.angelov" Date: Fri, 31 Oct 2014 19:57:56 +0000 Subject: [PATCH] a skeletal module for higher-order pattern unification in the C runtime --- src/runtime/c/Makefile.am | 3 ++- src/runtime/c/pgf/hopu.c | 10 ++++++++++ src/runtime/c/pgf/hopu.h | 7 +++++++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 src/runtime/c/pgf/hopu.c create mode 100644 src/runtime/c/pgf/hopu.h diff --git a/src/runtime/c/Makefile.am b/src/runtime/c/Makefile.am index 539a0e507..5fe493c65 100644 --- a/src/runtime/c/Makefile.am +++ b/src/runtime/c/Makefile.am @@ -76,10 +76,11 @@ libpgf_la_SOURCES = \ pgf/typechecker.c \ pgf/reasoner.c \ pgf/evaluator.c \ + pgf/hopu.c \ pgf/printer.c \ pgf/graphviz.c \ pgf/pgf.c \ - pgf/pgf.h + pgf/pgf.h \ libpgf_la_LDFLAGS = "-no-undefined" libpgf_la_LIBADD = libgu.la diff --git a/src/runtime/c/pgf/hopu.c b/src/runtime/c/pgf/hopu.c new file mode 100644 index 000000000..5767feac0 --- /dev/null +++ b/src/runtime/c/pgf/hopu.c @@ -0,0 +1,10 @@ +#include "data.h" +#include "evaluator.h" +#include "hopu.h" + +void pgf_pattern_unify(PgfEvalState* state, PgfClosure* c1, PgfClosure* c2) +{ + c1 = state->eval_gates->enter(state, c1); + c2 = state->eval_gates->enter(state, c2); +} + diff --git a/src/runtime/c/pgf/hopu.h b/src/runtime/c/pgf/hopu.h new file mode 100644 index 000000000..e012a3630 --- /dev/null +++ b/src/runtime/c/pgf/hopu.h @@ -0,0 +1,7 @@ +#ifndef HOPU_H +#define HOPU_H + +void pgf_pattern_unify(PgfEvalState* state, PgfClosure* c1, PgfClosure* c2); + +#endif +