diff options
| author | kr.angelov <kr.angelov@gmail.com> | 2013-01-07 12:50:32 +0000 |
|---|---|---|
| committer | kr.angelov <kr.angelov@gmail.com> | 2013-01-07 12:50:32 +0000 |
| commit | 2c169406fcfa7a38cd89f8a6acbd0bb138d7c330 (patch) | |
| tree | f169176053215f23bf098d22e8c1f24a2b222c16 /src/runtime/c/pgf/pgf.c | |
| parent | cade578d04b7a104723a06beea98895369c85cfc (diff) | |
a new reasoner in the C runtime. It supports tabling which makes it decideable for propositional logic. dependent types and high-order types are not supported yet. The generation is still in decreasing probability order
Diffstat (limited to 'src/runtime/c/pgf/pgf.c')
| -rw-r--r-- | src/runtime/c/pgf/pgf.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/runtime/c/pgf/pgf.c b/src/runtime/c/pgf/pgf.c index 46592fa21..ccee4bf24 100644 --- a/src/runtime/c/pgf/pgf.c +++ b/src/runtime/c/pgf/pgf.c @@ -155,10 +155,23 @@ pgf_iter_functions_by_cat(PgfPGF* pgf, PgfCId catname, return; } - for (size_t i = 0; i < abscat->n_functions; i++) { - fn->fn(fn, &abscat->functions[i].fun, NULL, err); - if (!gu_ok(err)) - return; + size_t n_functions = gu_buf_length(abscat->functions); + for (size_t i = 0; i < n_functions; i++) { + PgfFunDecl* fun = + gu_buf_get(abscat->functions, PgfFunDecl*, i); + + GuVariantInfo i = gu_variant_open(fun->ep.expr); + switch (i.tag) { + case PGF_EXPR_FUN: { + PgfExprFun* efun = i.data; + fn->fn(fn, &efun->fun, NULL, err); + if (!gu_ok(err)) + return; + break; + } + default: + gu_impossible(); + } } } |
