]> Repositorios git - scryer-prolog.git/commitdiff
support call/N
authorMark Thom <[email protected]>
Thu, 25 May 2017 01:10:31 +0000 (19:10 -0600)
committerMark Thom <[email protected]>
Thu, 25 May 2017 01:10:31 +0000 (19:10 -0600)
16 files changed:
Cargo.lock
Cargo.toml
README.md
src/main.rs
src/prolog/allocator.rs
src/prolog/ast.rs
src/prolog/codegen.rs
src/prolog/debray_allocator.rs
src/prolog/fixtures.rs
src/prolog/io.rs
src/prolog/iterators.rs
src/prolog/machine.rs
src/prolog/naive_allocator.rs
src/prolog/prolog_parser.lalrpop
src/prolog/prolog_parser.rs
src/prolog/targets.rs

index 37ee06779f9e5240bf75eba0725f5fdee4baa0ef..29899435698987ae37ff96f8af395cf47ffdb9bb 100644 (file)
@@ -1,6 +1,6 @@
 [root]
 name = "rusty-wam"
-version = "0.6.3"
+version = "0.6.4"
 dependencies = [
  "lalrpop 0.12.5 (registry+https://github.com/rust-lang/crates.io-index)",
  "lalrpop-util 0.12.5 (registry+https://github.com/rust-lang/crates.io-index)",
index 78a76d83f984b6ebf3f75027b07b128361a83e26..46c8ec45a49c31e2ad0955a000001d961638103a 100644 (file)
@@ -1,6 +1,6 @@
 [package]
 name = "rusty-wam"
-version = "0.6.3"
+version = "0.6.4"
 authors = ["Mark Thom"]
 
 build = "build.rs"
index bb9ebbce2263d3eea7232b13e737404298b60755..795baa17e45e3724c8639b28b2713d79554d73b0 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,18 +1,35 @@
 # rusty-wam
 
+## Phase 1
+
 An implementation of the Warren Abstract Machine in Rust, done
 according to the progression of languages in [Warren's Abstract
 Machine: A Tutorial
-Reconstruction](http://wambook.sourceforge.net/wambook.pdf), ending in
-pure Prolog.
-
-## Progress
-
-Prolog is implemented as a simple REPL. It is without meta- or
-extra-logical operators, or side effects of any kind, with the lone
-exception of cut. In terms of the tutorial pacing, the work covers in
-some form all of the WAM book, including lists, cuts, Debray
-allocation, indexing, and conjunctive queries.
+Reconstruction](http://wambook.sourceforge.net/wambook.pdf).
+
+Phase 1 has been completed, in that rusty-wam implements in some form
+all of the WAM book, including lists, cuts, Debray allocation, first
+argument indexing, and conjunctive queries.
+
+## Phase 2
+
+Extend rusty-wam to include the following, among other features:
+
+* call/N as a built-in meta-predicate (_done_).
+* ISO Prolog compliant throw/catch.
+* Support for built-in and user-defined operators of all fixities,
+  with custom associativity and precedence.
+* Bignum and floating point arithmetic.
+* Standard built-in control operators (`;`, `->`, etc.).
+* Attributed variables using the SICStus Prolog interface and
+  semantics. Implementing coroutines like `dif/2`, `freeze/2`
+  is easy with attributed variables. 
+* An occurs check.
+* Built-in predicates for list processing and top-level declarative
+  control (`setup_call_control/3`, `call_with_inference_limit/3`,
+  etc.)
+* Mode declarations.
+* Extensions for clp(FD). 
 
 ## Tutorial
 To enter a multi-clause predicate, the brackets ":{" and "}:" are used
@@ -91,17 +108,4 @@ prolog>
 Note that the values of variables belonging to successful queries are
 printed out, on one line each. Uninstantiated variables are denoted by
 a number preceded by an underscore (`X = _0` is an example in the
-above).
-
-## Occurs check
-
-There's no occurs check, but there soon will be. Currently, attempting
-unification on a cyclic term succeeds, and the attempt to write the
-term to a string results in an infinite loop, ie.
-
-```
-prolog> p(W, W).
-prolog> ?- p(f(f(W)), W).
-true
-*loops to infinity*
-```
\ No newline at end of file
+above).
\ No newline at end of file
index ea274c4ec7cd8f1b2e4ed59a5cae6b8704e39c6a..788faa9297149aedf8a24dcec1de4032922418c5 100644 (file)
@@ -434,50 +434,50 @@ mod tests {
         assert_eq!(submit(&mut wam, "?- p([Y|[d|Xs]])."), true);
         assert_eq!(submit(&mut wam, "?- p(blah)."), true);
 
-        submit(&mut wam, "call(or(X, Y)) :- call(X).
-                          call(trace) :- trace.
-                          call(or(X, Y)) :- call(Y).
-                          call(notrace) :- notrace.
-                          call(nl) :- nl.
-                          call(X) :- builtin(X).
-                          call(X) :- extern(X).
-                          call(call(X)) :- call(X).
-                          call(repeat).
-                          call(repeat) :- call(repeat).
-                          call(false).");
-
-        assert_eq!(submit(&mut wam, "?- call(repeat)."), true);
-        assert_eq!(submit(&mut wam, "?- call(false)."), true);
-        assert_eq!(submit(&mut wam, "?- call(call(repeat))."), true);
-        assert_eq!(submit(&mut wam, "?- call(call(false))."), true);
-        assert_eq!(submit(&mut wam, "?- call(notrace)."), false);
-        assert_eq!(submit(&mut wam, "?- call(nl)."), false);
-        assert_eq!(submit(&mut wam, "?- call(builtin(X))."), false);
-        assert_eq!(submit(&mut wam, "?- call(extern(X))."), false);
+        submit(&mut wam, "ind_call(or(X, Y)) :- ind_call(X).
+                          ind_call(trace) :- trace.
+                          ind_call(or(X, Y)) :- ind_call(Y).
+                          ind_call(notrace) :- notrace.
+                          ind_call(nl) :- nl.
+                          ind_call(X) :- builtin(X).
+                          ind_call(X) :- extern(X).
+                          ind_call(ind_call(X)) :- ind_call(X).
+                          ind_call(repeat).
+                          ind_call(repeat) :- ind_call(repeat).
+                          ind_call(false).");
+
+        assert_eq!(submit(&mut wam, "?- ind_call(repeat)."), true);
+        assert_eq!(submit(&mut wam, "?- ind_call(false)."), true);
+        assert_eq!(submit(&mut wam, "?- ind_call(ind_call(repeat))."), true);
+        assert_eq!(submit(&mut wam, "?- ind_call(ind_call(false))."), true);
+        assert_eq!(submit(&mut wam, "?- ind_call(notrace)."), false);
+        assert_eq!(submit(&mut wam, "?- ind_call(nl)."), false);
+        assert_eq!(submit(&mut wam, "?- ind_call(builtin(X))."), false);
+        assert_eq!(submit(&mut wam, "?- ind_call(extern(X))."), false);
 
         submit(&mut wam, "notrace.");
         submit(&mut wam, "nl.");
 
-        assert_eq!(submit(&mut wam, "?- call(repeat)."), true);
-        assert_eq!(submit(&mut wam, "?- call(false)."), true);
-        assert_eq!(submit(&mut wam, "?- call(call(repeat))."), true);
-        assert_eq!(submit(&mut wam, "?- call(call(false))."), true);
-        assert_eq!(submit(&mut wam, "?- call(notrace)."), true);
-        assert_eq!(submit(&mut wam, "?- call(nl)."), true);
-        assert_eq!(submit(&mut wam, "?- call(builtin(X))."), false);
-        assert_eq!(submit(&mut wam, "?- call(extern(X))."), false);
+        assert_eq!(submit(&mut wam, "?- ind_call(repeat)."), true);
+        assert_eq!(submit(&mut wam, "?- ind_call(false)."), true);
+        assert_eq!(submit(&mut wam, "?- ind_call(ind_call(repeat))."), true);
+        assert_eq!(submit(&mut wam, "?- ind_call(ind_call(false))."), true);
+        assert_eq!(submit(&mut wam, "?- ind_call(notrace)."), true);
+        assert_eq!(submit(&mut wam, "?- ind_call(nl)."), true);
+        assert_eq!(submit(&mut wam, "?- ind_call(builtin(X))."), false);
+        assert_eq!(submit(&mut wam, "?- ind_call(extern(X))."), false);
 
         submit(&mut wam, "builtin(X).");
         submit(&mut wam, "extern(x).");
 
-        assert_eq!(submit(&mut wam, "?- call(repeat)."), true);
-        assert_eq!(submit(&mut wam, "?- call(false)."), true);
-        assert_eq!(submit(&mut wam, "?- call(call(repeat))."), true);
-        assert_eq!(submit(&mut wam, "?- call(call(false))."), true);
-        assert_eq!(submit(&mut wam, "?- call(notrace)."), true);
-        assert_eq!(submit(&mut wam, "?- call(nl)."), true);
-        assert_eq!(submit(&mut wam, "?- call(builtin(X))."), true);
-        assert_eq!(submit(&mut wam, "?- call(extern(X))."), true);
+        assert_eq!(submit(&mut wam, "?- ind_call(repeat)."), true);
+        assert_eq!(submit(&mut wam, "?- ind_call(false)."), true);
+        assert_eq!(submit(&mut wam, "?- ind_call(ind_call(repeat))."), true);
+        assert_eq!(submit(&mut wam, "?- ind_call(ind_call(false))."), true);
+        assert_eq!(submit(&mut wam, "?- ind_call(notrace)."), true);
+        assert_eq!(submit(&mut wam, "?- ind_call(nl)."), true);
+        assert_eq!(submit(&mut wam, "?- ind_call(builtin(X))."), true);
+        assert_eq!(submit(&mut wam, "?- ind_call(extern(X))."), true);
     }
 
     #[test]
@@ -541,6 +541,59 @@ mod tests {
         assert_eq!(submit(&mut wam, "?- p(X, Y), q(Y, X)."), true);
         assert_eq!(submit(&mut wam, "?- q(X, Y), p(Y, X)."), true);
     }
+
+    #[test]
+    fn test_queries_on_call_n()
+    {
+        let mut wam = Machine::new();
+        
+        submit(&mut wam, "maplist(Pred, []).
+                          maplist(Pred, [X|Xs]) :- call(Pred, X), maplist(Pred, Xs).");
+        submit(&mut wam, "f(a). f(b). f(c).");
+
+        assert_eq!(submit(&mut wam, "?- maplist(f, [X,Y,Z])."), true);
+        assert_eq!(submit(&mut wam, "?- maplist(f, [a,Y,Z])."), true);
+        assert_eq!(submit(&mut wam, "?- maplist(f, [X,a,b])."), true);
+        assert_eq!(submit(&mut wam, "?- maplist(f, [c,a,b])."), true);
+        assert_eq!(submit(&mut wam, "?- maplist(f, [d,e,f])."), false);
+        assert_eq!(submit(&mut wam, "?- maplist(f, [])."), true);
+        assert_eq!(submit(&mut wam, "?- maplist(f(X), [a,b,c])."), false);
+
+        submit(&mut wam, "f(X) :- call(X), call(X).");
+        submit(&mut wam, "p(x). p(y).");
+
+        assert_eq!(submit(&mut wam, "?- f(p)."), false);
+        assert_eq!(submit(&mut wam, "?- f(p(X))."), true);
+        assert_eq!(submit(&mut wam, "?- f(p(x))."), true);
+        assert_eq!(submit(&mut wam, "?- f(p(w))."), false);
+        assert_eq!(submit(&mut wam, "?- f(p(X, Y))."), false);
+
+        submit(&mut wam, "f(P) :- call(P, X), call(P, Y).");
+
+        assert_eq!(submit(&mut wam, "?- f(p)."), true);
+        assert_eq!(submit(&mut wam, "?- f(non_existent)."), false);
+
+        submit(&mut wam, "f(P, X, Y) :- call(P, X), call(P, Y).");
+
+        assert_eq!(submit(&mut wam, "?- f(p, X, Y)."), true);
+        assert_eq!(submit(&mut wam, "?- f(p, x, Y)."), true);
+        assert_eq!(submit(&mut wam, "?- f(p, X, y)."), true);
+        assert_eq!(submit(&mut wam, "?- f(p, x, y)."), true);
+        assert_eq!(submit(&mut wam, "?- f(p, X, z)."), false);
+        assert_eq!(submit(&mut wam, "?- f(p, z, Y)."), false);
+        
+        assert_eq!(submit(&mut wam, "?- call(p, X)."), true);
+        assert_eq!(submit(&mut wam, "?- call(p, x)."), true);
+        assert_eq!(submit(&mut wam, "?- call(p, y)."), true);
+        assert_eq!(submit(&mut wam, "?- call(p, z)."), false);
+
+        submit(&mut wam, "r(f(X)) :- p(X). r(g(Y)) :- p(Y).");
+
+        assert_eq!(submit(&mut wam, "?- f(r, X, Y)."), true);
+        assert_eq!(submit(&mut wam, "?- f(r, X, X)."), true);
+        assert_eq!(submit(&mut wam, "?- f(r, f(X), g(Y))."), true);
+        assert_eq!(submit(&mut wam, "?- f(r, j(X), h(Y))."), false);
+    }
 }
 
 fn process_buffer(wam: &mut Machine, buffer: &str)
index 047b35e5bde0fe3c79809b2bd7e75f24acecb50b..b5a05ef1090e87eb575b769fa80896a587c36957 100644 (file)
@@ -18,7 +18,7 @@ pub trait Allocator<'a>
     fn reset(&mut self);
     fn reset_contents(&mut self) {}
 
-    fn advance(&mut self, GenContext, &'a Term);
+    fn advance(&mut self, GenContext, QueryTermRef<'a>);
     fn advance_arg(&mut self);
 
     fn bindings(&self) -> &AllocVarDict<'a>;
index f49a7baa2f56f74e8c9617e6e0de4d21d4e11ba3..6b35c1a92eaa8e629f9e68d324fc3c660dcad209 100644 (file)
@@ -44,7 +44,7 @@ impl PredicateClause {
 pub enum TopLevel {
     Fact(Term),
     Predicate(Vec<PredicateClause>),
-    Query(Vec<TermOrCut>),
+    Query(Vec<QueryTerm>),
     Rule(Rule)
 }
 
@@ -114,31 +114,61 @@ pub enum Term {
     Var(Cell<VarReg>, Var)
 }
 
-pub enum TermOrCut {
+pub enum QueryTerm {
+    CallN(Cell<VarReg>, Var, Vec<Box<Term>>),
     Cut,
     Term(Term)
 }
 
-impl TermOrCut {
+impl QueryTerm {
     pub fn arity(&self) -> usize {
         match self {
-            &TermOrCut::Term(ref term) => term.arity(),
+            &QueryTerm::Term(ref term) => term.arity(),
+            &QueryTerm::CallN(_, _, ref terms) => terms.len() + 1,
             _ => 0
         }
     }
+
+    pub fn to_ref(&self) -> QueryTermRef {
+        match self {
+            &QueryTerm::CallN(ref cell, ref var, ref terms) =>
+                QueryTermRef::CallN(cell, var, terms),
+            &QueryTerm::Cut =>
+                QueryTermRef::Cut,
+            &QueryTerm::Term(ref term) =>
+                QueryTermRef::Term(term)
+        }
+    }
 }
 
 pub struct Rule {
-    pub head: (Term, TermOrCut),
-    pub clauses: Vec<TermOrCut>
+    pub head: (Term, QueryTerm),
+    pub clauses: Vec<QueryTerm>
+}
+
+#[derive(Clone, Copy)]
+pub enum ClauseType<'a> {
+    CallN(&'a Cell<VarReg>, &'a Var),    
+    Deep(Level, &'a Cell<RegType>, &'a Atom),
+    Root
+}
+
+impl<'a> ClauseType<'a> {
+    pub fn level_of_subterms(self) -> Level {
+        match self {
+            ClauseType::CallN(_, _) => Level::Shallow,
+            ClauseType::Deep(_, _, _) => Level::Deep,
+            ClauseType::Root => Level::Shallow
+        }
+    }
 }
 
 #[derive(Clone, Copy)]
 pub enum TermRef<'a> {
-    AnonVar(Level),
+    AnonVar(Level),    
     Cons(Level, &'a Cell<RegType>, &'a Term, &'a Term),
     Constant(Level, &'a Cell<RegType>, &'a Constant),
-    Clause(Level, &'a Cell<RegType>, &'a Atom, &'a Vec<Box<Term>>),
+    Clause(ClauseType<'a>, &'a Vec<Box<Term>>),
     Var(Level, &'a Cell<VarReg>, &'a Var)
 }
 
@@ -147,15 +177,40 @@ impl<'a> TermRef<'a> {
         match self {
             TermRef::AnonVar(lvl)
           | TermRef::Cons(lvl, _, _, _)
-          | TermRef::Constant(lvl, _, _)
-          | TermRef::Clause(lvl, _, _, _)
-          | TermRef::Var(lvl, _, _) => lvl
+          | TermRef::Constant(lvl, _, _)          
+          | TermRef::Var(lvl, _, _) => lvl,
+            TermRef::Clause(ClauseType::Root, _) => Level::Shallow,
+            TermRef::Clause(ClauseType::Deep(lvl, _, _), _) => lvl,
+            TermRef::Clause(ClauseType::CallN(_, _), _) => Level::Shallow
         }
     }
 }
 
-pub enum TermOrCutRef<'a> {
-    Cut, Term(&'a Term)
+#[derive(Clone, Copy)]
+pub enum QueryTermRef<'a> {
+    CallN(&'a Cell<VarReg>, &'a Var, &'a Vec<Box<Term>>),
+    Cut,
+    Term(&'a Term)
+}
+
+impl<'a> QueryTermRef<'a> {
+    pub fn arity(self) -> usize {
+        match self {
+            QueryTermRef::Term(term) => term.arity(),
+            QueryTermRef::CallN(_, _, terms) => terms.len() + 1,
+            _ => 0
+        }
+    }
+    
+    pub fn is_callable(self) -> bool {
+        match self {
+            QueryTermRef::Term(&Term::Clause(_, _, _))
+          | QueryTermRef::Term(&Term::Constant(_, Constant::Atom(_)))
+          | QueryTermRef::CallN(_, _, _) =>
+                true,
+            _ => false
+        }
+    }    
 }
 
 pub enum ChoiceInstruction {
@@ -199,6 +254,8 @@ impl IndexedChoiceInstruction {
 pub enum ControlInstruction {
     Allocate(usize),
     Call(Atom, usize, usize),
+    CallN(usize),
+    ExecuteN(usize),
     Deallocate,
     Execute(Atom, usize),
     Proceed
@@ -209,6 +266,8 @@ impl ControlInstruction {
         match self {
             &ControlInstruction::Call(_, _, _) => true,
             &ControlInstruction::Execute(_, _) => true,
+            &ControlInstruction::CallN(_) => true,
+            &ControlInstruction::ExecuteN(_) => true,
             _ => false
         }
     }
@@ -435,13 +494,6 @@ impl Term {
         }
     }
 
-    pub fn subterms(&self) -> usize {
-        match self {
-            &Term::Clause(_, _, ref terms) => terms.len(),
-            _ => 1
-        }
-    }
-
     pub fn name(&self) -> Option<&Atom> {
         match self {
             &Term::Constant(_, Constant::Atom(ref atom))
index 0faf24e1b9f092a5595e183727e7e4a729be1743..e9c87e696c4572cb6819c1abab9d9824b46f6dfe 100644 (file)
@@ -5,7 +5,6 @@ use prolog::indexing::*;
 use prolog::iterators::*;
 use prolog::targets::*;
 
-use std::cell::Cell;
 use std::collections::HashMap;
 use std::vec::Vec;
 
@@ -34,7 +33,7 @@ impl<'a, TermMarker: Allocator<'a>> CodeGenerator<'a, TermMarker>
     }
 
     fn update_var_count<Iter>(&mut self, iter: Iter)
-        where Iter : Iterator<Item=TermRef<'a>>
+        where Iter: Iterator<Item=TermRef<'a>>
     {
         for term in iter {
             if let TermRef::Var(_, _, var) = term {
@@ -48,62 +47,6 @@ impl<'a, TermMarker: Allocator<'a>> CodeGenerator<'a, TermMarker>
         *self.var_count.get(var).unwrap()
     }
 
-    fn to_structure<Target>(&mut self,
-                            lvl: Level,
-                            cell: &'a Cell<RegType>,
-                            term_loc: GenContext,
-                            name: &'a Atom,
-                            arity: usize,
-                            target: &mut Vec<Target>)
-                            -> Target
-        where Target: CompilationTarget<'a>
-    {
-        self.marker.mark_non_var(lvl, term_loc, cell, target);
-        Target::to_structure(lvl, name.clone(), arity, cell.get())
-    }
-
-    fn to_constant<Target>(&mut self,
-                           lvl: Level,
-                           cell: &'a Cell<RegType>,
-                           term_loc: GenContext,
-                           constant: &'a Constant,
-                           target: &mut Vec<Target>)
-                           -> Target
-        where Target: CompilationTarget<'a>
-    {
-        self.marker.mark_non_var(lvl, term_loc, cell, target);
-        Target::to_constant(lvl, constant.clone(), cell.get())
-    }
-
-    fn to_list<Target>(&mut self,
-                       lvl: Level,
-                       term_loc: GenContext,
-                       cell: &'a Cell<RegType>,
-                       target: &mut Vec<Target>)
-                       -> Target
-        where Target: CompilationTarget<'a>
-    {
-        self.marker.mark_non_var(lvl, term_loc, cell, target);
-        Target::to_list(lvl, cell.get())
-    }
-
-    fn constant_subterm<Target>(&mut self, constant: &'a Constant) -> Target
-        where Target: CompilationTarget<'a>
-    {
-        Target::constant_subterm(constant.clone())
-    }
-
-    fn non_var_subterm<Target>(&mut self,
-                               lvl: Level,
-                               term_loc: GenContext,
-                               cell: &'a Cell<RegType>,
-                               target: &mut Vec<Target>)
-                               -> Target
-        where Target: CompilationTarget<'a>
-    {
-        self.marker.mark_non_var(lvl, term_loc, cell, target);
-        Target::clause_arg_to_instr(cell.get())
-    }
 
     fn add_or_increment_void_instr<Target>(target: &mut Vec<Target>)
         where Target: CompilationTarget<'a>
@@ -131,11 +74,11 @@ impl<'a, TermMarker: Allocator<'a>> CodeGenerator<'a, TermMarker>
             &Term::AnonVar =>
                 Self::add_or_increment_void_instr(target),
             &Term::Cons(ref cell, _, _) | &Term::Clause(ref cell, _, _) => {
-                let instr = self.non_var_subterm(Level::Deep, term_loc, cell, target);
-                target.push(instr);
+                self.marker.mark_non_var(Level::Deep, term_loc, cell, target);
+                target.push(Target::clause_arg_to_instr(cell.get()));
             },
             &Term::Constant(_, ref constant) =>
-                target.push(self.constant_subterm(constant)),
+                target.push(Target::constant_subterm(constant.clone())),
             &Term::Var(ref cell, ref var) =>
                 if is_exposed || self.get_var_count(var) > 1 {
                     self.marker.mark_var(var, Level::Deep, cell, term_loc, target);
@@ -145,39 +88,51 @@ impl<'a, TermMarker: Allocator<'a>> CodeGenerator<'a, TermMarker>
         };
     }
 
-    fn compile_target<Target>(&mut self, term: &'a Term, term_loc: GenContext, is_exposed: bool)
-                              -> Vec<Target>
+    fn compile_clause<Target>(&mut self,
+                              ct: ClauseType<'a>,
+                              term_loc: GenContext,
+                              is_exposed: bool,
+                              terms: &'a Vec<Box<Term>>,
+                              target: &mut Vec<Target>)
         where Target: CompilationTarget<'a>
     {
-        let iter       = Target::iter(term);
-        let mut target = Vec::<Target>::new();
+        match ct {
+            ClauseType::CallN(_, _) =>
+                for subterm in terms {
+                    self.subterm_to_instr(subterm.as_ref(), term_loc, is_exposed, target);
+                },
+            ClauseType::Deep(lvl, cell, atom) => {
+                self.marker.mark_non_var(lvl, term_loc, cell, target);
+                target.push(Target::to_structure(lvl, atom.clone(), terms.len(), cell.get()));
+
+                for subterm in terms {
+                    self.subterm_to_instr(subterm.as_ref(), term_loc, is_exposed, target);
+                }
+            },
+            _ => {}
+        }
+    }
+
+    fn compile_target<Target, Iter>(&mut self, iter: Iter, term_loc: GenContext, is_exposed: bool)
+                                    -> Vec<Target>
+        where Target: CompilationTarget<'a>, Iter: Iterator<Item=TermRef<'a>>
+    {
+        let mut target = Vec::new();
 
         for term in iter {
             match term {
-                TermRef::Clause(lvl, cell, atom, terms) => {
-                    let str_instr = self.to_structure(lvl,
-                                                      cell,
-                                                      term_loc,
-                                                      atom,
-                                                      terms.len(),
-                                                      &mut target);
-
-                    target.push(str_instr);
-
-                    for subterm in terms {
-                        self.subterm_to_instr(subterm.as_ref(), term_loc, is_exposed, &mut target);
-                    }
-                },
+                TermRef::Clause(ct, terms) =>
+                    self.compile_clause(ct, term_loc, is_exposed, terms, &mut target),
                 TermRef::Cons(lvl, cell, head, tail) => {
-                    let list_instr = self.to_list(lvl, term_loc, cell, &mut target);
-                    target.push(list_instr);
+                    self.marker.mark_non_var(lvl, term_loc, cell, &mut target);
+                    target.push(Target::to_list(lvl, cell.get()));
 
                     self.subterm_to_instr(head, term_loc, is_exposed, &mut target);
                     self.subterm_to_instr(tail, term_loc, is_exposed, &mut target);
                 },
                 TermRef::Constant(lvl @ Level::Shallow, cell, constant) => {
-                    let const_instr = self.to_constant(lvl, cell, term_loc, constant, &mut target);
-                    target.push(const_instr);
+                    self.marker.mark_non_var(lvl, term_loc, cell, &mut target);
+                    target.push(Target::to_constant(lvl, constant.clone(), cell.get()));
                 },
                 TermRef::AnonVar(lvl @ Level::Shallow) =>
                     if let GenContext::Head = term_loc {
@@ -210,13 +165,11 @@ impl<'a, TermMarker: Allocator<'a>> CodeGenerator<'a, TermMarker>
                     GenContext::Last(chunk_num)
                 };
 
-                match term_or_cut_ref {
-                    &TermOrCutRef::Term(term) => {
-                        self.update_var_count(term.breadth_first_iter());
-                        vs.mark_vars_in_chunk(term, last_term_arity, chunk_num, term_loc);
-                    },
-                    _ => {}
-                };
+                self.update_var_count(term_or_cut_ref.post_order_iter());
+                vs.mark_vars_in_chunk(term_or_cut_ref.post_order_iter(),
+                                      last_term_arity,
+                                      chunk_num,
+                                      term_loc);
             }
         }
 
@@ -226,14 +179,18 @@ impl<'a, TermMarker: Allocator<'a>> CodeGenerator<'a, TermMarker>
         (vs, has_deep_cut)
     }
 
-    fn add_conditional_call(compiled_query: &mut Code, term: &Term, pvs: usize)
+    fn add_conditional_call(compiled_query: &mut Code, qt: QueryTermRef, pvs: usize)
     {
-        match term {
-            &Term::Constant(_, Constant::Atom(ref atom)) => {
+        match qt {
+            QueryTermRef::CallN(_, _, terms) => {
+                let call = ControlInstruction::CallN(terms.len());
+                compiled_query.push(Line::Control(call));
+            },
+            QueryTermRef::Term(&Term::Constant(_, Constant::Atom(ref atom))) => {
                 let call = ControlInstruction::Call(atom.clone(), 0, pvs);
                 compiled_query.push(Line::Control(call));
             },
-            &Term::Clause(_, ref atom, ref terms) => {
+            QueryTermRef::Term(&Term::Clause(_, ref atom, ref terms)) => {
                 let call = ControlInstruction::Call(atom.clone(), terms.len(), pvs);
                 compiled_query.push(Line::Control(call));
             },
@@ -241,25 +198,30 @@ impl<'a, TermMarker: Allocator<'a>> CodeGenerator<'a, TermMarker>
         }
     }
 
-    fn lco(body: &mut Code, toc: &TermOrCut) -> usize
+    fn lco(body: &mut Code, toc: &QueryTerm) -> usize
     {
         let last_arity = toc.arity();
         let mut dealloc_index = body.len() - 1;
 
         match toc {
-            &TermOrCut::Term(Term::Clause(_, ref name, _))
-          | &TermOrCut::Term(Term::Constant(_, Constant::Atom(ref name))) =>
-              if let &mut Line::Control(ref mut ctrl) = body.last_mut().unwrap() {
-                  *ctrl = ControlInstruction::Execute(name.clone(), last_arity);
-              },
+            &QueryTerm::Term(Term::Clause(_, ref name, _))
+          | &QueryTerm::Term(Term::Constant(_, Constant::Atom(ref name))) =>
+                if let &mut Line::Control(ref mut ctrl) = body.last_mut().unwrap() {
+                    *ctrl = ControlInstruction::Execute(name.clone(), last_arity);
+                },
+            &QueryTerm::CallN(_, _, ref terms) =>
+                if let &mut Line::Control(ref mut ctrl) = body.last_mut().unwrap() {
+                    *ctrl = ControlInstruction::ExecuteN(terms.len());
+                },
             _ => dealloc_index = body.len()
+            
         };
 
         dealloc_index
     }
 
     fn compile_seq(&mut self,
-                   clauses: &'a [TermOrCut],
+                   clauses: &'a [QueryTerm],
                    vs: &VariableFixtures<'a>,
                    body: &mut Code,
                    is_exposed: bool)
@@ -270,24 +232,20 @@ impl<'a, TermMarker: Allocator<'a>> CodeGenerator<'a, TermMarker>
             self.marker.reset_contents();
 
             for (i, term) in terms.iter().enumerate() {
+                let term_loc = if i + 1 < terms.len() {
+                    GenContext::Mid(chunk_num)
+                } else {
+                    GenContext::Last(chunk_num)
+                };
+
                 let mut body_appendage = match term {
-                    &TermOrCutRef::Cut if i + 1 < terms.len() =>
+                    &QueryTermRef::Cut if i + 1 < terms.len() =>
                         vec![Line::Cut(CutInstruction::Cut(Terminal::Non))],
-                    &TermOrCutRef::Cut =>
+                    &QueryTermRef::Cut =>
                         vec![Line::Cut(CutInstruction::Cut(Terminal::Terminal))],
-                    &TermOrCutRef::Term(term) if i + 1 < terms.len() => {
-                        let num_vars = vs.vars_above_threshold(i + 1);
-                        self.compile_query_line(term,
-                                                GenContext::Mid(chunk_num),
-                                                num_vars,
-                                                is_exposed)
-                    },
-                    &TermOrCutRef::Term(term) => {
+                    _ => {
                         let num_vars = vs.vars_above_threshold(i + 1);
-                        self.compile_query_line(term,
-                                                GenContext::Last(chunk_num),
-                                                num_vars,
-                                                is_exposed)
+                        self.compile_query_line(*term, term_loc, num_vars, is_exposed)
                     }
                 };
 
@@ -317,14 +275,14 @@ impl<'a, TermMarker: Allocator<'a>> CodeGenerator<'a, TermMarker>
     }
 
     fn compile_neck_cut_or(&mut self,
-                           p1: &'a TermOrCut,
+                           p1: &'a QueryTerm,
                            body: &mut Code,
                            perm_vars: usize,
                            is_exposed: bool,
                            at_end: bool)
     {
         match p1 {
-            &TermOrCut::Cut => {
+            &QueryTerm::Cut => {
                 let term = if at_end {
                     Terminal::Terminal
                 } else {
@@ -333,25 +291,26 @@ impl<'a, TermMarker: Allocator<'a>> CodeGenerator<'a, TermMarker>
 
                 body.push(Line::Cut(CutInstruction::NeckCut(term)));
             },
-            &TermOrCut::Term(ref p1) => {
+            _ => {
+                let p1 = p1.to_ref();
+
                 self.marker.advance(GenContext::Head, p1);
 
-                if p1.is_clause() {
-                    let term_loc = if p1.is_callable() {
-                        GenContext::Last(0)
-                    } else {
-                        GenContext::Mid(0)
-                    };
+                let term_loc = if p1.is_callable() {
+                    GenContext::Last(0)
+                } else {
+                    GenContext::Mid(0)
+                };
 
-                    body.push(Line::Query(self.compile_target(p1, term_loc, is_exposed)));
-                }
+                let iter = p1.post_order_iter();
+                body.push(Line::Query(self.compile_target(iter, term_loc, is_exposed)));
 
                 Self::add_conditional_call(body, p1, perm_vars);
             }
         };
     }
 
-    fn compile_cleanup(body: &mut Code, num_clauses: usize, toc: &TermOrCut)
+    fn compile_cleanup(body: &mut Code, num_clauses: usize, toc: &QueryTerm)
     {
         let dealloc_index = Self::lco(body, toc);
 
@@ -369,12 +328,13 @@ impl<'a, TermMarker: Allocator<'a>> CodeGenerator<'a, TermMarker>
         let &Rule { head: (ref p0, ref p1), ref clauses } = rule;
         let mut code = Vec::new();
 
-        self.marker.advance(GenContext::Head, p0);
+        self.marker.advance(GenContext::Head, QueryTermRef::Term(p0));
 
         let perm_vars = self.compile_seq_prelude(clauses.len(), &vs, deep_cuts, &mut code);
 
         if p0.is_clause() {
-            code.push(Line::Fact(self.compile_target(p0, GenContext::Head, false)));
+            let iter = FactInstruction::iter(p0);
+            code.push(Line::Fact(self.compile_target(iter, GenContext::Head, false)));
         }
 
         self.compile_neck_cut_or(p1, &mut code, perm_vars, false, clauses.len() == 0);
@@ -430,12 +390,14 @@ impl<'a, TermMarker: Allocator<'a>> CodeGenerator<'a, TermMarker>
         let (vs, _) = self.collect_var_data(iter);
         self.marker.drain_var_data(vs);
 
-        self.marker.advance(GenContext::Head, term);
+        self.marker.advance(GenContext::Head, QueryTermRef::Term(term));
 
         let mut code = Vec::new();
 
         if term.is_clause() {
-            let mut compiled_fact = self.compile_target(term, GenContext::Head, false);
+            let iter = FactInstruction::iter(term);
+            let mut compiled_fact = self.compile_target(iter, GenContext::Head, false);
+
             self.mark_unsafe_fact_vars(&mut compiled_fact);
             code.push(Line::Fact(compiled_fact));
         }
@@ -447,7 +409,7 @@ impl<'a, TermMarker: Allocator<'a>> CodeGenerator<'a, TermMarker>
     }
 
     fn compile_query_line(&mut self,
-                          term: &'a Term,
+                          term: QueryTermRef<'a>,
                           term_loc: GenContext,
                           index: usize,
                           is_exposed: bool)
@@ -457,17 +419,17 @@ impl<'a, TermMarker: Allocator<'a>> CodeGenerator<'a, TermMarker>
 
         let mut code = Vec::new();
 
-        if term.is_clause() {
-            let compiled_query = Line::Query(self.compile_target(term, term_loc, is_exposed));
-            code.push(compiled_query);
-        }
+        let iter = term.post_order_iter();
+        let compiled_query = Line::Query(self.compile_target(iter, term_loc, is_exposed));
+
+        code.push(compiled_query);
 
         Self::add_conditional_call(&mut code, term, index);
 
         code
     }
 
-    pub fn compile_query(&mut self, query: &'a Vec<TermOrCut>) -> Code
+    pub fn compile_query(&mut self, query: &'a Vec<QueryTerm>) -> Code
     {
         let iter = ChunkedIterator::from_term_sequence(query);
         let (mut vs, deep_cuts) = self.collect_var_data(iter);
index 29c5f1c7fcd5fe835a439740bcf1c79956d4e225..b99031d68419f4890d6a3fe20b1329271dcefc7d 100644 (file)
@@ -332,7 +332,7 @@ impl<'a> Allocator<'a> for DebrayAllocator<'a>
         self.bindings
     }
     
-    fn advance(&mut self, _: GenContext, term: &'a Term) {
+    fn advance(&mut self, _: GenContext, term: QueryTermRef<'a>) {
         self.arg_c   = 1;
         self.temp_lb = term.arity() + 1;
     }
index 32f6bb813f6b67649a62656ade0910247433d2a7..a1284cca34b06f10b14743e007faeaee4b3d4dcb 100644 (file)
@@ -171,15 +171,16 @@ impl<'a> VariableFixtures<'a>
         var_count
     }
 
-    pub fn mark_vars_in_chunk(&mut self,
-                              term: &'a Term,
-                              last_term_arity: usize,
-                              chunk_num: usize,
-                              term_loc: GenContext)
+    pub fn mark_vars_in_chunk<Iter>(&mut self,
+                                    iter: Iter,
+                                    last_term_arity: usize,
+                                    chunk_num: usize,
+                                    term_loc: GenContext)
+        where Iter: Iterator<Item=TermRef<'a>>
     {
         let mut arg_c = 1;
 
-        for term_ref in term.breadth_first_iter() {
+        for term_ref in iter {
             if let TermRef::Var(lvl, cell, var) = term_ref {
                 let mut status = self.0.remove(var)
                     .unwrap_or((VarStatus::Temp(chunk_num, TempVarData::new(last_term_arity)),
index abf71628a5fc83ddc32765bc20e22fb93d4455ba..5f2ff0444bad8b82592b7d140b6df68970dac2d7 100644 (file)
@@ -98,6 +98,10 @@ impl fmt::Display for ControlInstruction {
                 write!(f, "allocate {}", num_cells),
             &ControlInstruction::Call(ref name, arity, pvs) =>
                 write!(f, "call {}/{}, {}", name, arity, pvs),
+            &ControlInstruction::CallN(arity) =>
+                write!(f, "call_N {}", arity),
+            &ControlInstruction::ExecuteN(arity) =>
+                write!(f, "execute_N {}", arity),
             &ControlInstruction::Deallocate =>
                 write!(f, "deallocate"),
             &ControlInstruction::Execute(ref name, arity) =>
@@ -265,6 +269,7 @@ pub fn eval<'a, 'b: 'a>(wam: &'a mut Machine, tl: &'b TopLevel) -> EvalSession<'
 
             if is_consistent(clauses) {
                 let compiled_pred = cg.compile_predicate(clauses);
+                print_code(&compiled_pred);
                 wam.add_predicate(clauses, compiled_pred);
 
                 EvalSession::EntrySuccess
@@ -280,6 +285,7 @@ Each predicate must have the same name and arity.";
             let mut cg = CodeGenerator::<DebrayAllocator>::new();
 
             let compiled_fact = cg.compile_fact(fact);
+            print_code(&compiled_fact);
             wam.add_fact(fact, compiled_fact);
 
             EvalSession::EntrySuccess
@@ -288,6 +294,7 @@ Each predicate must have the same name and arity.";
             let mut cg = CodeGenerator::<DebrayAllocator>::new();
 
             let compiled_rule = cg.compile_rule(rule);
+            print_code(&compiled_rule);
             wam.add_rule(rule, compiled_rule);
 
             EvalSession::EntrySuccess
@@ -296,7 +303,8 @@ Each predicate must have the same name and arity.";
             let mut cg = CodeGenerator::<DebrayAllocator>::new();
 
             let compiled_query = cg.compile_query(query);
-            wam.submit_query(compiled_query, cg.take_vars())
+            print_code(&compiled_query);
+            wam.submit_query(compiled_query, cg.take_vars())            
         }
     }
 }
index d7d673656a892b89ed3de8752f1b7579092a14f6..20b9cfe5bea12b4dc5d5ff72f4313fb34fd9aab1 100644 (file)
@@ -7,11 +7,10 @@ use std::vec::Vec;
 
 enum IteratorState<'a> {
     AnonVar(Level),
-    Clause(Level, usize, &'a Cell<RegType>, &'a Atom, &'a Vec<Box<Term>>),
+    Clause(usize, ClauseType<'a>, &'a Vec<Box<Term>>),
     Constant(Level, &'a Cell<RegType>, &'a Constant),
     InitialCons(Level, &'a Cell<RegType>, &'a Term, &'a Term),
     FinalCons(Level, &'a Cell<RegType>, &'a Term, &'a Term),
-    RootClause(usize, &'a Vec<Box<Term>>),
     Var(Level, &'a Cell<VarReg>, &'a Var)
 }
 
@@ -21,7 +20,7 @@ impl<'a> IteratorState<'a> {
             &Term::AnonVar =>
                 IteratorState::AnonVar(lvl),
             &Term::Clause(ref cell, ref atom, ref child_terms) =>
-                IteratorState::Clause(lvl, 0, cell, atom, child_terms),
+                IteratorState::Clause(0, ClauseType::Deep(lvl, cell, atom), child_terms),
             &Term::Cons(ref cell, ref head, ref tail) =>
                 IteratorState::InitialCons(lvl, cell, head.as_ref(), tail.as_ref()),
             &Term::Constant(ref cell, ref constant) =>
@@ -37,46 +36,26 @@ pub struct QueryIterator<'a> {
 }
 
 impl<'a> QueryIterator<'a> {
-    fn push_clause(&mut self,
-                   lvl: Level,
-                   child_num: usize,
-                   cell: &'a Cell<RegType>,
-                   name: &'a Atom,
-                   child_terms: &'a Vec<Box<Term>>)
+    fn push_clause(&mut self, child_num: usize, ct: ClauseType<'a>, child_terms: &'a Vec<Box<Term>>)
     {
-        self.state_stack.push(IteratorState::Clause(lvl,
-                                                    child_num,
-                                                    cell,
-                                                    name,
-                                                    child_terms));
-    }
-
-    fn push_root_clause(&mut self,
-                        child_num: usize,
-                        child_terms: &'a Vec<Box<Term>>)
-    {
-        self.state_stack.push(IteratorState::RootClause(child_num, child_terms));
+        self.state_stack.push(IteratorState::Clause(child_num, ct, child_terms));
     }
 
     fn push_subterm(&mut self, lvl: Level, term: &'a Term) {
         self.state_stack.push(IteratorState::to_state(lvl, term));
     }
 
-    fn push_final_cons(&mut self,
-                       lvl: Level,
-                       cell: &'a Cell<RegType>,
-                       head: &'a Term,
-                       tail: &'a Term)
+    fn push_final_cons(&mut self, lvl: Level, cell: &'a Cell<RegType>, head: &'a Term, tail: &'a Term)
     {
         self.state_stack.push(IteratorState::FinalCons(lvl, cell, head, tail));
     }
 
-    fn new(term: &'a Term) -> QueryIterator<'a> {
+    fn from_term(term: &'a Term) -> Self {
         let state = match term {
             &Term::AnonVar =>
                 IteratorState::AnonVar(Level::Shallow),
             &Term::Clause(_, _, ref terms) =>
-                IteratorState::RootClause(0, terms),
+                IteratorState::Clause(0, ClauseType::Root, terms),
             &Term::Cons(ref cell, ref head, ref tail) =>
                 IteratorState::InitialCons(Level::Shallow, cell, head.as_ref(), tail.as_ref()),
             &Term::Constant(ref cell, ref constant) =>
@@ -87,6 +66,24 @@ impl<'a> QueryIterator<'a> {
 
         QueryIterator { state_stack: vec![state] }
     }
+
+    fn new(term: QueryTermRef<'a>) -> Self {
+        match term {
+            QueryTermRef::CallN(cell, var, child_terms) => {
+                let state = IteratorState::Clause(0, ClauseType::CallN(cell, var), child_terms);
+
+                QueryIterator { state_stack: vec![state] }
+            },
+            QueryTermRef::Term(term) => Self::from_term(term),
+            _ => QueryIterator { state_stack: vec![] }
+        }
+    }
+}
+
+impl<'a> QueryTermRef<'a> {
+    pub fn post_order_iter(self) -> QueryIterator<'a> {
+        QueryIterator::new(self)
+    }
 }
 
 impl<'a> Iterator for QueryIterator<'a> {
@@ -97,12 +94,21 @@ impl<'a> Iterator for QueryIterator<'a> {
             match iter_state {
                 IteratorState::AnonVar(lvl) =>
                     return Some(TermRef::AnonVar(lvl)),
-                IteratorState::Clause(lvl, child_num, cell, atom, child_terms) => {
+                IteratorState::Clause(child_num, ct, child_terms) => {
                     if child_num == child_terms.len() {
-                        return Some(TermRef::Clause(lvl, cell, atom, child_terms));
+                        match ct {
+                            ClauseType::Root =>
+                                return None,
+                            ClauseType::Deep(_, _, _) =>
+                                return Some(TermRef::Clause(ct, child_terms)),
+                            ClauseType::CallN(cell, var) => {
+                                let state = IteratorState::Var(Level::Shallow, cell, var);
+                                self.state_stack.push(state);
+                            }
+                        };
                     } else {
-                        self.push_clause(lvl, child_num + 1, cell, atom, child_terms);
-                        self.push_subterm(Level::Deep, child_terms[child_num].as_ref());
+                        self.push_clause(child_num + 1, ct, child_terms);
+                        self.push_subterm(ct.level_of_subterms(), child_terms[child_num].as_ref());
                     }
                 },
                 IteratorState::InitialCons(lvl, cell, head, tail) => {
@@ -114,14 +120,6 @@ impl<'a> Iterator for QueryIterator<'a> {
                     return Some(TermRef::Cons(lvl, cell, head, tail)),
                 IteratorState::Constant(lvl, cell, constant) =>
                     return Some(TermRef::Constant(lvl, cell, constant)),
-                IteratorState::RootClause(child_num, child_terms) => {
-                    if child_num == child_terms.len() {
-                        return None;
-                    } else {
-                        self.push_root_clause(child_num + 1, child_terms);
-                        self.push_subterm(Level::Shallow, child_terms[child_num].as_ref());
-                    }
-                },
                 IteratorState::Var(lvl, cell, var) =>
                     return Some(TermRef::Var(lvl, cell, var))
             };
@@ -145,7 +143,7 @@ impl<'a> FactIterator<'a> {
             &Term::AnonVar =>
                 vec![IteratorState::AnonVar(Level::Shallow)],
             &Term::Clause(_, _, ref terms) =>
-                vec![IteratorState::RootClause(0, terms)],
+                vec![IteratorState::Clause(0, ClauseType::Root, terms)],
             &Term::Cons(ref cell, ref head, ref tail) =>
                 vec![IteratorState::InitialCons(Level::Shallow,
                                                 cell,
@@ -169,12 +167,21 @@ impl<'a> Iterator for FactIterator<'a> {
             match state {
                 IteratorState::AnonVar(lvl) =>
                     return Some(TermRef::AnonVar(lvl)),
-                IteratorState::Clause(lvl, _, cell, atom, child_terms) => {
+                IteratorState::Clause(_, ct, child_terms) => {
                     for child_term in child_terms {
-                        self.push_subterm(Level::Deep, child_term);
+                        self.push_subterm(ct.level_of_subterms(), child_term);
                     }
 
-                    return Some(TermRef::Clause(lvl, cell, atom, child_terms));
+                    match ct {
+                        ClauseType::Root =>
+                            continue,
+                        ClauseType::Deep(_, _, _) =>
+                            return Some(TermRef::Clause(ct, child_terms)),
+                        ClauseType::CallN(cell, var) => {
+                            let state = IteratorState::Var(Level::Shallow, cell, var);
+                            self.state_queue.push_back(state);
+                        }
+                    };
                 },
                 IteratorState::InitialCons(lvl, cell, head, tail) => {
                     self.push_subterm(Level::Deep, head);
@@ -184,11 +191,6 @@ impl<'a> Iterator for FactIterator<'a> {
                 },
                 IteratorState::Constant(lvl, cell, constant) =>
                     return Some(TermRef::Constant(lvl, cell, constant)),
-                IteratorState::RootClause(_, child_terms) => {
-                    for child_term in child_terms {
-                        self.push_subterm(Level::Shallow, child_term);
-                    }
-                },
                 IteratorState::Var(lvl, cell, var) =>
                     return Some(TermRef::Var(lvl, cell, var)),
                 _ => {}
@@ -201,7 +203,7 @@ impl<'a> Iterator for FactIterator<'a> {
 
 impl Term {
     pub fn post_order_iter(&self) -> QueryIterator {
-        QueryIterator::new(self)
+        QueryIterator::new(QueryTermRef::Term(self))
     }
 
     pub fn breadth_first_iter(&self) -> FactIterator {
@@ -212,7 +214,7 @@ impl Term {
 pub struct ChunkedIterator<'a>
 {
     at_head: bool,
-    iter: Box<Iterator<Item=TermOrCutRef<'a>> + 'a>,
+    iter: Box<Iterator<Item=QueryTermRef<'a>> + 'a>,
     deep_cut_encountered: bool
 }
 
@@ -220,8 +222,8 @@ impl<'a> ChunkedIterator<'a>
 {
     pub fn from_term(term: &'a Term, at_head: bool) -> Self
     {
-        let inner_iter: Box<Iterator<Item=TermOrCutRef<'a>>> =
-            Box::new(once(TermOrCutRef::Term(term)));
+        let inner_iter: Box<Iterator<Item=QueryTermRef<'a>>> =
+            Box::new(once(QueryTermRef::Term(term)));
 
         ChunkedIterator {
             at_head: at_head,
@@ -230,14 +232,9 @@ impl<'a> ChunkedIterator<'a>
         }
     }
 
-    pub fn from_term_sequence(terms: &'a [TermOrCut]) -> Self
+    pub fn from_term_sequence(terms: &'a [QueryTerm]) -> Self
     {
-        let iter = terms.iter().map(|c| {
-            match c {
-                &TermOrCut::Cut => TermOrCutRef::Cut,
-                &TermOrCut::Term(ref term) => TermOrCutRef::Term(term)
-            }
-        });
+        let iter = terms.iter().map(|c| c.to_ref());
 
         ChunkedIterator {
             at_head: false,
@@ -245,24 +242,22 @@ impl<'a> ChunkedIterator<'a>
             deep_cut_encountered: false
         }
     }
-    
+
     pub fn from_rule(rule: &'a Rule) -> Self
     {
         let &Rule { head: (ref p0, ref p1), ref clauses } = rule;
-        let iter = once(TermOrCutRef::Term(p0));
+        let iter = once(QueryTermRef::Term(p0));
 
-        let inner_iter : Box<Iterator<Item=TermOrCutRef<'a>>> = match p1 {
-            &TermOrCut::Term(ref p1) => Box::new(once(TermOrCutRef::Term(p1))),
+        let inner_iter : Box<Iterator<Item=QueryTermRef<'a>>> = match p1 {
+            &QueryTerm::CallN(ref cell, ref var, ref child_terms) =>
+                Box::new(once(QueryTermRef::CallN(cell, var, child_terms))),
+            &QueryTerm::Term(ref p1) =>
+                Box::new(once(QueryTermRef::Term(p1))),
             _ => Box::new(empty())
         };
 
-        let iter = iter.chain(inner_iter.chain(clauses.iter().map(|c| {
-            match c {
-                &TermOrCut::Cut => TermOrCutRef::Cut,
-                &TermOrCut::Term(ref term) => TermOrCutRef::Term(term)
-            }
-        })));
-                              
+        let iter = iter.chain(inner_iter.chain(clauses.iter().map(|c| c.to_ref())));
+
         ChunkedIterator {
             at_head: true,
             iter: Box::new(iter),
@@ -277,15 +272,15 @@ impl<'a> ChunkedIterator<'a>
     pub fn at_head(&self) -> bool {
         self.at_head
     }
-    
-    fn take_chunk(&mut self, term: TermOrCutRef<'a>) -> (usize, Vec<TermOrCutRef<'a>>)
+
+    fn take_chunk(&mut self, term: QueryTermRef<'a>) -> (usize, Vec<QueryTermRef<'a>>)
     {
         let mut result = vec![term];
         let mut arity = 0;
 
         while let Some(term) = self.iter.next() {
             match term {
-                TermOrCutRef::Term(inner_term) => {
+                QueryTermRef::Term(inner_term) => {
                     result.push(term);
 
                     if inner_term.is_callable() {
@@ -293,9 +288,14 @@ impl<'a> ChunkedIterator<'a>
                         break;
                     }
                 },
+                QueryTermRef::CallN(_, _, child_terms) => {
+                    result.push(term);
+                    arity = child_terms.len() + 1;
+                    break;
+                },
                 _ => {
                     result.push(term);
-                    self.deep_cut_encountered = true;                    
+                    self.deep_cut_encountered = true;
                 }
             };
         }
@@ -307,18 +307,18 @@ impl<'a> ChunkedIterator<'a>
 impl<'a> Iterator for ChunkedIterator<'a>
 {
     // the last term arity, and the reference.
-    type Item = (usize, Vec<TermOrCutRef<'a>>);
+    type Item = (usize, Vec<QueryTermRef<'a>>);
 
     fn next(&mut self) -> Option<Self::Item> {
         loop {
             match self.iter.next() {
                 None => return None,
-                Some(TermOrCutRef::Term(term)) if self.at_head => {
+                Some(QueryTermRef::Term(term)) if self.at_head => {
                     self.at_head = false;
-                    return Some(self.take_chunk(TermOrCutRef::Term(term)));
+                    return Some(self.take_chunk(QueryTermRef::Term(term)));
                 },
-                Some(TermOrCutRef::Term(term)) if term.is_callable() =>
-                    return Some((term.arity(), vec![TermOrCutRef::Term(term)])),
+                Some(QueryTermRef::Term(term)) if term.is_callable() =>
+                    return Some((term.arity(), vec![QueryTermRef::Term(term)])),
                 Some(term_or_cut_ref) =>
                     return Some(self.take_chunk(term_or_cut_ref))
             }
index 6efb3e12d991510159b56ab557698cf50c9c5cc1..ae82952d7f624d60ca6a840eb9190cf6f6d82f24 100644 (file)
@@ -247,13 +247,13 @@ impl Machine {
                     let e = self.ms.e;
                     let r = var_data.as_reg_type().reg_num();
                     let addr = self.ms.and_stack[e][r].clone();
-                    
+
                     heap_locs.insert(var, addr);
                 },
                 &VarData::Temp(cn, _, _) if cn == chunk_num => {
                     let r = var_data.as_reg_type();
                     let addr = self.ms[r].clone();
-                    
+
                     heap_locs.insert(var, addr);
                 },
                 _ => {}
@@ -276,21 +276,21 @@ impl Machine {
 
                 self.ms.p = CodePtr::TopLevel(cn, p);
             }
-                
+
             self.query_stepper();
 
             match self.ms.p {
                 CodePtr::TopLevel(_, p) if p > 0 => {},
-                _ => break                    
-            };            
+                _ => break
+            };
         }
     }
 
     pub fn submit_query<'a>(&mut self, code: Code, alloc_locs: AllocVarDict<'a>) -> EvalSession<'a>
     {
         let mut heap_locs = HashMap::new();
-        self.cached_query = Some(code);
-
+        
+        self.cached_query = Some(code);            
         self.run_query(&alloc_locs, &mut heap_locs);
 
         if self.failed() {
@@ -951,6 +951,35 @@ impl MachineState {
         }
     }
 
+    fn try_call_predicate(&mut self, code_dir: &CodeDir, name: Atom, arity: usize)
+    {
+        let compiled_tl_index = code_dir.get(&(name, arity)).map(|index| *index);
+
+        match compiled_tl_index {
+            Some(compiled_tl_index) => {
+                self.cp = self.p + 1;
+                self.num_of_args = arity;
+                self.b0 = self.b;
+                self.p  = CodePtr::DirEntry(compiled_tl_index);
+            },
+            None => self.fail = true
+        };
+    }
+
+    fn try_execute_predicate(&mut self, code_dir: &CodeDir, name: Atom, arity: usize)
+    {
+        let compiled_tl_index = code_dir.get(&(name, arity)).map(|index| *index);
+
+        match compiled_tl_index {
+            Some(compiled_tl_index) => {
+                self.num_of_args = arity;
+                self.b0 = self.b;
+                self.p  = CodePtr::DirEntry(compiled_tl_index);
+            },
+            None => self.fail = true
+        };        
+    }
+    
     fn execute_ctrl_instr(&mut self, code_dir: &CodeDir, instr: &ControlInstruction)
     {
         match instr {
@@ -958,22 +987,33 @@ impl MachineState {
                 let num_frames = self.num_frames();
 
                 self.and_stack.push(num_frames + 1, self.e, self.cp, num_cells);
-
+                
                 self.e = self.and_stack.len() - 1;
                 self.p += 1;
             },
-            &ControlInstruction::Call(ref name, arity, _) => {
-                let compiled_tl_index = code_dir.get(&(name.clone(), arity))
-                                                .map(|index| *index);
-
-                match compiled_tl_index {
-                    Some(compiled_tl_index) => {
-                        self.cp = self.p + 1;
-                        self.num_of_args = arity;
-                        self.b0 = self.b;
-                        self.p  = CodePtr::DirEntry(compiled_tl_index);
+            &ControlInstruction::Call(ref name, arity, _) =>
+                self.try_call_predicate(code_dir, name.clone(), arity),
+            &ControlInstruction::CallN(arity) => {
+                let addr = self.deref(self.registers[arity + 1].clone());
+
+                match self.store(addr) {
+                    Addr::Str(a) => {
+                        let result = self.heap[a].clone();
+
+                        if let HeapCellValue::NamedStr(narity, name) = result {
+                            for i in 1 .. narity + 1 {
+                                self.registers[i + narity] = self.registers[i].clone();
+                                self.registers[i] = self.heap[a + i].as_addr(a + i);
+                            }
+
+                            self.try_call_predicate(code_dir, name, arity + narity);
+                        } else {
+                            self.fail = true;
+                        }
                     },
-                    None => self.fail = true
+                    Addr::Con(Constant::Atom(name)) =>
+                        self.try_call_predicate(code_dir, name, arity),
+                    _ => self.fail = true
                 };
             },
             &ControlInstruction::Deallocate => {
@@ -984,18 +1024,30 @@ impl MachineState {
 
                 self.p += 1;
             },
-            &ControlInstruction::Execute(ref name, arity) => {
-                let compiled_tl_index = code_dir.get(&(name.clone(), arity))
-                                                .map(|index| *index);
-
-                match compiled_tl_index {
-                    Some(compiled_tl_index) => {
-                        self.num_of_args = arity;
-                        self.b0 = self.b;
-                        self.p  = CodePtr::DirEntry(compiled_tl_index);
+            &ControlInstruction::Execute(ref name, arity) =>
+                self.try_execute_predicate(code_dir, name.clone(), arity),            
+            &ControlInstruction::ExecuteN(arity) => {
+                let addr = self.deref(self.registers[arity + 1].clone());
+
+                match self.store(addr) {
+                    Addr::Str(a) => {
+                        let result = self.heap[a].clone();
+
+                        if let HeapCellValue::NamedStr(narity, name) = result {
+                            for i in 1 .. narity + 1 {
+                                self.registers[i + narity] = self.registers[i].clone();
+                                self.registers[i] = self.heap[a + i].as_addr(a + i);
+                            }
+
+                            self.try_execute_predicate(code_dir, name, arity + narity);
+                        } else {
+                            self.fail = true;
+                        }
                     },
-                    None => self.fail = true
-                };
+                    Addr::Con(Constant::Atom(name)) =>
+                        self.try_execute_predicate(code_dir, name, arity),
+                    _ => self.fail = true
+                };                
             },
             &ControlInstruction::Proceed =>
                 self.p = self.cp,
index 21c2c674551b7f77d5fee6f44447cd0f425eea27..c4588f35adb71521fee540f07a9709b0e76657c0 100644 (file)
@@ -129,13 +129,13 @@ impl<'a> Allocator<'a> for NaiveAllocator<'a>
         self.bindings.clear();
     }
     
-    fn advance(&mut self, term_loc: GenContext, term: &'a Term) {
+    fn advance(&mut self, term_loc: GenContext, term: QueryTermRef<'a>) {
         if let GenContext::Head = term_loc {
             self.arg_c  = 1;
-            self.temp_c = max(term.subterms() + 1, self.temp_c);
+            self.temp_c = max(term.arity() + 1, self.temp_c);
         } else {
             self.arg_c  = 1;
-            self.temp_c = term.subterms() + 1;
+            self.temp_c = term.arity() + 1;
         }
     }
 
index 12a59ce54db5b728175588215bdcac8c6a89caee..93a80a0484eca95c17b52666b70229a4904aa55c 100644 (file)
@@ -19,6 +19,23 @@ BoxedTerm : Box<Term> = {
     <t:Term> => Box::new(t)
 };
 
+Call : QueryTerm = {
+    "call" "(" <a:Atom> "(" <ts: (<BoxedTerm> ",")*> <t:BoxedTerm> ")"
+    <tss: ("," <BoxedTerm>)*> ")" => {
+        let mut ts  = ts;
+        let mut tss = tss;
+
+       ts.push(t);
+
+        ts.append(&mut tss);
+        QueryTerm::Term(Term::Clause(Cell::default(), a, ts))
+    },
+    "call" "(" <a:Atom> <ts: ("," <BoxedTerm>)*> ")" =>        
+        QueryTerm::Term(Term::Clause(Cell::default(), a, ts)),    
+    "call" "(" <v:Var> <ts: ("," <BoxedTerm>)*> ")" =>
+        QueryTerm::CallN(Cell::default(), v, ts)
+};
+
 Clause : Term = {
     <a:Atom> "(" <ts: (<BoxedTerm> ",")*> <t:BoxedTerm> ")" => {
        let mut ts = ts;
@@ -56,26 +73,29 @@ PredicateClause : PredicateClause = {
     <Term> "." => PredicateClause::Fact(<>)
 };
 
-Query : Vec<TermOrCut> = {
-    <tcs: (<TermOrCut> ",")*> <tc: TermOrCut> => {
+Query : Vec<QueryTerm> = {
+    <tcs: (<QueryTerm> ",")*> <tc: QueryTerm> => {
         let mut tcs = tcs;
         tcs.push(tc);
         tcs
-    }        
+    }
 };
 
 Rule : Rule = {
-    <c:Clause> ":-" <h:TermOrCut> <cs: ("," <TermOrCut>)*> =>
+    <c:Clause> ":-" <h:QueryTerm> <cs: ("," <QueryTerm>)*> =>
         Rule { head: (c, h), clauses: cs },
-    <a:Atom> ":-" <h:TermOrCut> <cs: ("," <TermOrCut>)*> =>
+    <a:Atom> ":-" <h:QueryTerm> <cs: ("," <QueryTerm>)*> =>
         Rule { head: (Term::Constant(Cell::default(), Constant::Atom(a)),
                      h),
                clauses: cs }
 };
 
-TermOrCut : TermOrCut = {
-    "!"    => TermOrCut::Cut,
-    <Term> => TermOrCut::Term(<>)
+QueryTerm : QueryTerm = {
+    <Call>   => <>,
+    "!"      => QueryTerm::Cut,
+    <Var>    => QueryTerm::CallN(Cell::default(), <>, Vec::new()),
+    <Clause> => QueryTerm::Term(<>),
+    <Atom>   => QueryTerm::Term(Term::Constant(Cell::default(), Constant::Atom(<>)))
 };
 
 Term : Term = {
@@ -83,9 +103,9 @@ Term : Term = {
     <Clause> => <>,
     <List>   => <>,
     <Var>    => Term::Var(Cell::default(), <>),
-    "_"      => Term::AnonVar    
+    "_"      => Term::AnonVar
 };
 
 Var : Var = {
     r"[A-Z][A-Za-z0-9_]*" => <>.trim().to_string()
-};
+};
\ No newline at end of file
index c3909323a8d7a05d63639d10cd0c9ce5edf93526..d25a01df10941ff21fb73bc36f23fa856730ed56 100644 (file)
@@ -21,295 +21,340 @@ mod __parse__TopLevel {
         Term_22_5b_5d_22(&'input str),
         Term_22_5d_22(&'input str),
         Term_22___22(&'input str),
+        Term_22call_22(&'input str),
         Term_22_7c_22(&'input str),
         Termr_23_22_5bA_2dZ_5d_5bA_2dZa_2dz0_2d9___5d_2a_22_23(&'input str),
         Termr_23_22_5ba_2dz_5d_5bA_2dZa_2dz0_2d9___5d_2a_22_23(&'input str),
         Termerror(__lalrpop_util::ErrorRecovery<usize, (usize, &'input str), ()>),
-        Nt_28_22_2c_22_20_3cTermOrCut_3e_29(TermOrCut),
-        Nt_28_22_2c_22_20_3cTermOrCut_3e_29_2a(::std::vec::Vec<TermOrCut>),
-        Nt_28_22_2c_22_20_3cTermOrCut_3e_29_2b(::std::vec::Vec<TermOrCut>),
+        Nt_28_22_2c_22_20_3cBoxedTerm_3e_29(Box<Term>),
+        Nt_28_22_2c_22_20_3cBoxedTerm_3e_29_2a(::std::vec::Vec<Box<Term>>),
+        Nt_28_22_2c_22_20_3cBoxedTerm_3e_29_2b(::std::vec::Vec<Box<Term>>),
+        Nt_28_22_2c_22_20_3cQueryTerm_3e_29(QueryTerm),
+        Nt_28_22_2c_22_20_3cQueryTerm_3e_29_2a(::std::vec::Vec<QueryTerm>),
+        Nt_28_22_2c_22_20_3cQueryTerm_3e_29_2b(::std::vec::Vec<QueryTerm>),
         Nt_28_3cBoxedTerm_3e_20_22_2c_22_29(Box<Term>),
         Nt_28_3cBoxedTerm_3e_20_22_2c_22_29_2a(::std::vec::Vec<Box<Term>>),
         Nt_28_3cBoxedTerm_3e_20_22_2c_22_29_2b(::std::vec::Vec<Box<Term>>),
         Nt_28_3cPredicateClause_3e_29(PredicateClause),
         Nt_28_3cPredicateClause_3e_29_2b(::std::vec::Vec<PredicateClause>),
-        Nt_28_3cTermOrCut_3e_20_22_2c_22_29(TermOrCut),
-        Nt_28_3cTermOrCut_3e_20_22_2c_22_29_2a(::std::vec::Vec<TermOrCut>),
-        Nt_28_3cTermOrCut_3e_20_22_2c_22_29_2b(::std::vec::Vec<TermOrCut>),
+        Nt_28_3cQueryTerm_3e_20_22_2c_22_29(QueryTerm),
+        Nt_28_3cQueryTerm_3e_20_22_2c_22_29_2a(::std::vec::Vec<QueryTerm>),
+        Nt_28_3cQueryTerm_3e_20_22_2c_22_29_2b(::std::vec::Vec<QueryTerm>),
         NtAtom(Atom),
         NtBoxedTerm(Box<Term>),
+        NtCall(QueryTerm),
         NtClause(Term),
         NtList(Term),
         NtListInternals(Term),
         NtPredicate(Vec<PredicateClause>),
         NtPredicateClause(PredicateClause),
-        NtQuery(Vec<TermOrCut>),
+        NtQuery(Vec<QueryTerm>),
+        NtQueryTerm(QueryTerm),
         NtRule(Rule),
         NtTerm(Term),
-        NtTermOrCut(TermOrCut),
         NtTopLevel(TopLevel),
         NtVar(Var),
         Nt____TopLevel(TopLevel),
     }
     const __ACTION: &'static [i32] = &[
         // State 0
-        0, 0, 0, 0, 0, 0, 12, 13, 14, 0, 15, 0, 16, 17, 0,
+        0, 0, 0, 0, 0, 0, 12, 13, 14, 0, 15, 0, 0, 16, 17, 0,
         // State 1
-        0, 0, 0, 0, 0, 0, 0, 13, 14, 0, 15, 0, 16, 17, 0,
+        0, 0, 0, 0, 0, 0, 0, 13, 14, 0, 15, 0, 0, 16, 17, 0,
         // State 2
-        0, 21, 0, 0, -37, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 21, 0, 0, -55, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 3
-        0, 0, 0, 0, -38, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, -56, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 4
-        0, 0, 0, 0, -39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, -57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 5
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 6
-        0, 0, 0, 0, 0, 0, 0, -12, -12, 0, -12, 0, -12, -12, 0,
+        0, 0, 0, 0, 0, 0, 0, -17, -17, 0, -17, 0, 0, -17, -17, 0,
         // State 7
-        0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 8
-        0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 9
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 10
-        0, 0, 0, 0, -40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, -58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 11
-        34, 0, 0, 0, 0, 0, 0, 35, 36, 0, 37, 0, 38, 39, 0,
+        33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 35, 36, 0,
         // State 12
-        0, 0, 0, 0, 0, 0, 0, 47, 48, 0, 49, 0, 50, 51, 0,
+        0, 0, 0, 0, 0, 0, 0, 44, 45, 0, 46, 0, 0, 47, 48, 0,
         // State 13
-        0, 0, 0, 0, -23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, -36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 14
-        0, 0, 0, 0, -41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, -59, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 15
-        0, 0, 0, 0, -48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, -64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 16
-        0, -19, 0, 0, -19, -19, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, -24, 0, 0, -24, -24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 17
-        0, 0, 0, 0, 0, 0, 0, -13, -13, 0, -13, 0, -13, -13, 0,
+        0, 0, 0, 0, 0, 0, 0, -18, -18, 0, -18, 0, 0, -18, -18, 0,
         // State 18
-        0, 0, 0, 0, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 19
-        0, 0, 0, 0, 53, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 20
-        0, 0, 0, 0, 0, 0, 0, 61, 62, 0, 63, 0, 64, 65, 0,
+        0, 0, 0, 0, 0, 0, 0, 58, 59, 0, 60, 0, 0, 61, 62, 0,
         // State 21
-        34, 0, 0, 0, 0, 0, 0, 35, 36, 0, 37, 0, 38, 39, 0,
+        33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 35, 36, 0,
         // State 22
-        34, 0, 0, 0, 0, 0, 0, 35, 36, 0, 37, 0, 38, 39, 0,
+        33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 35, 36, 0,
         // State 23
-        0, 0, 0, 0, 0, 0, 0, -29, -29, 0, -29, 0, -29, -29, 0,
+        0, 0, 0, 0, 0, 0, 0, -42, -42, 0, -42, 0, 0, -42, -42, 0,
         // State 24
-        0, 0, 0, 0, 0, 0, 0, -30, -30, 0, -30, 0, -30, -30, 0,
+        0, 0, 0, 0, 0, 0, 0, -43, -43, 0, -43, 0, 0, -43, -43, 0,
         // State 25
-        34, 0, 0, 0, 0, 0, 0, 35, 36, 0, 37, 0, 38, 39, 0,
+        33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 35, 36, 0,
         // State 26
-        0, 69, 0, -37, -37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 66, 0, -50, -50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 27
-        0, 0, 0, -38, -38, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, -46, -46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 28
-        0, 0, 0, -39, -39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, -49, -49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 29
-        0, 0, 0, 0, 70, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 30
-        0, 0, 0, -43, -43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 68, -44, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 31
-        0, 0, 0, 71, -31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, -48, -48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 32
-        0, 0, 0, -40, -40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, -47, -47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 33
-        0, 0, 0, -42, -42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 34
-        0, 0, 0, 0, 0, 0, 0, 47, 48, 0, 49, 0, 50, 51, 0,
+        0, 0, 0, -64, -64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 35
-        0, 0, 0, -23, -23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, -24, 0, -24, -24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 36
-        0, 0, 0, -41, -41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 70, 0, -55, 0, 0, 0, 0, 0, -55, 0, 0, -55, 0, 0, 0,
         // State 37
-        0, 0, 0, -48, -48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 71, 0, 0, 0, 0, 0, -38, 0, 0, 72, 0, 0, 0,
         // State 38
-        0, -19, 0, -19, -19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, -56, 0, 0, 0, 0, 0, -56, 0, 0, -56, 0, 0, 0,
         // State 39
-        0, 73, 0, -37, 0, 0, 0, 0, 0, -37, 0, -37, 0, 0, 0,
+        0, 0, 0, -57, 0, 0, 0, 0, 0, -57, 0, 0, -57, 0, 0, 0,
         // State 40
-        0, 0, 0, 74, 0, 0, 0, 0, 0, -25, 0, 75, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 73, 0, 0, 0, 0, 0, 0,
         // State 41
-        0, 0, 0, -38, 0, 0, 0, 0, 0, -38, 0, -38, 0, 0, 0,
+        0, 0, 0, -25, 0, 0, 0, 0, 0, -25, 0, 0, -25, 0, 0, 0,
         // State 42
-        0, 0, 0, -39, 0, 0, 0, 0, 0, -39, 0, -39, 0, 0, 0,
+        0, 0, 0, -58, 0, 0, 0, 0, 0, -58, 0, 0, -58, 0, 0, 0,
         // State 43
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 44, 45, 0, 46, 0, 0, 47, 48, 0,
         // State 44
-        0, 0, 0, -20, 0, 0, 0, 0, 0, -20, 0, -20, 0, 0, 0,
+        0, 0, 0, -36, 0, 0, 0, 0, 0, -36, 0, 0, -36, 0, 0, 0,
         // State 45
-        0, 0, 0, -40, 0, 0, 0, 0, 0, -40, 0, -40, 0, 0, 0,
+        0, 0, 0, -59, 0, 0, 0, 0, 0, -59, 0, 0, -59, 0, 0, 0,
         // State 46
-        0, 0, 0, 0, 0, 0, 0, 47, 48, 0, 49, 0, 50, 51, 0,
+        0, 0, 0, -64, 0, 0, 0, 0, 0, -64, 0, 0, -64, 0, 0, 0,
         // State 47
-        0, 0, 0, -23, 0, 0, 0, 0, 0, -23, 0, -23, 0, 0, 0,
+        0, -24, 0, -24, 0, 0, 0, 0, 0, -24, 0, 0, -24, 0, 0, 0,
         // State 48
-        0, 0, 0, -41, 0, 0, 0, 0, 0, -41, 0, -41, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, -42, -42, 0, -42, 0, 0, -42, -42, 0,
         // State 49
-        0, 0, 0, -48, 0, 0, 0, 0, 0, -48, 0, -48, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, -43, -43, 0, -43, 0, 0, -43, -43, 0,
         // State 50
-        0, -19, 0, -19, 0, 0, 0, 0, 0, -19, 0, -19, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 58, 59, 0, 60, 0, 0, 61, 62, 0,
         // State 51
-        0, 0, 0, 0, 0, 0, 0, -29, -29, 0, -29, 0, -29, -29, 0,
+        0, 76, -55, -55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 52
-        0, 0, 0, 0, 0, 0, 0, -30, -30, 0, -30, 0, -30, -30, 0,
+        0, 0, 77, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 53
-        0, 0, 0, 0, 0, 0, 0, 61, 62, 0, 63, 0, 64, 65, 0,
+        0, 0, -56, -56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 54
-        0, 79, -37, -37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, -57, -57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 55
-        0, 0, 80, 81, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, -25, -25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 56
-        0, 0, -38, -38, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, -58, -58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 57
-        0, 0, -39, -39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 44, 45, 0, 46, 0, 0, 47, 48, 0,
         // State 58
-        0, 0, -20, -20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, -36, -36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 59
-        0, 0, -40, -40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, -59, -59, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 60
-        0, 0, 0, 0, 0, 0, 0, 47, 48, 0, 49, 0, 50, 51, 0,
+        0, 0, -64, -64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 61
-        0, 0, -23, -23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, -24, -24, -24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 62
-        0, 0, -41, -41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 81, -53, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 63
-        0, 0, -48, -48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 81, -51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 64
-        0, -19, -19, -19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 83, -45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 65
-        0, 0, 0, 84, -35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 58, 59, 0, 60, 0, 0, 61, 62, 0,
         // State 66
-        0, 0, 0, 84, -33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 67
-        0, 0, 0, 86, -32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        -22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -22, 0, -22, -22, 0,
         // State 68
-        0, 0, 0, 0, 0, 0, 0, 61, 62, 0, 63, 0, 64, 65, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 61, 62, 0,
         // State 69
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 58, 59, 0, 60, 0, 0, 61, 62, 0,
         // State 70
-        -17, 0, 0, 0, 0, 0, 0, -17, -17, 0, -17, 0, -17, -17, 0,
+        0, 0, 0, 0, 0, 0, 0, 44, 45, 0, 46, 0, 0, 47, 48, 0,
         // State 71
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 89, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 97, 98, 0, 99, 0, 0, 100, 101, 0,
         // State 72
-        0, 0, 0, 0, 0, 0, 0, 61, 62, 0, 63, 0, 64, 65, 0,
+        0, 0, 0, 0, -37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 73
-        0, 0, 0, 0, 0, 0, 0, 47, 48, 0, 49, 0, 50, 51, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 102, 0, 0, 0, 0, 0, 0,
         // State 74
-        0, 0, 0, 0, 0, 0, 0, 99, 100, 0, 101, 0, 102, 103, 0,
+        0, 0, 103, 104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 75
-        0, 0, 0, 0, -24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 58, 59, 0, 60, 0, 0, 61, 62, 0,
         // State 76
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 104, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, -34, -34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 77
-        0, 0, 105, 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, -14, -14, 0, -14, 0, 0, -14, -14, 0,
         // State 78
-        0, 0, 0, 0, 0, 0, 0, 61, 62, 0, 63, 0, 64, 65, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 107, 0, 0, 0, 0, 0, 0,
         // State 79
-        0, 0, 0, 0, -21, -21, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 108, -54, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 80
-        0, 0, 0, 0, 0, 0, 0, -9, -9, 0, -9, 0, -9, -9, 0,
+        33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 35, 36, 0,
         // State 81
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 109, 0, 0, 0, 0, 0,
+        0, 0, 0, 108, -52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 82
-        0, 0, 0, 110, -36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        -23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -23, 0, -23, -23, 0,
         // State 83
-        34, 0, 0, 0, 0, 0, 0, 35, 36, 0, 37, 0, 38, 39, 0,
+        0, 0, 0, 0, 0, 0, 0, 58, 59, 0, 60, 0, 0, 61, 62, 0,
         // State 84
-        0, 0, 0, 110, -34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 111, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 85
-        -18, 0, 0, 0, 0, 0, 0, -18, -18, 0, -18, 0, -18, -18, 0,
+        0, 113, 114, 115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 86
-        0, 0, 0, 0, 0, 0, 0, 61, 62, 0, 63, 0, 64, 65, 0,
+        0, 0, 117, 115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 87
-        0, 0, 113, 81, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 58, 59, 0, 60, 0, 0, 61, 62, 0,
         // State 88
-        0, 0, 0, -24, -24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 119, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 89
-        0, 0, 0, 0, 0, 0, 0, 61, 62, 0, 63, 0, 64, 65, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, -39, 0, 0, 0, 0, 0, 0,
         // State 90
-        0, 0, 115, 81, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 120, 0, 0, 0, 0, 0, 0, 0, -55, 0, 0, 0, 0, 0, 0,
         // State 91
-        0, 0, 0, 0, 0, 0, 0, 0, 0, -26, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, -40, 0, 0, 0, 0, 0, 0,
         // State 92
-        0, 116, 0, 0, 0, 0, 0, 0, 0, -37, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, -56, 0, 0, 0, 0, 0, 0,
         // State 93
-        0, 0, 0, 0, 0, 0, 0, 0, 0, -27, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, -57, 0, 0, 0, 0, 0, 0,
         // State 94
-        0, 0, 0, 0, 0, 0, 0, 0, 0, -38, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, -25, 0, 0, 0, 0, 0, 0,
         // State 95
-        0, 0, 0, 0, 0, 0, 0, 0, 0, -39, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, -58, 0, 0, 0, 0, 0, 0,
         // State 96
-        0, 0, 0, 0, 0, 0, 0, 0, 0, -20, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 44, 45, 0, 46, 0, 0, 47, 48, 0,
         // State 97
-        0, 0, 0, 0, 0, 0, 0, 0, 0, -40, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, -36, 0, 0, 0, 0, 0, 0,
         // State 98
-        0, 0, 0, 0, 0, 0, 0, 47, 48, 0, 49, 0, 50, 51, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, -59, 0, 0, 0, 0, 0, 0,
         // State 99
-        0, 0, 0, 0, 0, 0, 0, 0, 0, -23, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, -64, 0, 0, 0, 0, 0, 0,
         // State 100
-        0, 0, 0, 0, 0, 0, 0, 0, 0, -41, 0, 0, 0, 0, 0,
+        0, -24, 0, 0, 0, 0, 0, 0, 0, -24, 0, 0, 0, 0, 0, 0,
         // State 101
-        0, 0, 0, 0, 0, 0, 0, 0, 0, -48, 0, 0, 0, 0, 0,
+        0, 0, 0, -37, 0, 0, 0, 0, 0, -37, 0, 0, -37, 0, 0, 0,
         // State 102
-        0, -19, 0, 0, 0, 0, 0, 0, 0, -19, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, -35, -35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 103
-        0, 0, 0, -24, 0, 0, 0, 0, 0, -24, 0, -24, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, -15, -15, 0, -15, 0, 0, -15, -15, 0,
         // State 104
-        0, 0, 0, 0, -22, -22, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 58, 59, 0, 60, 0, 0, 61, 62, 0,
         // State 105
-        0, 0, 0, 0, 0, 0, 0, -10, -10, 0, -10, 0, -10, -10, 0,
+        0, 0, 123, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 106
-        0, 0, 0, 0, 0, 0, 0, 61, 62, 0, 63, 0, 64, 65, 0,
+        0, 0, -37, -37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 107
-        0, 0, 119, 81, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 35, 36, 0,
         // State 108
-        0, 0, -24, -24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, -9, -9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 109
-        34, 0, 0, 0, 0, 0, 0, 35, 36, 0, 37, 0, 38, 39, 0,
+        0, 0, 125, 104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 110
-        0, 0, 0, -4, -4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, -34, -34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 111
-        0, 0, 121, 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 126, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 112
-        0, 0, 0, -21, -21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 58, 59, 0, 60, 0, 0, 61, 62, 0,
         // State 113
-        0, 0, 122, 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, -30, -30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 114
-        0, 0, 0, -21, 0, 0, 0, 0, 0, -21, 0, -21, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 58, 59, 0, 60, 0, 0, 61, 62, 0,
         // State 115
-        0, 0, 0, 0, 0, 0, 0, 61, 62, 0, 63, 0, 64, 65, 0,
+        0, 0, 131, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 116
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 125, 0, 0, 0, 0, 0,
+        0, 0, 0, -32, -32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 117
-        0, 0, 126, 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 132, 104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 118
-        0, 0, -21, -21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, -34, 0, 0, 0, 0, 0, -34, 0, 0, -34, 0, 0, 0,
         // State 119
-        0, 0, 0, -5, -5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 58, 59, 0, 60, 0, 0, 61, 62, 0,
         // State 120
-        0, 0, 0, -22, -22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 135, 0, 0, 0, 0, 0, 0,
         // State 121
-        0, 0, 0, -22, 0, 0, 0, 0, 0, -22, 0, -22, 0, 0, 0,
+        0, 0, 136, 104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 122
-        0, 0, 0, 0, 0, 0, 0, 61, 62, 0, 63, 0, 64, 65, 0,
+        0, 0, -34, -34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 123
-        0, 0, 128, 81, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, -10, -10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 124
-        0, 0, 0, 0, 0, 0, 0, 0, 0, -24, 0, 0, 0, 0, 0,
+        0, 0, 0, -35, -35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 125
-        0, 0, -22, -22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, -31, -31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 126
-        0, 0, 129, 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 58, 59, 0, 60, 0, 0, 61, 62, 0,
         // State 127
-        0, 0, 0, 0, 0, 0, 0, 0, 0, -21, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 58, 59, 0, 60, 0, 0, 61, 62, 0,
         // State 128
-        0, 0, 0, 0, 0, 0, 0, 0, 0, -22, 0, 0, 0, 0, 0,
+        0, 0, 139, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        // State 129
+        0, 0, -4, -4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        // State 130
+        0, 0, 0, -33, -33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        // State 131
+        0, 0, 0, -35, 0, 0, 0, 0, 0, -35, 0, 0, -35, 0, 0, 0,
+        // State 132
+        0, 0, 0, 0, 0, 0, 0, 58, 59, 0, 60, 0, 0, 61, 62, 0,
+        // State 133
+        0, 0, 141, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        // State 134
+        0, 0, 0, 0, 0, 0, 0, 0, 0, -37, 0, 0, 0, 0, 0, 0,
+        // State 135
+        0, 0, -35, -35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        // State 136
+        0, 0, -5, -5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        // State 137
+        0, 0, 142, 104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        // State 138
+        0, 0, 144, 115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        // State 139
+        0, 0, 145, 104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        // State 140
+        0, 0, 0, 0, 0, 0, 0, 0, 0, -34, 0, 0, 0, 0, 0, 0,
+        // State 141
+        0, 0, 147, 115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        // State 142
+        0, 0, 148, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        // State 143
+        0, 0, 0, -26, -26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        // State 144
+        0, 0, 0, 0, 0, 0, 0, 0, 0, -35, 0, 0, 0, 0, 0, 0,
+        // State 145
+        0, 0, 149, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        // State 146
+        0, 0, 0, -27, -27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        // State 147
+        0, 0, 0, -28, -28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        // State 148
+        0, 0, 0, -29, -29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
     ];
     const __EOF_ACTION: &'static [i32] = &[
         0,
@@ -317,11 +362,11 @@ mod __parse__TopLevel {
         0,
         0,
         0,
-        -45,
+        -61,
         0,
         0,
         0,
-        -49,
+        -65,
         0,
         0,
         0,
@@ -329,14 +374,14 @@ mod __parse__TopLevel {
         0,
         0,
         0,
-        -28,
+        -41,
         0,
         0,
         0,
         0,
         0,
-        -46,
-        -47,
+        -62,
+        -63,
         0,
         0,
         0,
@@ -360,11 +405,32 @@ mod __parse__TopLevel {
         0,
         0,
         0,
+        -42,
+        -43,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        -60,
+        0,
+        0,
+        0,
+        0,
         0,
         0,
         0,
-        -29,
-        -30,
         0,
         0,
         0,
@@ -381,7 +447,6 @@ mod __parse__TopLevel {
         0,
         0,
         0,
-        -44,
         0,
         0,
         0,
@@ -444,263 +509,303 @@ mod __parse__TopLevel {
     ];
     const __GOTO: &'static [i32] = &[
         // State 0
-        0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 3, 0, 4, 5, 0, 6, 7, 0, 8, 9, 0, 10, 11, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 4, 5, 0, 6, 7, 0, 0, 8, 9, 10, 11, 0,
         // State 1
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 4, 5, 0, 0, 18, 0, 19, 20, 0, 0, 11, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 4, 5, 0, 0, 18, 0, 0, 19, 20, 0, 11, 0,
         // State 2
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 3
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 4
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 5
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 6
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 7
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 8
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 9
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 10
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 11
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 27, 0, 28, 29, 0, 0, 0, 30, 0, 31, 32, 0, 33, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 27, 0, 28, 29, 0, 0, 0, 0, 30, 31, 0, 0, 0, 32, 0,
         // State 12
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 41, 42, 43, 44, 0, 0, 0, 0, 45, 0, 0, 46, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 38, 0, 39, 40, 41, 0, 0, 0, 0, 0, 42, 0, 43, 0,
         // State 13
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 14
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 15
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 16
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 17
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 18
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 19
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 20
-        0, 0, 0, 0, 0, 54, 0, 0, 0, 0, 0, 55, 56, 57, 58, 0, 0, 0, 0, 0, 59, 0, 0, 60, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 51, 0, 0, 0, 0, 0, 52, 53, 0, 54, 55, 0, 0, 0, 0, 0, 0, 56, 0, 57, 0,
         // State 21
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 0, 28, 29, 0, 0, 0, 0, 0, 31, 66, 0, 33, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 0, 28, 29, 0, 0, 0, 0, 0, 63, 0, 0, 0, 32, 0,
         // State 22
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 0, 28, 29, 0, 0, 0, 0, 0, 31, 67, 0, 33, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 0, 28, 29, 0, 0, 0, 0, 0, 64, 0, 0, 0, 32, 0,
         // State 23
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 24
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 25
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 0, 28, 29, 0, 0, 0, 0, 0, 31, 68, 0, 33, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 0, 28, 29, 0, 0, 0, 0, 0, 65, 0, 0, 0, 32, 0,
         // State 26
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 27
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 28
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 29
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 30
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 31
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 32
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 33
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 34
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 41, 42, 43, 72, 0, 0, 0, 0, 45, 0, 0, 46, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 35
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 36
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 37
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 38
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 39
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 40
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 41
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 42
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 43
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 38, 0, 39, 40, 74, 0, 0, 0, 0, 0, 42, 0, 43, 0,
         // State 44
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 45
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 46
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 41, 42, 43, 77, 0, 0, 0, 0, 45, 0, 0, 46, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 47
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 48
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 49
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 50
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 52, 75, 0, 54, 55, 0, 0, 0, 0, 0, 0, 56, 0, 57, 0,
         // State 51
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 52
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 53
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 55, 78, 57, 58, 0, 0, 0, 0, 0, 59, 0, 0, 60, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 54
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 55
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 56
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 57
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 38, 0, 39, 40, 79, 0, 0, 0, 0, 0, 42, 0, 43, 0,
         // State 58
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 59
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 60
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 41, 42, 43, 82, 0, 0, 0, 0, 45, 0, 0, 46, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 61
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 62
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 63
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 64
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 65
-        0, 0, 83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 84, 0, 0, 0, 0, 0, 52, 85, 0, 54, 55, 0, 0, 0, 0, 0, 0, 56, 0, 57, 0,
         // State 66
-        0, 0, 85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 67
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 68
-        0, 0, 0, 0, 0, 87, 0, 0, 0, 0, 0, 55, 88, 57, 58, 0, 0, 0, 0, 0, 59, 0, 0, 60, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87, 0,
         // State 69
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 88, 0, 0, 0, 0, 0, 52, 89, 0, 54, 55, 0, 0, 0, 0, 0, 0, 56, 0, 57, 0,
         // State 70
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 38, 0, 39, 40, 90, 0, 0, 0, 0, 0, 42, 0, 43, 0,
         // State 71
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 91, 92, 0, 93, 94, 0, 0, 0, 0, 0, 0, 95, 0, 96, 0,
         // State 72
-        0, 0, 0, 0, 0, 90, 0, 0, 0, 0, 0, 55, 91, 57, 58, 0, 0, 0, 0, 0, 59, 0, 0, 60, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 73
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 41, 42, 43, 92, 0, 0, 0, 0, 45, 0, 0, 46, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 74
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 93, 94, 95, 96, 0, 0, 0, 0, 0, 97, 0, 0, 98, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 75
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 105, 0, 0, 0, 0, 0, 52, 106, 0, 54, 55, 0, 0, 0, 0, 0, 0, 56, 0, 57, 0,
         // State 76
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 77
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 78
-        0, 0, 0, 0, 0, 107, 0, 0, 0, 0, 0, 55, 108, 57, 58, 0, 0, 0, 0, 0, 59, 0, 0, 60, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 79
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 80
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 0, 28, 29, 0, 0, 0, 0, 0, 109, 0, 0, 0, 32, 0,
         // State 81
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 82
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 83
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 0, 28, 29, 0, 0, 0, 0, 0, 31, 111, 0, 33, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 52, 110, 0, 54, 55, 0, 0, 0, 0, 0, 0, 56, 0, 57, 0,
         // State 84
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 85
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 86
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 55, 112, 57, 58, 0, 0, 0, 0, 0, 59, 0, 0, 60, 0,
+        0, 0, 116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 87
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 52, 118, 0, 54, 55, 0, 0, 0, 0, 0, 0, 56, 0, 57, 0,
         // State 88
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 89
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 55, 114, 57, 58, 0, 0, 0, 0, 0, 59, 0, 0, 60, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 90
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 91
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 92
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 93
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 94
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 95
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 96
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 38, 0, 39, 40, 121, 0, 0, 0, 0, 0, 42, 0, 43, 0,
         // State 97
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 98
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 41, 42, 43, 117, 0, 0, 0, 0, 45, 0, 0, 46, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 99
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 100
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 101
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 102
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 103
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 104
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 52, 122, 0, 54, 55, 0, 0, 0, 0, 0, 0, 56, 0, 57, 0,
         // State 105
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 106
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 55, 118, 57, 58, 0, 0, 0, 0, 0, 59, 0, 0, 60, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 107
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 0, 28, 29, 0, 0, 0, 0, 0, 124, 0, 0, 0, 32, 0,
         // State 108
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 109
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 0, 28, 29, 0, 0, 0, 0, 0, 31, 120, 0, 33, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 110
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 111
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 112
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 128, 0, 0, 0, 0, 0, 52, 129, 0, 54, 55, 0, 0, 0, 0, 0, 0, 56, 0, 57, 0,
         // State 113
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 114
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 52, 130, 0, 54, 55, 0, 0, 0, 0, 0, 0, 56, 0, 57, 0,
         // State 115
-        0, 0, 0, 0, 0, 123, 0, 0, 0, 0, 0, 55, 124, 57, 58, 0, 0, 0, 0, 0, 59, 0, 0, 60, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 116
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 117
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 118
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 119
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 133, 0, 0, 0, 0, 0, 52, 134, 0, 54, 55, 0, 0, 0, 0, 0, 0, 56, 0, 57, 0,
         // State 120
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 121
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 122
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 55, 127, 57, 58, 0, 0, 0, 0, 0, 59, 0, 0, 60, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 123
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 124
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 125
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         // State 126
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 52, 137, 0, 54, 55, 0, 0, 0, 0, 0, 0, 56, 0, 57, 0,
         // State 127
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 52, 138, 0, 54, 55, 0, 0, 0, 0, 0, 0, 56, 0, 57, 0,
         // State 128
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        // State 129
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        // State 130
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        // State 131
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        // State 132
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 52, 140, 0, 54, 55, 0, 0, 0, 0, 0, 0, 56, 0, 57, 0,
+        // State 133
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        // State 134
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        // State 135
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        // State 136
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        // State 137
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        // State 138
+        0, 0, 143, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        // State 139
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        // State 140
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        // State 141
+        0, 0, 146, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        // State 142
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        // State 143
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        // State 144
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        // State 145
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        // State 146
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        // State 147
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        // State 148
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
     ];
     fn __expected_tokens(__state: usize) -> Vec<::std::string::String> {
         const __TERMINAL: &'static [&'static str] = &[
@@ -715,11 +820,12 @@ mod __parse__TopLevel {
             r###""[]""###,
             r###""]""###,
             r###""_""###,
+            r###""call""###,
             r###""|""###,
             r###"r#"[A-Z][A-Za-z0-9_]*"#"###,
             r###"r#"[a-z][A-Za-z0-9_]*"#"###,
         ];
-        __ACTION[(__state * 15)..].iter().zip(__TERMINAL).filter_map(|(&state, terminal)| {
+        __ACTION[(__state * 16)..].iter().zip(__TERMINAL).filter_map(|(&state, terminal)| {
             if state == 0 {
                 None
             } else {
@@ -761,6 +867,7 @@ mod __parse__TopLevel {
                 (11, _) if true => 11,
                 (12, _) if true => 12,
                 (13, _) if true => 13,
+                (14, _) if true => 14,
                 _ => {
                     let __state = *__states.last().unwrap() as usize;
                     let __error = __lalrpop_util::ParseError::UnrecognizedToken {
@@ -772,7 +879,7 @@ mod __parse__TopLevel {
             };
             '__inner: loop {
                 let __state = *__states.last().unwrap() as usize;
-                let __action = __ACTION[__state * 15 + __integer];
+                let __action = __ACTION[__state * 16 + __integer];
                 if __action > 0 {
                     let __symbol = match __integer {
                         0 => match __lookahead.1 {
@@ -820,15 +927,19 @@ mod __parse__TopLevel {
                             _ => unreachable!(),
                         },
                         11 => match __lookahead.1 {
-                            (11, __tok0) => __Symbol::Term_22_7c_22(__tok0),
+                            (11, __tok0) => __Symbol::Term_22call_22(__tok0),
                             _ => unreachable!(),
                         },
                         12 => match __lookahead.1 {
-                            (12, __tok0) => __Symbol::Termr_23_22_5bA_2dZ_5d_5bA_2dZa_2dz0_2d9___5d_2a_22_23(__tok0),
+                            (12, __tok0) => __Symbol::Term_22_7c_22(__tok0),
                             _ => unreachable!(),
                         },
                         13 => match __lookahead.1 {
-                            (13, __tok0) => __Symbol::Termr_23_22_5ba_2dz_5d_5bA_2dZa_2dz0_2d9___5d_2a_22_23(__tok0),
+                            (13, __tok0) => __Symbol::Termr_23_22_5bA_2dZ_5d_5bA_2dZa_2dz0_2d9___5d_2a_22_23(__tok0),
+                            _ => unreachable!(),
+                        },
+                        14 => match __lookahead.1 {
+                            (14, __tok0) => __Symbol::Termr_23_22_5ba_2dz_5d_5bA_2dZa_2dz0_2d9___5d_2a_22_23(__tok0),
                             _ => unreachable!(),
                         },
                         _ => unreachable!(),
@@ -880,214 +991,272 @@ mod __parse__TopLevel {
     {
         let __nonterminal = match -__action {
             1 => {
-                // ("," <TermOrCut>) = ",", TermOrCut => ActionFn(29);
-                let __sym1 = __pop_NtTermOrCut(__symbols);
+                // ("," <BoxedTerm>) = ",", BoxedTerm => ActionFn(44);
+                let __sym1 = __pop_NtBoxedTerm(__symbols);
                 let __sym0 = __pop_Term_22_2c_22(__symbols);
                 let __start = __sym0.0.clone();
                 let __end = __sym1.2.clone();
-                let __nt = super::__action29::<>(input, __sym0, __sym1);
+                let __nt = super::__action44::<>(input, __sym0, __sym1);
                 let __states_len = __states.len();
                 __states.truncate(__states_len - 2);
-                __symbols.push((__start, __Symbol::Nt_28_22_2c_22_20_3cTermOrCut_3e_29(__nt), __end));
+                __symbols.push((__start, __Symbol::Nt_28_22_2c_22_20_3cBoxedTerm_3e_29(__nt), __end));
                 0
             }
             2 => {
-                // ("," <TermOrCut>)* =  => ActionFn(27);
+                // ("," <BoxedTerm>)* =  => ActionFn(42);
                 let __start = __symbols.last().map(|s| s.2.clone()).unwrap_or_default();
                 let __end = __lookahead_start.cloned().unwrap_or_else(|| __start.clone());
-                let __nt = super::__action27::<>(input, &__start, &__end);
+                let __nt = super::__action42::<>(input, &__start, &__end);
                 let __states_len = __states.len();
                 __states.truncate(__states_len - 0);
-                __symbols.push((__start, __Symbol::Nt_28_22_2c_22_20_3cTermOrCut_3e_29_2a(__nt), __end));
+                __symbols.push((__start, __Symbol::Nt_28_22_2c_22_20_3cBoxedTerm_3e_29_2a(__nt), __end));
                 1
             }
             3 => {
-                // ("," <TermOrCut>)* = ("," <TermOrCut>)+ => ActionFn(28);
-                let __sym0 = __pop_Nt_28_22_2c_22_20_3cTermOrCut_3e_29_2b(__symbols);
+                // ("," <BoxedTerm>)* = ("," <BoxedTerm>)+ => ActionFn(43);
+                let __sym0 = __pop_Nt_28_22_2c_22_20_3cBoxedTerm_3e_29_2b(__symbols);
                 let __start = __sym0.0.clone();
                 let __end = __sym0.2.clone();
-                let __nt = super::__action28::<>(input, __sym0);
+                let __nt = super::__action43::<>(input, __sym0);
                 let __states_len = __states.len();
                 __states.truncate(__states_len - 1);
-                __symbols.push((__start, __Symbol::Nt_28_22_2c_22_20_3cTermOrCut_3e_29_2a(__nt), __end));
+                __symbols.push((__start, __Symbol::Nt_28_22_2c_22_20_3cBoxedTerm_3e_29_2a(__nt), __end));
                 1
             }
             4 => {
-                // ("," <TermOrCut>)+ = ",", TermOrCut => ActionFn(45);
-                let __sym1 = __pop_NtTermOrCut(__symbols);
+                // ("," <BoxedTerm>)+ = ",", BoxedTerm => ActionFn(56);
+                let __sym1 = __pop_NtBoxedTerm(__symbols);
                 let __sym0 = __pop_Term_22_2c_22(__symbols);
                 let __start = __sym0.0.clone();
                 let __end = __sym1.2.clone();
-                let __nt = super::__action45::<>(input, __sym0, __sym1);
+                let __nt = super::__action56::<>(input, __sym0, __sym1);
                 let __states_len = __states.len();
                 __states.truncate(__states_len - 2);
-                __symbols.push((__start, __Symbol::Nt_28_22_2c_22_20_3cTermOrCut_3e_29_2b(__nt), __end));
+                __symbols.push((__start, __Symbol::Nt_28_22_2c_22_20_3cBoxedTerm_3e_29_2b(__nt), __end));
                 2
             }
             5 => {
-                // ("," <TermOrCut>)+ = ("," <TermOrCut>)+, ",", TermOrCut => ActionFn(46);
-                let __sym2 = __pop_NtTermOrCut(__symbols);
+                // ("," <BoxedTerm>)+ = ("," <BoxedTerm>)+, ",", BoxedTerm => ActionFn(57);
+                let __sym2 = __pop_NtBoxedTerm(__symbols);
                 let __sym1 = __pop_Term_22_2c_22(__symbols);
-                let __sym0 = __pop_Nt_28_22_2c_22_20_3cTermOrCut_3e_29_2b(__symbols);
+                let __sym0 = __pop_Nt_28_22_2c_22_20_3cBoxedTerm_3e_29_2b(__symbols);
                 let __start = __sym0.0.clone();
                 let __end = __sym2.2.clone();
-                let __nt = super::__action46::<>(input, __sym0, __sym1, __sym2);
+                let __nt = super::__action57::<>(input, __sym0, __sym1, __sym2);
                 let __states_len = __states.len();
                 __states.truncate(__states_len - 3);
-                __symbols.push((__start, __Symbol::Nt_28_22_2c_22_20_3cTermOrCut_3e_29_2b(__nt), __end));
+                __symbols.push((__start, __Symbol::Nt_28_22_2c_22_20_3cBoxedTerm_3e_29_2b(__nt), __end));
                 2
             }
             6 => {
-                // (<BoxedTerm> ",") = BoxedTerm, "," => ActionFn(38);
-                let __sym1 = __pop_Term_22_2c_22(__symbols);
-                let __sym0 = __pop_NtBoxedTerm(__symbols);
+                // ("," <QueryTerm>) = ",", QueryTerm => ActionFn(35);
+                let __sym1 = __pop_NtQueryTerm(__symbols);
+                let __sym0 = __pop_Term_22_2c_22(__symbols);
                 let __start = __sym0.0.clone();
                 let __end = __sym1.2.clone();
-                let __nt = super::__action38::<>(input, __sym0, __sym1);
+                let __nt = super::__action35::<>(input, __sym0, __sym1);
                 let __states_len = __states.len();
                 __states.truncate(__states_len - 2);
-                __symbols.push((__start, __Symbol::Nt_28_3cBoxedTerm_3e_20_22_2c_22_29(__nt), __end));
+                __symbols.push((__start, __Symbol::Nt_28_22_2c_22_20_3cQueryTerm_3e_29(__nt), __end));
                 3
             }
             7 => {
-                // (<BoxedTerm> ",")* =  => ActionFn(36);
+                // ("," <QueryTerm>)* =  => ActionFn(33);
                 let __start = __symbols.last().map(|s| s.2.clone()).unwrap_or_default();
                 let __end = __lookahead_start.cloned().unwrap_or_else(|| __start.clone());
-                let __nt = super::__action36::<>(input, &__start, &__end);
+                let __nt = super::__action33::<>(input, &__start, &__end);
                 let __states_len = __states.len();
                 __states.truncate(__states_len - 0);
-                __symbols.push((__start, __Symbol::Nt_28_3cBoxedTerm_3e_20_22_2c_22_29_2a(__nt), __end));
+                __symbols.push((__start, __Symbol::Nt_28_22_2c_22_20_3cQueryTerm_3e_29_2a(__nt), __end));
                 4
             }
             8 => {
-                // (<BoxedTerm> ",")* = (<BoxedTerm> ",")+ => ActionFn(37);
-                let __sym0 = __pop_Nt_28_3cBoxedTerm_3e_20_22_2c_22_29_2b(__symbols);
+                // ("," <QueryTerm>)* = ("," <QueryTerm>)+ => ActionFn(34);
+                let __sym0 = __pop_Nt_28_22_2c_22_20_3cQueryTerm_3e_29_2b(__symbols);
                 let __start = __sym0.0.clone();
                 let __end = __sym0.2.clone();
-                let __nt = super::__action37::<>(input, __sym0);
+                let __nt = super::__action34::<>(input, __sym0);
                 let __states_len = __states.len();
                 __states.truncate(__states_len - 1);
-                __symbols.push((__start, __Symbol::Nt_28_3cBoxedTerm_3e_20_22_2c_22_29_2a(__nt), __end));
+                __symbols.push((__start, __Symbol::Nt_28_22_2c_22_20_3cQueryTerm_3e_29_2a(__nt), __end));
                 4
             }
             9 => {
-                // (<BoxedTerm> ",")+ = BoxedTerm, "," => ActionFn(51);
+                // ("," <QueryTerm>)+ = ",", QueryTerm => ActionFn(64);
+                let __sym1 = __pop_NtQueryTerm(__symbols);
+                let __sym0 = __pop_Term_22_2c_22(__symbols);
+                let __start = __sym0.0.clone();
+                let __end = __sym1.2.clone();
+                let __nt = super::__action64::<>(input, __sym0, __sym1);
+                let __states_len = __states.len();
+                __states.truncate(__states_len - 2);
+                __symbols.push((__start, __Symbol::Nt_28_22_2c_22_20_3cQueryTerm_3e_29_2b(__nt), __end));
+                5
+            }
+            10 => {
+                // ("," <QueryTerm>)+ = ("," <QueryTerm>)+, ",", QueryTerm => ActionFn(65);
+                let __sym2 = __pop_NtQueryTerm(__symbols);
+                let __sym1 = __pop_Term_22_2c_22(__symbols);
+                let __sym0 = __pop_Nt_28_22_2c_22_20_3cQueryTerm_3e_29_2b(__symbols);
+                let __start = __sym0.0.clone();
+                let __end = __sym2.2.clone();
+                let __nt = super::__action65::<>(input, __sym0, __sym1, __sym2);
+                let __states_len = __states.len();
+                __states.truncate(__states_len - 3);
+                __symbols.push((__start, __Symbol::Nt_28_22_2c_22_20_3cQueryTerm_3e_29_2b(__nt), __end));
+                5
+            }
+            11 => {
+                // (<BoxedTerm> ",") = BoxedTerm, "," => ActionFn(47);
+                let __sym1 = __pop_Term_22_2c_22(__symbols);
+                let __sym0 = __pop_NtBoxedTerm(__symbols);
+                let __start = __sym0.0.clone();
+                let __end = __sym1.2.clone();
+                let __nt = super::__action47::<>(input, __sym0, __sym1);
+                let __states_len = __states.len();
+                __states.truncate(__states_len - 2);
+                __symbols.push((__start, __Symbol::Nt_28_3cBoxedTerm_3e_20_22_2c_22_29(__nt), __end));
+                6
+            }
+            12 => {
+                // (<BoxedTerm> ",")* =  => ActionFn(45);
+                let __start = __symbols.last().map(|s| s.2.clone()).unwrap_or_default();
+                let __end = __lookahead_start.cloned().unwrap_or_else(|| __start.clone());
+                let __nt = super::__action45::<>(input, &__start, &__end);
+                let __states_len = __states.len();
+                __states.truncate(__states_len - 0);
+                __symbols.push((__start, __Symbol::Nt_28_3cBoxedTerm_3e_20_22_2c_22_29_2a(__nt), __end));
+                7
+            }
+            13 => {
+                // (<BoxedTerm> ",")* = (<BoxedTerm> ",")+ => ActionFn(46);
+                let __sym0 = __pop_Nt_28_3cBoxedTerm_3e_20_22_2c_22_29_2b(__symbols);
+                let __start = __sym0.0.clone();
+                let __end = __sym0.2.clone();
+                let __nt = super::__action46::<>(input, __sym0);
+                let __states_len = __states.len();
+                __states.truncate(__states_len - 1);
+                __symbols.push((__start, __Symbol::Nt_28_3cBoxedTerm_3e_20_22_2c_22_29_2a(__nt), __end));
+                7
+            }
+            14 => {
+                // (<BoxedTerm> ",")+ = BoxedTerm, "," => ActionFn(70);
                 let __sym1 = __pop_Term_22_2c_22(__symbols);
                 let __sym0 = __pop_NtBoxedTerm(__symbols);
                 let __start = __sym0.0.clone();
                 let __end = __sym1.2.clone();
-                let __nt = super::__action51::<>(input, __sym0, __sym1);
+                let __nt = super::__action70::<>(input, __sym0, __sym1);
                 let __states_len = __states.len();
                 __states.truncate(__states_len - 2);
                 __symbols.push((__start, __Symbol::Nt_28_3cBoxedTerm_3e_20_22_2c_22_29_2b(__nt), __end));
-                5
+                8
             }
-            10 => {
-                // (<BoxedTerm> ",")+ = (<BoxedTerm> ",")+, BoxedTerm, "," => ActionFn(52);
+            15 => {
+                // (<BoxedTerm> ",")+ = (<BoxedTerm> ",")+, BoxedTerm, "," => ActionFn(71);
                 let __sym2 = __pop_Term_22_2c_22(__symbols);
                 let __sym1 = __pop_NtBoxedTerm(__symbols);
                 let __sym0 = __pop_Nt_28_3cBoxedTerm_3e_20_22_2c_22_29_2b(__symbols);
                 let __start = __sym0.0.clone();
                 let __end = __sym2.2.clone();
-                let __nt = super::__action52::<>(input, __sym0, __sym1, __sym2);
+                let __nt = super::__action71::<>(input, __sym0, __sym1, __sym2);
                 let __states_len = __states.len();
                 __states.truncate(__states_len - 3);
                 __symbols.push((__start, __Symbol::Nt_28_3cBoxedTerm_3e_20_22_2c_22_29_2b(__nt), __end));
-                5
+                8
             }
-            11 => {
-                // (<PredicateClause>) = PredicateClause => ActionFn(35);
+            16 => {
+                // (<PredicateClause>) = PredicateClause => ActionFn(41);
                 let __sym0 = __pop_NtPredicateClause(__symbols);
                 let __start = __sym0.0.clone();
                 let __end = __sym0.2.clone();
-                let __nt = super::__action35::<>(input, __sym0);
+                let __nt = super::__action41::<>(input, __sym0);
                 let __states_len = __states.len();
                 __states.truncate(__states_len - 1);
                 __symbols.push((__start, __Symbol::Nt_28_3cPredicateClause_3e_29(__nt), __end));
-                6
+                9
             }
-            12 => {
-                // (<PredicateClause>)+ = PredicateClause => ActionFn(55);
+            17 => {
+                // (<PredicateClause>)+ = PredicateClause => ActionFn(78);
                 let __sym0 = __pop_NtPredicateClause(__symbols);
                 let __start = __sym0.0.clone();
                 let __end = __sym0.2.clone();
-                let __nt = super::__action55::<>(input, __sym0);
+                let __nt = super::__action78::<>(input, __sym0);
                 let __states_len = __states.len();
                 __states.truncate(__states_len - 1);
                 __symbols.push((__start, __Symbol::Nt_28_3cPredicateClause_3e_29_2b(__nt), __end));
-                7
+                10
             }
-            13 => {
-                // (<PredicateClause>)+ = (<PredicateClause>)+, PredicateClause => ActionFn(56);
+            18 => {
+                // (<PredicateClause>)+ = (<PredicateClause>)+, PredicateClause => ActionFn(79);
                 let __sym1 = __pop_NtPredicateClause(__symbols);
                 let __sym0 = __pop_Nt_28_3cPredicateClause_3e_29_2b(__symbols);
                 let __start = __sym0.0.clone();
                 let __end = __sym1.2.clone();
-                let __nt = super::__action56::<>(input, __sym0, __sym1);
+                let __nt = super::__action79::<>(input, __sym0, __sym1);
                 let __states_len = __states.len();
                 __states.truncate(__states_len - 2);
                 __symbols.push((__start, __Symbol::Nt_28_3cPredicateClause_3e_29_2b(__nt), __end));
-                7
+                10
             }
-            14 => {
-                // (<TermOrCut> ",") = TermOrCut, "," => ActionFn(32);
+            19 => {
+                // (<QueryTerm> ",") = QueryTerm, "," => ActionFn(38);
                 let __sym1 = __pop_Term_22_2c_22(__symbols);
-                let __sym0 = __pop_NtTermOrCut(__symbols);
+                let __sym0 = __pop_NtQueryTerm(__symbols);
                 let __start = __sym0.0.clone();
                 let __end = __sym1.2.clone();
-                let __nt = super::__action32::<>(input, __sym0, __sym1);
+                let __nt = super::__action38::<>(input, __sym0, __sym1);
                 let __states_len = __states.len();
                 __states.truncate(__states_len - 2);
-                __symbols.push((__start, __Symbol::Nt_28_3cTermOrCut_3e_20_22_2c_22_29(__nt), __end));
-                8
+                __symbols.push((__start, __Symbol::Nt_28_3cQueryTerm_3e_20_22_2c_22_29(__nt), __end));
+                11
             }
-            15 => {
-                // (<TermOrCut> ",")* =  => ActionFn(30);
+            20 => {
+                // (<QueryTerm> ",")* =  => ActionFn(36);
                 let __start = __symbols.last().map(|s| s.2.clone()).unwrap_or_default();
                 let __end = __lookahead_start.cloned().unwrap_or_else(|| __start.clone());
-                let __nt = super::__action30::<>(input, &__start, &__end);
+                let __nt = super::__action36::<>(input, &__start, &__end);
                 let __states_len = __states.len();
                 __states.truncate(__states_len - 0);
-                __symbols.push((__start, __Symbol::Nt_28_3cTermOrCut_3e_20_22_2c_22_29_2a(__nt), __end));
-                9
+                __symbols.push((__start, __Symbol::Nt_28_3cQueryTerm_3e_20_22_2c_22_29_2a(__nt), __end));
+                12
             }
-            16 => {
-                // (<TermOrCut> ",")* = (<TermOrCut> ",")+ => ActionFn(31);
-                let __sym0 = __pop_Nt_28_3cTermOrCut_3e_20_22_2c_22_29_2b(__symbols);
+            21 => {
+                // (<QueryTerm> ",")* = (<QueryTerm> ",")+ => ActionFn(37);
+                let __sym0 = __pop_Nt_28_3cQueryTerm_3e_20_22_2c_22_29_2b(__symbols);
                 let __start = __sym0.0.clone();
                 let __end = __sym0.2.clone();
-                let __nt = super::__action31::<>(input, __sym0);
+                let __nt = super::__action37::<>(input, __sym0);
                 let __states_len = __states.len();
                 __states.truncate(__states_len - 1);
-                __symbols.push((__start, __Symbol::Nt_28_3cTermOrCut_3e_20_22_2c_22_29_2a(__nt), __end));
-                9
+                __symbols.push((__start, __Symbol::Nt_28_3cQueryTerm_3e_20_22_2c_22_29_2a(__nt), __end));
+                12
             }
-            17 => {
-                // (<TermOrCut> ",")+ = TermOrCut, "," => ActionFn(57);
+            22 => {
+                // (<QueryTerm> ",")+ = QueryTerm, "," => ActionFn(80);
                 let __sym1 = __pop_Term_22_2c_22(__symbols);
-                let __sym0 = __pop_NtTermOrCut(__symbols);
+                let __sym0 = __pop_NtQueryTerm(__symbols);
                 let __start = __sym0.0.clone();
                 let __end = __sym1.2.clone();
-                let __nt = super::__action57::<>(input, __sym0, __sym1);
+                let __nt = super::__action80::<>(input, __sym0, __sym1);
                 let __states_len = __states.len();
                 __states.truncate(__states_len - 2);
-                __symbols.push((__start, __Symbol::Nt_28_3cTermOrCut_3e_20_22_2c_22_29_2b(__nt), __end));
-                10
+                __symbols.push((__start, __Symbol::Nt_28_3cQueryTerm_3e_20_22_2c_22_29_2b(__nt), __end));
+                13
             }
-            18 => {
-                // (<TermOrCut> ",")+ = (<TermOrCut> ",")+, TermOrCut, "," => ActionFn(58);
+            23 => {
+                // (<QueryTerm> ",")+ = (<QueryTerm> ",")+, QueryTerm, "," => ActionFn(81);
                 let __sym2 = __pop_Term_22_2c_22(__symbols);
-                let __sym1 = __pop_NtTermOrCut(__symbols);
-                let __sym0 = __pop_Nt_28_3cTermOrCut_3e_20_22_2c_22_29_2b(__symbols);
+                let __sym1 = __pop_NtQueryTerm(__symbols);
+                let __sym0 = __pop_Nt_28_3cQueryTerm_3e_20_22_2c_22_29_2b(__symbols);
                 let __start = __sym0.0.clone();
                 let __end = __sym2.2.clone();
-                let __nt = super::__action58::<>(input, __sym0, __sym1, __sym2);
+                let __nt = super::__action81::<>(input, __sym0, __sym1, __sym2);
                 let __states_len = __states.len();
                 __states.truncate(__states_len - 3);
-                __symbols.push((__start, __Symbol::Nt_28_3cTermOrCut_3e_20_22_2c_22_29_2b(__nt), __end));
-                10
+                __symbols.push((__start, __Symbol::Nt_28_3cQueryTerm_3e_20_22_2c_22_29_2b(__nt), __end));
+                13
             }
-            19 => {
+            24 => {
                 // Atom = r#"[a-z][A-Za-z0-9_]*"# => ActionFn(5);
                 let __sym0 = __pop_Termr_23_22_5ba_2dz_5d_5bA_2dZa_2dz0_2d9___5d_2a_22_23(__symbols);
                 let __start = __sym0.0.clone();
@@ -1096,9 +1265,9 @@ mod __parse__TopLevel {
                 let __states_len = __states.len();
                 __states.truncate(__states_len - 1);
                 __symbols.push((__start, __Symbol::NtAtom(__nt), __end));
-                11
+                14
             }
-            20 => {
+            25 => {
                 // BoxedTerm = Term => ActionFn(6);
                 let __sym0 = __pop_NtTerm(__symbols);
                 let __start = __sym0.0.clone();
@@ -1107,24 +1276,154 @@ mod __parse__TopLevel {
                 let __states_len = __states.len();
                 __states.truncate(__states_len - 1);
                 __symbols.push((__start, __Symbol::NtBoxedTerm(__nt), __end));
-                12
+                15
             }
-            21 => {
-                // Clause = Atom, "(", BoxedTerm, ")" => ActionFn(53);
+            26 => {
+                // Call = "call", "(", Atom, "(", BoxedTerm, ")", ")" => ActionFn(72);
+                let __sym6 = __pop_Term_22_29_22(__symbols);
+                let __sym5 = __pop_Term_22_29_22(__symbols);
+                let __sym4 = __pop_NtBoxedTerm(__symbols);
+                let __sym3 = __pop_Term_22_28_22(__symbols);
+                let __sym2 = __pop_NtAtom(__symbols);
+                let __sym1 = __pop_Term_22_28_22(__symbols);
+                let __sym0 = __pop_Term_22call_22(__symbols);
+                let __start = __sym0.0.clone();
+                let __end = __sym6.2.clone();
+                let __nt = super::__action72::<>(input, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6);
+                let __states_len = __states.len();
+                __states.truncate(__states_len - 7);
+                __symbols.push((__start, __Symbol::NtCall(__nt), __end));
+                16
+            }
+            27 => {
+                // Call = "call", "(", Atom, "(", (<BoxedTerm> ",")+, BoxedTerm, ")", ")" => ActionFn(73);
+                let __sym7 = __pop_Term_22_29_22(__symbols);
+                let __sym6 = __pop_Term_22_29_22(__symbols);
+                let __sym5 = __pop_NtBoxedTerm(__symbols);
+                let __sym4 = __pop_Nt_28_3cBoxedTerm_3e_20_22_2c_22_29_2b(__symbols);
+                let __sym3 = __pop_Term_22_28_22(__symbols);
+                let __sym2 = __pop_NtAtom(__symbols);
+                let __sym1 = __pop_Term_22_28_22(__symbols);
+                let __sym0 = __pop_Term_22call_22(__symbols);
+                let __start = __sym0.0.clone();
+                let __end = __sym7.2.clone();
+                let __nt = super::__action73::<>(input, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7);
+                let __states_len = __states.len();
+                __states.truncate(__states_len - 8);
+                __symbols.push((__start, __Symbol::NtCall(__nt), __end));
+                16
+            }
+            28 => {
+                // Call = "call", "(", Atom, "(", BoxedTerm, ")", ("," <BoxedTerm>)+, ")" => ActionFn(74);
+                let __sym7 = __pop_Term_22_29_22(__symbols);
+                let __sym6 = __pop_Nt_28_22_2c_22_20_3cBoxedTerm_3e_29_2b(__symbols);
+                let __sym5 = __pop_Term_22_29_22(__symbols);
+                let __sym4 = __pop_NtBoxedTerm(__symbols);
+                let __sym3 = __pop_Term_22_28_22(__symbols);
+                let __sym2 = __pop_NtAtom(__symbols);
+                let __sym1 = __pop_Term_22_28_22(__symbols);
+                let __sym0 = __pop_Term_22call_22(__symbols);
+                let __start = __sym0.0.clone();
+                let __end = __sym7.2.clone();
+                let __nt = super::__action74::<>(input, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7);
+                let __states_len = __states.len();
+                __states.truncate(__states_len - 8);
+                __symbols.push((__start, __Symbol::NtCall(__nt), __end));
+                16
+            }
+            29 => {
+                // Call = "call", "(", Atom, "(", (<BoxedTerm> ",")+, BoxedTerm, ")", ("," <BoxedTerm>)+, ")" => ActionFn(75);
+                let __sym8 = __pop_Term_22_29_22(__symbols);
+                let __sym7 = __pop_Nt_28_22_2c_22_20_3cBoxedTerm_3e_29_2b(__symbols);
+                let __sym6 = __pop_Term_22_29_22(__symbols);
+                let __sym5 = __pop_NtBoxedTerm(__symbols);
+                let __sym4 = __pop_Nt_28_3cBoxedTerm_3e_20_22_2c_22_29_2b(__symbols);
+                let __sym3 = __pop_Term_22_28_22(__symbols);
+                let __sym2 = __pop_NtAtom(__symbols);
+                let __sym1 = __pop_Term_22_28_22(__symbols);
+                let __sym0 = __pop_Term_22call_22(__symbols);
+                let __start = __sym0.0.clone();
+                let __end = __sym8.2.clone();
+                let __nt = super::__action75::<>(input, __sym0, __sym1, __sym2, __sym3, __sym4, __sym5, __sym6, __sym7, __sym8);
+                let __states_len = __states.len();
+                __states.truncate(__states_len - 9);
+                __symbols.push((__start, __Symbol::NtCall(__nt), __end));
+                16
+            }
+            30 => {
+                // Call = "call", "(", Atom, ")" => ActionFn(60);
+                let __sym3 = __pop_Term_22_29_22(__symbols);
+                let __sym2 = __pop_NtAtom(__symbols);
+                let __sym1 = __pop_Term_22_28_22(__symbols);
+                let __sym0 = __pop_Term_22call_22(__symbols);
+                let __start = __sym0.0.clone();
+                let __end = __sym3.2.clone();
+                let __nt = super::__action60::<>(input, __sym0, __sym1, __sym2, __sym3);
+                let __states_len = __states.len();
+                __states.truncate(__states_len - 4);
+                __symbols.push((__start, __Symbol::NtCall(__nt), __end));
+                16
+            }
+            31 => {
+                // Call = "call", "(", Atom, ("," <BoxedTerm>)+, ")" => ActionFn(61);
+                let __sym4 = __pop_Term_22_29_22(__symbols);
+                let __sym3 = __pop_Nt_28_22_2c_22_20_3cBoxedTerm_3e_29_2b(__symbols);
+                let __sym2 = __pop_NtAtom(__symbols);
+                let __sym1 = __pop_Term_22_28_22(__symbols);
+                let __sym0 = __pop_Term_22call_22(__symbols);
+                let __start = __sym0.0.clone();
+                let __end = __sym4.2.clone();
+                let __nt = super::__action61::<>(input, __sym0, __sym1, __sym2, __sym3, __sym4);
+                let __states_len = __states.len();
+                __states.truncate(__states_len - 5);
+                __symbols.push((__start, __Symbol::NtCall(__nt), __end));
+                16
+            }
+            32 => {
+                // Call = "call", "(", Var, ")" => ActionFn(62);
+                let __sym3 = __pop_Term_22_29_22(__symbols);
+                let __sym2 = __pop_NtVar(__symbols);
+                let __sym1 = __pop_Term_22_28_22(__symbols);
+                let __sym0 = __pop_Term_22call_22(__symbols);
+                let __start = __sym0.0.clone();
+                let __end = __sym3.2.clone();
+                let __nt = super::__action62::<>(input, __sym0, __sym1, __sym2, __sym3);
+                let __states_len = __states.len();
+                __states.truncate(__states_len - 4);
+                __symbols.push((__start, __Symbol::NtCall(__nt), __end));
+                16
+            }
+            33 => {
+                // Call = "call", "(", Var, ("," <BoxedTerm>)+, ")" => ActionFn(63);
+                let __sym4 = __pop_Term_22_29_22(__symbols);
+                let __sym3 = __pop_Nt_28_22_2c_22_20_3cBoxedTerm_3e_29_2b(__symbols);
+                let __sym2 = __pop_NtVar(__symbols);
+                let __sym1 = __pop_Term_22_28_22(__symbols);
+                let __sym0 = __pop_Term_22call_22(__symbols);
+                let __start = __sym0.0.clone();
+                let __end = __sym4.2.clone();
+                let __nt = super::__action63::<>(input, __sym0, __sym1, __sym2, __sym3, __sym4);
+                let __states_len = __states.len();
+                __states.truncate(__states_len - 5);
+                __symbols.push((__start, __Symbol::NtCall(__nt), __end));
+                16
+            }
+            34 => {
+                // Clause = Atom, "(", BoxedTerm, ")" => ActionFn(76);
                 let __sym3 = __pop_Term_22_29_22(__symbols);
                 let __sym2 = __pop_NtBoxedTerm(__symbols);
                 let __sym1 = __pop_Term_22_28_22(__symbols);
                 let __sym0 = __pop_NtAtom(__symbols);
                 let __start = __sym0.0.clone();
                 let __end = __sym3.2.clone();
-                let __nt = super::__action53::<>(input, __sym0, __sym1, __sym2, __sym3);
+                let __nt = super::__action76::<>(input, __sym0, __sym1, __sym2, __sym3);
                 let __states_len = __states.len();
                 __states.truncate(__states_len - 4);
                 __symbols.push((__start, __Symbol::NtClause(__nt), __end));
-                13
+                17
             }
-            22 => {
-                // Clause = Atom, "(", (<BoxedTerm> ",")+, BoxedTerm, ")" => ActionFn(54);
+            35 => {
+                // Clause = Atom, "(", (<BoxedTerm> ",")+, BoxedTerm, ")" => ActionFn(77);
                 let __sym4 = __pop_Term_22_29_22(__symbols);
                 let __sym3 = __pop_NtBoxedTerm(__symbols);
                 let __sym2 = __pop_Nt_28_3cBoxedTerm_3e_20_22_2c_22_29_2b(__symbols);
@@ -1132,264 +1431,297 @@ mod __parse__TopLevel {
                 let __sym0 = __pop_NtAtom(__symbols);
                 let __start = __sym0.0.clone();
                 let __end = __sym4.2.clone();
-                let __nt = super::__action54::<>(input, __sym0, __sym1, __sym2, __sym3, __sym4);
+                let __nt = super::__action77::<>(input, __sym0, __sym1, __sym2, __sym3, __sym4);
                 let __states_len = __states.len();
                 __states.truncate(__states_len - 5);
                 __symbols.push((__start, __Symbol::NtClause(__nt), __end));
-                13
+                17
             }
-            23 => {
-                // List = "[]" => ActionFn(8);
+            36 => {
+                // List = "[]" => ActionFn(11);
                 let __sym0 = __pop_Term_22_5b_5d_22(__symbols);
                 let __start = __sym0.0.clone();
                 let __end = __sym0.2.clone();
-                let __nt = super::__action8::<>(input, __sym0);
+                let __nt = super::__action11::<>(input, __sym0);
                 let __states_len = __states.len();
                 __states.truncate(__states_len - 1);
                 __symbols.push((__start, __Symbol::NtList(__nt), __end));
-                14
+                18
             }
-            24 => {
-                // List = "[", ListInternals, "]" => ActionFn(9);
+            37 => {
+                // List = "[", ListInternals, "]" => ActionFn(12);
                 let __sym2 = __pop_Term_22_5d_22(__symbols);
                 let __sym1 = __pop_NtListInternals(__symbols);
                 let __sym0 = __pop_Term_22_5b_22(__symbols);
                 let __start = __sym0.0.clone();
                 let __end = __sym2.2.clone();
-                let __nt = super::__action9::<>(input, __sym0, __sym1, __sym2);
+                let __nt = super::__action12::<>(input, __sym0, __sym1, __sym2);
                 let __states_len = __states.len();
                 __states.truncate(__states_len - 3);
                 __symbols.push((__start, __Symbol::NtList(__nt), __end));
-                14
+                18
             }
-            25 => {
-                // ListInternals = BoxedTerm => ActionFn(10);
+            38 => {
+                // ListInternals = BoxedTerm => ActionFn(13);
                 let __sym0 = __pop_NtBoxedTerm(__symbols);
                 let __start = __sym0.0.clone();
                 let __end = __sym0.2.clone();
-                let __nt = super::__action10::<>(input, __sym0);
+                let __nt = super::__action13::<>(input, __sym0);
                 let __states_len = __states.len();
                 __states.truncate(__states_len - 1);
                 __symbols.push((__start, __Symbol::NtListInternals(__nt), __end));
-                15
+                19
             }
-            26 => {
-                // ListInternals = BoxedTerm, ",", ListInternals => ActionFn(11);
+            39 => {
+                // ListInternals = BoxedTerm, ",", ListInternals => ActionFn(14);
                 let __sym2 = __pop_NtListInternals(__symbols);
                 let __sym1 = __pop_Term_22_2c_22(__symbols);
                 let __sym0 = __pop_NtBoxedTerm(__symbols);
                 let __start = __sym0.0.clone();
                 let __end = __sym2.2.clone();
-                let __nt = super::__action11::<>(input, __sym0, __sym1, __sym2);
+                let __nt = super::__action14::<>(input, __sym0, __sym1, __sym2);
                 let __states_len = __states.len();
                 __states.truncate(__states_len - 3);
                 __symbols.push((__start, __Symbol::NtListInternals(__nt), __end));
-                15
+                19
             }
-            27 => {
-                // ListInternals = BoxedTerm, "|", BoxedTerm => ActionFn(12);
+            40 => {
+                // ListInternals = BoxedTerm, "|", BoxedTerm => ActionFn(15);
                 let __sym2 = __pop_NtBoxedTerm(__symbols);
                 let __sym1 = __pop_Term_22_7c_22(__symbols);
                 let __sym0 = __pop_NtBoxedTerm(__symbols);
                 let __start = __sym0.0.clone();
                 let __end = __sym2.2.clone();
-                let __nt = super::__action12::<>(input, __sym0, __sym1, __sym2);
+                let __nt = super::__action15::<>(input, __sym0, __sym1, __sym2);
                 let __states_len = __states.len();
                 __states.truncate(__states_len - 3);
                 __symbols.push((__start, __Symbol::NtListInternals(__nt), __end));
-                15
+                19
             }
-            28 => {
-                // Predicate = (<PredicateClause>)+, PredicateClause => ActionFn(13);
+            41 => {
+                // Predicate = (<PredicateClause>)+, PredicateClause => ActionFn(16);
                 let __sym1 = __pop_NtPredicateClause(__symbols);
                 let __sym0 = __pop_Nt_28_3cPredicateClause_3e_29_2b(__symbols);
                 let __start = __sym0.0.clone();
                 let __end = __sym1.2.clone();
-                let __nt = super::__action13::<>(input, __sym0, __sym1);
+                let __nt = super::__action16::<>(input, __sym0, __sym1);
                 let __states_len = __states.len();
                 __states.truncate(__states_len - 2);
                 __symbols.push((__start, __Symbol::NtPredicate(__nt), __end));
-                16
+                20
             }
-            29 => {
-                // PredicateClause = Rule, "." => ActionFn(14);
+            42 => {
+                // PredicateClause = Rule, "." => ActionFn(17);
                 let __sym1 = __pop_Term_22_2e_22(__symbols);
                 let __sym0 = __pop_NtRule(__symbols);
                 let __start = __sym0.0.clone();
                 let __end = __sym1.2.clone();
-                let __nt = super::__action14::<>(input, __sym0, __sym1);
+                let __nt = super::__action17::<>(input, __sym0, __sym1);
                 let __states_len = __states.len();
                 __states.truncate(__states_len - 2);
                 __symbols.push((__start, __Symbol::NtPredicateClause(__nt), __end));
-                17
+                21
             }
-            30 => {
-                // PredicateClause = Term, "." => ActionFn(15);
+            43 => {
+                // PredicateClause = Term, "." => ActionFn(18);
                 let __sym1 = __pop_Term_22_2e_22(__symbols);
                 let __sym0 = __pop_NtTerm(__symbols);
                 let __start = __sym0.0.clone();
                 let __end = __sym1.2.clone();
-                let __nt = super::__action15::<>(input, __sym0, __sym1);
+                let __nt = super::__action18::<>(input, __sym0, __sym1);
                 let __states_len = __states.len();
                 __states.truncate(__states_len - 2);
                 __symbols.push((__start, __Symbol::NtPredicateClause(__nt), __end));
-                17
+                21
             }
-            31 => {
-                // Query = TermOrCut => ActionFn(59);
-                let __sym0 = __pop_NtTermOrCut(__symbols);
+            44 => {
+                // Query = QueryTerm => ActionFn(82);
+                let __sym0 = __pop_NtQueryTerm(__symbols);
                 let __start = __sym0.0.clone();
                 let __end = __sym0.2.clone();
-                let __nt = super::__action59::<>(input, __sym0);
+                let __nt = super::__action82::<>(input, __sym0);
                 let __states_len = __states.len();
                 __states.truncate(__states_len - 1);
                 __symbols.push((__start, __Symbol::NtQuery(__nt), __end));
-                18
+                22
             }
-            32 => {
-                // Query = (<TermOrCut> ",")+, TermOrCut => ActionFn(60);
-                let __sym1 = __pop_NtTermOrCut(__symbols);
-                let __sym0 = __pop_Nt_28_3cTermOrCut_3e_20_22_2c_22_29_2b(__symbols);
+            45 => {
+                // Query = (<QueryTerm> ",")+, QueryTerm => ActionFn(83);
+                let __sym1 = __pop_NtQueryTerm(__symbols);
+                let __sym0 = __pop_Nt_28_3cQueryTerm_3e_20_22_2c_22_29_2b(__symbols);
                 let __start = __sym0.0.clone();
                 let __end = __sym1.2.clone();
-                let __nt = super::__action60::<>(input, __sym0, __sym1);
+                let __nt = super::__action83::<>(input, __sym0, __sym1);
                 let __states_len = __states.len();
                 __states.truncate(__states_len - 2);
                 __symbols.push((__start, __Symbol::NtQuery(__nt), __end));
-                18
+                22
             }
-            33 => {
-                // Rule = Clause, ":-", TermOrCut => ActionFn(47);
-                let __sym2 = __pop_NtTermOrCut(__symbols);
-                let __sym1 = __pop_Term_22_3a_2d_22(__symbols);
-                let __sym0 = __pop_NtClause(__symbols);
+            46 => {
+                // QueryTerm = Call => ActionFn(22);
+                let __sym0 = __pop_NtCall(__symbols);
                 let __start = __sym0.0.clone();
-                let __end = __sym2.2.clone();
-                let __nt = super::__action47::<>(input, __sym0, __sym1, __sym2);
+                let __end = __sym0.2.clone();
+                let __nt = super::__action22::<>(input, __sym0);
                 let __states_len = __states.len();
-                __states.truncate(__states_len - 3);
-                __symbols.push((__start, __Symbol::NtRule(__nt), __end));
-                19
+                __states.truncate(__states_len - 1);
+                __symbols.push((__start, __Symbol::NtQueryTerm(__nt), __end));
+                23
             }
-            34 => {
-                // Rule = Clause, ":-", TermOrCut, ("," <TermOrCut>)+ => ActionFn(48);
-                let __sym3 = __pop_Nt_28_22_2c_22_20_3cTermOrCut_3e_29_2b(__symbols);
-                let __sym2 = __pop_NtTermOrCut(__symbols);
-                let __sym1 = __pop_Term_22_3a_2d_22(__symbols);
-                let __sym0 = __pop_NtClause(__symbols);
+            47 => {
+                // QueryTerm = "!" => ActionFn(23);
+                let __sym0 = __pop_Term_22_21_22(__symbols);
+                let __start = __sym0.0.clone();
+                let __end = __sym0.2.clone();
+                let __nt = super::__action23::<>(input, __sym0);
+                let __states_len = __states.len();
+                __states.truncate(__states_len - 1);
+                __symbols.push((__start, __Symbol::NtQueryTerm(__nt), __end));
+                23
+            }
+            48 => {
+                // QueryTerm = Var => ActionFn(24);
+                let __sym0 = __pop_NtVar(__symbols);
+                let __start = __sym0.0.clone();
+                let __end = __sym0.2.clone();
+                let __nt = super::__action24::<>(input, __sym0);
+                let __states_len = __states.len();
+                __states.truncate(__states_len - 1);
+                __symbols.push((__start, __Symbol::NtQueryTerm(__nt), __end));
+                23
+            }
+            49 => {
+                // QueryTerm = Clause => ActionFn(25);
+                let __sym0 = __pop_NtClause(__symbols);
+                let __start = __sym0.0.clone();
+                let __end = __sym0.2.clone();
+                let __nt = super::__action25::<>(input, __sym0);
+                let __states_len = __states.len();
+                __states.truncate(__states_len - 1);
+                __symbols.push((__start, __Symbol::NtQueryTerm(__nt), __end));
+                23
+            }
+            50 => {
+                // QueryTerm = Atom => ActionFn(26);
+                let __sym0 = __pop_NtAtom(__symbols);
+                let __start = __sym0.0.clone();
+                let __end = __sym0.2.clone();
+                let __nt = super::__action26::<>(input, __sym0);
+                let __states_len = __states.len();
+                __states.truncate(__states_len - 1);
+                __symbols.push((__start, __Symbol::NtQueryTerm(__nt), __end));
+                23
+            }
+            51 => {
+                // Rule = Clause, ":-", QueryTerm => ActionFn(66);
+                let __sym2 = __pop_NtQueryTerm(__symbols);
+                let __sym1 = __pop_Term_22_3a_2d_22(__symbols);
+                let __sym0 = __pop_NtClause(__symbols);
+                let __start = __sym0.0.clone();
+                let __end = __sym2.2.clone();
+                let __nt = super::__action66::<>(input, __sym0, __sym1, __sym2);
+                let __states_len = __states.len();
+                __states.truncate(__states_len - 3);
+                __symbols.push((__start, __Symbol::NtRule(__nt), __end));
+                24
+            }
+            52 => {
+                // Rule = Clause, ":-", QueryTerm, ("," <QueryTerm>)+ => ActionFn(67);
+                let __sym3 = __pop_Nt_28_22_2c_22_20_3cQueryTerm_3e_29_2b(__symbols);
+                let __sym2 = __pop_NtQueryTerm(__symbols);
+                let __sym1 = __pop_Term_22_3a_2d_22(__symbols);
+                let __sym0 = __pop_NtClause(__symbols);
                 let __start = __sym0.0.clone();
                 let __end = __sym3.2.clone();
-                let __nt = super::__action48::<>(input, __sym0, __sym1, __sym2, __sym3);
+                let __nt = super::__action67::<>(input, __sym0, __sym1, __sym2, __sym3);
                 let __states_len = __states.len();
                 __states.truncate(__states_len - 4);
                 __symbols.push((__start, __Symbol::NtRule(__nt), __end));
-                19
+                24
             }
-            35 => {
-                // Rule = Atom, ":-", TermOrCut => ActionFn(49);
-                let __sym2 = __pop_NtTermOrCut(__symbols);
+            53 => {
+                // Rule = Atom, ":-", QueryTerm => ActionFn(68);
+                let __sym2 = __pop_NtQueryTerm(__symbols);
                 let __sym1 = __pop_Term_22_3a_2d_22(__symbols);
                 let __sym0 = __pop_NtAtom(__symbols);
                 let __start = __sym0.0.clone();
                 let __end = __sym2.2.clone();
-                let __nt = super::__action49::<>(input, __sym0, __sym1, __sym2);
+                let __nt = super::__action68::<>(input, __sym0, __sym1, __sym2);
                 let __states_len = __states.len();
                 __states.truncate(__states_len - 3);
                 __symbols.push((__start, __Symbol::NtRule(__nt), __end));
-                19
+                24
             }
-            36 => {
-                // Rule = Atom, ":-", TermOrCut, ("," <TermOrCut>)+ => ActionFn(50);
-                let __sym3 = __pop_Nt_28_22_2c_22_20_3cTermOrCut_3e_29_2b(__symbols);
-                let __sym2 = __pop_NtTermOrCut(__symbols);
+            54 => {
+                // Rule = Atom, ":-", QueryTerm, ("," <QueryTerm>)+ => ActionFn(69);
+                let __sym3 = __pop_Nt_28_22_2c_22_20_3cQueryTerm_3e_29_2b(__symbols);
+                let __sym2 = __pop_NtQueryTerm(__symbols);
                 let __sym1 = __pop_Term_22_3a_2d_22(__symbols);
                 let __sym0 = __pop_NtAtom(__symbols);
                 let __start = __sym0.0.clone();
                 let __end = __sym3.2.clone();
-                let __nt = super::__action50::<>(input, __sym0, __sym1, __sym2, __sym3);
+                let __nt = super::__action69::<>(input, __sym0, __sym1, __sym2, __sym3);
                 let __states_len = __states.len();
                 __states.truncate(__states_len - 4);
                 __symbols.push((__start, __Symbol::NtRule(__nt), __end));
-                19
+                24
             }
-            37 => {
-                // Term = Atom => ActionFn(21);
+            55 => {
+                // Term = Atom => ActionFn(27);
                 let __sym0 = __pop_NtAtom(__symbols);
                 let __start = __sym0.0.clone();
                 let __end = __sym0.2.clone();
-                let __nt = super::__action21::<>(input, __sym0);
+                let __nt = super::__action27::<>(input, __sym0);
                 let __states_len = __states.len();
                 __states.truncate(__states_len - 1);
                 __symbols.push((__start, __Symbol::NtTerm(__nt), __end));
-                20
+                25
             }
-            38 => {
-                // Term = Clause => ActionFn(22);
+            56 => {
+                // Term = Clause => ActionFn(28);
                 let __sym0 = __pop_NtClause(__symbols);
                 let __start = __sym0.0.clone();
                 let __end = __sym0.2.clone();
-                let __nt = super::__action22::<>(input, __sym0);
+                let __nt = super::__action28::<>(input, __sym0);
                 let __states_len = __states.len();
                 __states.truncate(__states_len - 1);
                 __symbols.push((__start, __Symbol::NtTerm(__nt), __end));
-                20
+                25
             }
-            39 => {
-                // Term = List => ActionFn(23);
+            57 => {
+                // Term = List => ActionFn(29);
                 let __sym0 = __pop_NtList(__symbols);
                 let __start = __sym0.0.clone();
                 let __end = __sym0.2.clone();
-                let __nt = super::__action23::<>(input, __sym0);
+                let __nt = super::__action29::<>(input, __sym0);
                 let __states_len = __states.len();
                 __states.truncate(__states_len - 1);
                 __symbols.push((__start, __Symbol::NtTerm(__nt), __end));
-                20
+                25
             }
-            40 => {
-                // Term = Var => ActionFn(24);
+            58 => {
+                // Term = Var => ActionFn(30);
                 let __sym0 = __pop_NtVar(__symbols);
                 let __start = __sym0.0.clone();
                 let __end = __sym0.2.clone();
-                let __nt = super::__action24::<>(input, __sym0);
+                let __nt = super::__action30::<>(input, __sym0);
                 let __states_len = __states.len();
                 __states.truncate(__states_len - 1);
                 __symbols.push((__start, __Symbol::NtTerm(__nt), __end));
-                20
+                25
             }
-            41 => {
-                // Term = "_" => ActionFn(25);
+            59 => {
+                // Term = "_" => ActionFn(31);
                 let __sym0 = __pop_Term_22___22(__symbols);
                 let __start = __sym0.0.clone();
                 let __end = __sym0.2.clone();
-                let __nt = super::__action25::<>(input, __sym0);
+                let __nt = super::__action31::<>(input, __sym0);
                 let __states_len = __states.len();
                 __states.truncate(__states_len - 1);
                 __symbols.push((__start, __Symbol::NtTerm(__nt), __end));
-                20
-            }
-            42 => {
-                // TermOrCut = "!" => ActionFn(19);
-                let __sym0 = __pop_Term_22_21_22(__symbols);
-                let __start = __sym0.0.clone();
-                let __end = __sym0.2.clone();
-                let __nt = super::__action19::<>(input, __sym0);
-                let __states_len = __states.len();
-                __states.truncate(__states_len - 1);
-                __symbols.push((__start, __Symbol::NtTermOrCut(__nt), __end));
-                21
-            }
-            43 => {
-                // TermOrCut = Term => ActionFn(20);
-                let __sym0 = __pop_NtTerm(__symbols);
-                let __start = __sym0.0.clone();
-                let __end = __sym0.2.clone();
-                let __nt = super::__action20::<>(input, __sym0);
-                let __states_len = __states.len();
-                __states.truncate(__states_len - 1);
-                __symbols.push((__start, __Symbol::NtTermOrCut(__nt), __end));
-                21
+                25
             }
-            44 => {
+            60 => {
                 // TopLevel = "?-", Query, "." => ActionFn(1);
                 let __sym2 = __pop_Term_22_2e_22(__symbols);
                 let __sym1 = __pop_NtQuery(__symbols);
@@ -1400,9 +1732,9 @@ mod __parse__TopLevel {
                 let __states_len = __states.len();
                 __states.truncate(__states_len - 3);
                 __symbols.push((__start, __Symbol::NtTopLevel(__nt), __end));
-                22
+                26
             }
-            45 => {
+            61 => {
                 // TopLevel = Predicate => ActionFn(2);
                 let __sym0 = __pop_NtPredicate(__symbols);
                 let __start = __sym0.0.clone();
@@ -1411,9 +1743,9 @@ mod __parse__TopLevel {
                 let __states_len = __states.len();
                 __states.truncate(__states_len - 1);
                 __symbols.push((__start, __Symbol::NtTopLevel(__nt), __end));
-                22
+                26
             }
-            46 => {
+            62 => {
                 // TopLevel = Rule, "." => ActionFn(3);
                 let __sym1 = __pop_Term_22_2e_22(__symbols);
                 let __sym0 = __pop_NtRule(__symbols);
@@ -1423,9 +1755,9 @@ mod __parse__TopLevel {
                 let __states_len = __states.len();
                 __states.truncate(__states_len - 2);
                 __symbols.push((__start, __Symbol::NtTopLevel(__nt), __end));
-                22
+                26
             }
-            47 => {
+            63 => {
                 // TopLevel = Term, "." => ActionFn(4);
                 let __sym1 = __pop_Term_22_2e_22(__symbols);
                 let __sym0 = __pop_NtTerm(__symbols);
@@ -1435,20 +1767,20 @@ mod __parse__TopLevel {
                 let __states_len = __states.len();
                 __states.truncate(__states_len - 2);
                 __symbols.push((__start, __Symbol::NtTopLevel(__nt), __end));
-                22
+                26
             }
-            48 => {
-                // Var = r#"[A-Z][A-Za-z0-9_]*"# => ActionFn(26);
+            64 => {
+                // Var = r#"[A-Z][A-Za-z0-9_]*"# => ActionFn(32);
                 let __sym0 = __pop_Termr_23_22_5bA_2dZ_5d_5bA_2dZa_2dz0_2d9___5d_2a_22_23(__symbols);
                 let __start = __sym0.0.clone();
                 let __end = __sym0.2.clone();
-                let __nt = super::__action26::<>(input, __sym0);
+                let __nt = super::__action32::<>(input, __sym0);
                 let __states_len = __states.len();
                 __states.truncate(__states_len - 1);
                 __symbols.push((__start, __Symbol::NtVar(__nt), __end));
-                23
+                27
             }
-            49 => {
+            65 => {
                 // __TopLevel = TopLevel => ActionFn(0);
                 let __sym0 = __pop_NtTopLevel(__symbols);
                 let __start = __sym0.0.clone();
@@ -1459,7 +1791,7 @@ mod __parse__TopLevel {
             _ => panic!("invalid action code {}", __action)
         };
         let __state = *__states.last().unwrap() as usize;
-        let __next_state = __GOTO[__state * 25 + __nonterminal] - 1;
+        let __next_state = __GOTO[__state * 29 + __nonterminal] - 1;
         __states.push(__next_state);
         None
     }
@@ -1573,6 +1905,16 @@ mod __parse__TopLevel {
             _ => panic!("symbol type mismatch")
         }
     }
+    fn __pop_Term_22call_22<
+      'input,
+    >(
+        __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>
+    ) -> (usize, &'input str, usize) {
+        match __symbols.pop().unwrap() {
+            (__l, __Symbol::Term_22call_22(__v), __r) => (__l, __v, __r),
+            _ => panic!("symbol type mismatch")
+        }
+    }
     fn __pop_Term_22_7c_22<
       'input,
     >(
@@ -1613,33 +1955,63 @@ mod __parse__TopLevel {
             _ => panic!("symbol type mismatch")
         }
     }
-    fn __pop_Nt_28_22_2c_22_20_3cTermOrCut_3e_29<
+    fn __pop_Nt_28_22_2c_22_20_3cBoxedTerm_3e_29<
+      'input,
+    >(
+        __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>
+    ) -> (usize, Box<Term>, usize) {
+        match __symbols.pop().unwrap() {
+            (__l, __Symbol::Nt_28_22_2c_22_20_3cBoxedTerm_3e_29(__v), __r) => (__l, __v, __r),
+            _ => panic!("symbol type mismatch")
+        }
+    }
+    fn __pop_Nt_28_22_2c_22_20_3cBoxedTerm_3e_29_2a<
+      'input,
+    >(
+        __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>
+    ) -> (usize, ::std::vec::Vec<Box<Term>>, usize) {
+        match __symbols.pop().unwrap() {
+            (__l, __Symbol::Nt_28_22_2c_22_20_3cBoxedTerm_3e_29_2a(__v), __r) => (__l, __v, __r),
+            _ => panic!("symbol type mismatch")
+        }
+    }
+    fn __pop_Nt_28_22_2c_22_20_3cBoxedTerm_3e_29_2b<
+      'input,
+    >(
+        __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>
+    ) -> (usize, ::std::vec::Vec<Box<Term>>, usize) {
+        match __symbols.pop().unwrap() {
+            (__l, __Symbol::Nt_28_22_2c_22_20_3cBoxedTerm_3e_29_2b(__v), __r) => (__l, __v, __r),
+            _ => panic!("symbol type mismatch")
+        }
+    }
+    fn __pop_Nt_28_22_2c_22_20_3cQueryTerm_3e_29<
       'input,
     >(
         __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>
-    ) -> (usize, TermOrCut, usize) {
+    ) -> (usize, QueryTerm, usize) {
         match __symbols.pop().unwrap() {
-            (__l, __Symbol::Nt_28_22_2c_22_20_3cTermOrCut_3e_29(__v), __r) => (__l, __v, __r),
+            (__l, __Symbol::Nt_28_22_2c_22_20_3cQueryTerm_3e_29(__v), __r) => (__l, __v, __r),
             _ => panic!("symbol type mismatch")
         }
     }
-    fn __pop_Nt_28_22_2c_22_20_3cTermOrCut_3e_29_2a<
+    fn __pop_Nt_28_22_2c_22_20_3cQueryTerm_3e_29_2a<
       'input,
     >(
         __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>
-    ) -> (usize, ::std::vec::Vec<TermOrCut>, usize) {
+    ) -> (usize, ::std::vec::Vec<QueryTerm>, usize) {
         match __symbols.pop().unwrap() {
-            (__l, __Symbol::Nt_28_22_2c_22_20_3cTermOrCut_3e_29_2a(__v), __r) => (__l, __v, __r),
+            (__l, __Symbol::Nt_28_22_2c_22_20_3cQueryTerm_3e_29_2a(__v), __r) => (__l, __v, __r),
             _ => panic!("symbol type mismatch")
         }
     }
-    fn __pop_Nt_28_22_2c_22_20_3cTermOrCut_3e_29_2b<
+    fn __pop_Nt_28_22_2c_22_20_3cQueryTerm_3e_29_2b<
       'input,
     >(
         __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>
-    ) -> (usize, ::std::vec::Vec<TermOrCut>, usize) {
+    ) -> (usize, ::std::vec::Vec<QueryTerm>, usize) {
         match __symbols.pop().unwrap() {
-            (__l, __Symbol::Nt_28_22_2c_22_20_3cTermOrCut_3e_29_2b(__v), __r) => (__l, __v, __r),
+            (__l, __Symbol::Nt_28_22_2c_22_20_3cQueryTerm_3e_29_2b(__v), __r) => (__l, __v, __r),
             _ => panic!("symbol type mismatch")
         }
     }
@@ -1693,33 +2065,33 @@ mod __parse__TopLevel {
             _ => panic!("symbol type mismatch")
         }
     }
-    fn __pop_Nt_28_3cTermOrCut_3e_20_22_2c_22_29<
+    fn __pop_Nt_28_3cQueryTerm_3e_20_22_2c_22_29<
       'input,
     >(
         __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>
-    ) -> (usize, TermOrCut, usize) {
+    ) -> (usize, QueryTerm, usize) {
         match __symbols.pop().unwrap() {
-            (__l, __Symbol::Nt_28_3cTermOrCut_3e_20_22_2c_22_29(__v), __r) => (__l, __v, __r),
+            (__l, __Symbol::Nt_28_3cQueryTerm_3e_20_22_2c_22_29(__v), __r) => (__l, __v, __r),
             _ => panic!("symbol type mismatch")
         }
     }
-    fn __pop_Nt_28_3cTermOrCut_3e_20_22_2c_22_29_2a<
+    fn __pop_Nt_28_3cQueryTerm_3e_20_22_2c_22_29_2a<
       'input,
     >(
         __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>
-    ) -> (usize, ::std::vec::Vec<TermOrCut>, usize) {
+    ) -> (usize, ::std::vec::Vec<QueryTerm>, usize) {
         match __symbols.pop().unwrap() {
-            (__l, __Symbol::Nt_28_3cTermOrCut_3e_20_22_2c_22_29_2a(__v), __r) => (__l, __v, __r),
+            (__l, __Symbol::Nt_28_3cQueryTerm_3e_20_22_2c_22_29_2a(__v), __r) => (__l, __v, __r),
             _ => panic!("symbol type mismatch")
         }
     }
-    fn __pop_Nt_28_3cTermOrCut_3e_20_22_2c_22_29_2b<
+    fn __pop_Nt_28_3cQueryTerm_3e_20_22_2c_22_29_2b<
       'input,
     >(
         __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>
-    ) -> (usize, ::std::vec::Vec<TermOrCut>, usize) {
+    ) -> (usize, ::std::vec::Vec<QueryTerm>, usize) {
         match __symbols.pop().unwrap() {
-            (__l, __Symbol::Nt_28_3cTermOrCut_3e_20_22_2c_22_29_2b(__v), __r) => (__l, __v, __r),
+            (__l, __Symbol::Nt_28_3cQueryTerm_3e_20_22_2c_22_29_2b(__v), __r) => (__l, __v, __r),
             _ => panic!("symbol type mismatch")
         }
     }
@@ -1743,6 +2115,16 @@ mod __parse__TopLevel {
             _ => panic!("symbol type mismatch")
         }
     }
+    fn __pop_NtCall<
+      'input,
+    >(
+        __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>
+    ) -> (usize, QueryTerm, usize) {
+        match __symbols.pop().unwrap() {
+            (__l, __Symbol::NtCall(__v), __r) => (__l, __v, __r),
+            _ => panic!("symbol type mismatch")
+        }
+    }
     fn __pop_NtClause<
       'input,
     >(
@@ -1797,39 +2179,39 @@ mod __parse__TopLevel {
       'input,
     >(
         __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>
-    ) -> (usize, Vec<TermOrCut>, usize) {
+    ) -> (usize, Vec<QueryTerm>, usize) {
         match __symbols.pop().unwrap() {
             (__l, __Symbol::NtQuery(__v), __r) => (__l, __v, __r),
             _ => panic!("symbol type mismatch")
         }
     }
-    fn __pop_NtRule<
+    fn __pop_NtQueryTerm<
       'input,
     >(
         __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>
-    ) -> (usize, Rule, usize) {
+    ) -> (usize, QueryTerm, usize) {
         match __symbols.pop().unwrap() {
-            (__l, __Symbol::NtRule(__v), __r) => (__l, __v, __r),
+            (__l, __Symbol::NtQueryTerm(__v), __r) => (__l, __v, __r),
             _ => panic!("symbol type mismatch")
         }
     }
-    fn __pop_NtTerm<
+    fn __pop_NtRule<
       'input,
     >(
         __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>
-    ) -> (usize, Term, usize) {
+    ) -> (usize, Rule, usize) {
         match __symbols.pop().unwrap() {
-            (__l, __Symbol::NtTerm(__v), __r) => (__l, __v, __r),
+            (__l, __Symbol::NtRule(__v), __r) => (__l, __v, __r),
             _ => panic!("symbol type mismatch")
         }
     }
-    fn __pop_NtTermOrCut<
+    fn __pop_NtTerm<
       'input,
     >(
         __symbols: &mut ::std::vec::Vec<(usize,__Symbol<'input>,usize)>
-    ) -> (usize, TermOrCut, usize) {
+    ) -> (usize, Term, usize) {
         match __symbols.pop().unwrap() {
-            (__l, __Symbol::NtTermOrCut(__v), __r) => (__l, __v, __r),
+            (__l, __Symbol::NtTerm(__v), __r) => (__l, __v, __r),
             _ => panic!("symbol type mismatch")
         }
     }
@@ -1915,7 +2297,7 @@ mod __intern_token {
                             continue;
                         }
                         65 ... 90 => {
-                            __current_match = Some((12, __index + __ch.len_utf8()));
+                            __current_match = Some((13, __index + __ch.len_utf8()));
                             __current_state = 8;
                             continue;
                         }
@@ -1934,16 +2316,26 @@ mod __intern_token {
                             __current_state = 11;
                             continue;
                         }
-                        97 ... 122 => {
-                            __current_match = Some((13, __index + __ch.len_utf8()));
+                        97 ... 98 => {
+                            __current_match = Some((14, __index + __ch.len_utf8()));
                             __current_state = 12;
                             continue;
                         }
-                        124 => /* '|' */ {
-                            __current_match = Some((11, __index + 1));
+                        99 => /* 'c' */ {
+                            __current_match = Some((14, __index + 1));
                             __current_state = 13;
                             continue;
                         }
+                        100 ... 122 => {
+                            __current_match = Some((14, __index + __ch.len_utf8()));
+                            __current_state = 12;
+                            continue;
+                        }
+                        124 => /* '|' */ {
+                            __current_match = Some((12, __index + 1));
+                            __current_state = 14;
+                            continue;
+                        }
                         _ => {
                             return __current_match;
                         }
@@ -1994,7 +2386,7 @@ mod __intern_token {
                     match __ch as u32 {
                         45 => /* '-' */ {
                             __current_match = Some((5, __index + 1));
-                            __current_state = 15;
+                            __current_state = 16;
                             continue;
                         }
                         _ => {
@@ -2007,7 +2399,7 @@ mod __intern_token {
                     match __ch as u32 {
                         45 => /* '-' */ {
                             __current_match = Some((6, __index + 1));
-                            __current_state = 16;
+                            __current_state = 17;
                             continue;
                         }
                         _ => {
@@ -2019,23 +2411,23 @@ mod __intern_token {
                     let (__index, __ch) = match __chars.next() { Some(p) => p, None => return __current_match };
                     match __ch as u32 {
                         48 ... 57 => {
-                            __current_match = Some((12, __index + __ch.len_utf8()));
-                            __current_state = 17;
+                            __current_match = Some((13, __index + __ch.len_utf8()));
+                            __current_state = 18;
                             continue;
                         }
                         65 ... 90 => {
-                            __current_match = Some((12, __index + __ch.len_utf8()));
-                            __current_state = 17;
+                            __current_match = Some((13, __index + __ch.len_utf8()));
+                            __current_state = 18;
                             continue;
                         }
                         95 => /* '_' */ {
-                            __current_match = Some((12, __index + 1));
-                            __current_state = 17;
+                            __current_match = Some((13, __index + 1));
+                            __current_state = 18;
                             continue;
                         }
                         97 ... 122 => {
-                            __current_match = Some((12, __index + __ch.len_utf8()));
-                            __current_state = 17;
+                            __current_match = Some((13, __index + __ch.len_utf8()));
+                            __current_state = 18;
                             continue;
                         }
                         _ => {
@@ -2048,7 +2440,7 @@ mod __intern_token {
                     match __ch as u32 {
                         93 => /* ']' */ {
                             __current_match = Some((8, __index + 1));
-                            __current_state = 18;
+                            __current_state = 19;
                             continue;
                         }
                         _ => {
@@ -2076,23 +2468,23 @@ mod __intern_token {
                     let (__index, __ch) = match __chars.next() { Some(p) => p, None => return __current_match };
                     match __ch as u32 {
                         48 ... 57 => {
-                            __current_match = Some((13, __index + __ch.len_utf8()));
-                            __current_state = 19;
+                            __current_match = Some((14, __index + __ch.len_utf8()));
+                            __current_state = 20;
                             continue;
                         }
                         65 ... 90 => {
-                            __current_match = Some((13, __index + __ch.len_utf8()));
-                            __current_state = 19;
+                            __current_match = Some((14, __index + __ch.len_utf8()));
+                            __current_state = 20;
                             continue;
                         }
                         95 => /* '_' */ {
-                            __current_match = Some((13, __index + 1));
-                            __current_state = 19;
+                            __current_match = Some((14, __index + 1));
+                            __current_state = 20;
                             continue;
                         }
                         97 ... 122 => {
-                            __current_match = Some((13, __index + __ch.len_utf8()));
-                            __current_state = 19;
+                            __current_match = Some((14, __index + __ch.len_utf8()));
+                            __current_state = 20;
                             continue;
                         }
                         _ => {
@@ -2103,6 +2495,31 @@ mod __intern_token {
                 13 => {
                     let (__index, __ch) = match __chars.next() { Some(p) => p, None => return __current_match };
                     match __ch as u32 {
+                        48 ... 57 => {
+                            __current_match = Some((14, __index + __ch.len_utf8()));
+                            __current_state = 20;
+                            continue;
+                        }
+                        65 ... 90 => {
+                            __current_match = Some((14, __index + __ch.len_utf8()));
+                            __current_state = 20;
+                            continue;
+                        }
+                        95 => /* '_' */ {
+                            __current_match = Some((14, __index + 1));
+                            __current_state = 20;
+                            continue;
+                        }
+                        97 => /* 'a' */ {
+                            __current_match = Some((14, __index + 1));
+                            __current_state = 21;
+                            continue;
+                        }
+                        98 ... 122 => {
+                            __current_match = Some((14, __index + __ch.len_utf8()));
+                            __current_state = 20;
+                            continue;
+                        }
                         _ => {
                             return __current_match;
                         }
@@ -2133,26 +2550,34 @@ mod __intern_token {
                     }
                 }
                 17 => {
+                    let (__index, __ch) = match __chars.next() { Some(p) => p, None => return __current_match };
+                    match __ch as u32 {
+                        _ => {
+                            return __current_match;
+                        }
+                    }
+                }
+                18 => {
                     let (__index, __ch) = match __chars.next() { Some(p) => p, None => return __current_match };
                     match __ch as u32 {
                         48 ... 57 => {
-                            __current_match = Some((12, __index + __ch.len_utf8()));
-                            __current_state = 17;
+                            __current_match = Some((13, __index + __ch.len_utf8()));
+                            __current_state = 18;
                             continue;
                         }
                         65 ... 90 => {
-                            __current_match = Some((12, __index + __ch.len_utf8()));
-                            __current_state = 17;
+                            __current_match = Some((13, __index + __ch.len_utf8()));
+                            __current_state = 18;
                             continue;
                         }
                         95 => /* '_' */ {
-                            __current_match = Some((12, __index + 1));
-                            __current_state = 17;
+                            __current_match = Some((13, __index + 1));
+                            __current_state = 18;
                             continue;
                         }
                         97 ... 122 => {
-                            __current_match = Some((12, __index + __ch.len_utf8()));
-                            __current_state = 17;
+                            __current_match = Some((13, __index + __ch.len_utf8()));
+                            __current_state = 18;
                             continue;
                         }
                         _ => {
@@ -2160,7 +2585,7 @@ mod __intern_token {
                         }
                     }
                 }
-                18 => {
+                19 => {
                     let (__index, __ch) = match __chars.next() { Some(p) => p, None => return __current_match };
                     match __ch as u32 {
                         _ => {
@@ -2168,27 +2593,27 @@ mod __intern_token {
                         }
                     }
                 }
-                19 => {
+                20 => {
                     let (__index, __ch) = match __chars.next() { Some(p) => p, None => return __current_match };
                     match __ch as u32 {
                         48 ... 57 => {
-                            __current_match = Some((13, __index + __ch.len_utf8()));
-                            __current_state = 19;
+                            __current_match = Some((14, __index + __ch.len_utf8()));
+                            __current_state = 20;
                             continue;
                         }
                         65 ... 90 => {
-                            __current_match = Some((13, __index + __ch.len_utf8()));
-                            __current_state = 19;
+                            __current_match = Some((14, __index + __ch.len_utf8()));
+                            __current_state = 20;
                             continue;
                         }
                         95 => /* '_' */ {
-                            __current_match = Some((13, __index + 1));
-                            __current_state = 19;
+                            __current_match = Some((14, __index + 1));
+                            __current_state = 20;
                             continue;
                         }
                         97 ... 122 => {
-                            __current_match = Some((13, __index + __ch.len_utf8()));
-                            __current_state = 19;
+                            __current_match = Some((14, __index + __ch.len_utf8()));
+                            __current_state = 20;
                             continue;
                         }
                         _ => {
@@ -2196,34 +2621,138 @@ mod __intern_token {
                         }
                     }
                 }
-                _ => { panic!("invalid state {}", __current_state); }
-            }
-        }
-    }
-
-    impl<'input> __Matcher<'input> {
-        pub fn new(s: &'input str) -> __Matcher<'input> {
-            __Matcher { text: s, consumed: 0 }
-        }
-    }
-
-    impl<'input> Iterator for __Matcher<'input> {
-        type Item = Result<(usize, (usize, &'input str), usize), __lalrpop_util::ParseError<usize,(usize, &'input str),()>>;
-
-        fn next(&mut self) -> Option<Self::Item> {
-            let __text = self.text.trim_left();
-            let __whitespace = self.text.len() - __text.len();
-            let __start_offset = self.consumed + __whitespace;
-            if __text.is_empty() {
-                self.text = __text;
-                self.consumed = __start_offset;
-                None
-            } else {
-                match __tokenize(__text) {
-                    Some((__index, __length)) => {
-                        let __result = &__text[..__length];
-                        let __remaining = &__text[__length..];
-                        let __end_offset = __start_offset + __length;
+                21 => {
+                    let (__index, __ch) = match __chars.next() { Some(p) => p, None => return __current_match };
+                    match __ch as u32 {
+                        48 ... 57 => {
+                            __current_match = Some((14, __index + __ch.len_utf8()));
+                            __current_state = 20;
+                            continue;
+                        }
+                        65 ... 90 => {
+                            __current_match = Some((14, __index + __ch.len_utf8()));
+                            __current_state = 20;
+                            continue;
+                        }
+                        95 => /* '_' */ {
+                            __current_match = Some((14, __index + 1));
+                            __current_state = 20;
+                            continue;
+                        }
+                        97 ... 107 => {
+                            __current_match = Some((14, __index + __ch.len_utf8()));
+                            __current_state = 20;
+                            continue;
+                        }
+                        108 => /* 'l' */ {
+                            __current_match = Some((14, __index + 1));
+                            __current_state = 22;
+                            continue;
+                        }
+                        109 ... 122 => {
+                            __current_match = Some((14, __index + __ch.len_utf8()));
+                            __current_state = 20;
+                            continue;
+                        }
+                        _ => {
+                            return __current_match;
+                        }
+                    }
+                }
+                22 => {
+                    let (__index, __ch) = match __chars.next() { Some(p) => p, None => return __current_match };
+                    match __ch as u32 {
+                        48 ... 57 => {
+                            __current_match = Some((14, __index + __ch.len_utf8()));
+                            __current_state = 20;
+                            continue;
+                        }
+                        65 ... 90 => {
+                            __current_match = Some((14, __index + __ch.len_utf8()));
+                            __current_state = 20;
+                            continue;
+                        }
+                        95 => /* '_' */ {
+                            __current_match = Some((14, __index + 1));
+                            __current_state = 20;
+                            continue;
+                        }
+                        97 ... 107 => {
+                            __current_match = Some((14, __index + __ch.len_utf8()));
+                            __current_state = 20;
+                            continue;
+                        }
+                        108 => /* 'l' */ {
+                            __current_match = Some((11, __index + 1));
+                            __current_state = 23;
+                            continue;
+                        }
+                        109 ... 122 => {
+                            __current_match = Some((14, __index + __ch.len_utf8()));
+                            __current_state = 20;
+                            continue;
+                        }
+                        _ => {
+                            return __current_match;
+                        }
+                    }
+                }
+                23 => {
+                    let (__index, __ch) = match __chars.next() { Some(p) => p, None => return __current_match };
+                    match __ch as u32 {
+                        48 ... 57 => {
+                            __current_match = Some((14, __index + __ch.len_utf8()));
+                            __current_state = 20;
+                            continue;
+                        }
+                        65 ... 90 => {
+                            __current_match = Some((14, __index + __ch.len_utf8()));
+                            __current_state = 20;
+                            continue;
+                        }
+                        95 => /* '_' */ {
+                            __current_match = Some((14, __index + 1));
+                            __current_state = 20;
+                            continue;
+                        }
+                        97 ... 122 => {
+                            __current_match = Some((14, __index + __ch.len_utf8()));
+                            __current_state = 20;
+                            continue;
+                        }
+                        _ => {
+                            return __current_match;
+                        }
+                    }
+                }
+                _ => { panic!("invalid state {}", __current_state); }
+            }
+        }
+    }
+
+    impl<'input> __Matcher<'input> {
+        pub fn new(s: &'input str) -> __Matcher<'input> {
+            __Matcher { text: s, consumed: 0 }
+        }
+    }
+
+    impl<'input> Iterator for __Matcher<'input> {
+        type Item = Result<(usize, (usize, &'input str), usize), __lalrpop_util::ParseError<usize,(usize, &'input str),()>>;
+
+        fn next(&mut self) -> Option<Self::Item> {
+            let __text = self.text.trim_left();
+            let __whitespace = self.text.len() - __text.len();
+            let __start_offset = self.consumed + __whitespace;
+            if __text.is_empty() {
+                self.text = __text;
+                self.consumed = __start_offset;
+                None
+            } else {
+                match __tokenize(__text) {
+                    Some((__index, __length)) => {
+                        let __result = &__text[..__length];
+                        let __remaining = &__text[__length..];
+                        let __end_offset = __start_offset + __length;
                         self.text = __remaining;
                         self.consumed = __end_offset;
                         Some(Ok((__start_offset, (__index, __result), __end_offset)))
@@ -2254,7 +2783,7 @@ pub fn __action1<
 >(
     input: &'input str,
     (_, _, _): (usize, &'input str, usize),
-    (_, q, _): (usize, Vec<TermOrCut>, usize),
+    (_, q, _): (usize, Vec<QueryTerm>, usize),
     (_, _, _): (usize, &'input str, usize),
 ) -> TopLevel
 {
@@ -2321,6 +2850,63 @@ pub fn __action6<
 #[allow(unused_variables)]
 pub fn __action7<
     'input,
+>(
+    input: &'input str,
+    (_, _, _): (usize, &'input str, usize),
+    (_, _, _): (usize, &'input str, usize),
+    (_, a, _): (usize, Atom, usize),
+    (_, _, _): (usize, &'input str, usize),
+    (_, ts, _): (usize, ::std::vec::Vec<Box<Term>>, usize),
+    (_, t, _): (usize, Box<Term>, usize),
+    (_, _, _): (usize, &'input str, usize),
+    (_, tss, _): (usize, ::std::vec::Vec<Box<Term>>, usize),
+    (_, _, _): (usize, &'input str, usize),
+) -> QueryTerm
+{
+    {
+        let mut ts  = ts;
+        let mut tss = tss;
+
+       ts.push(t);
+
+        ts.append(&mut tss);
+        QueryTerm::Term(Term::Clause(Cell::default(), a, ts))
+    }
+}
+
+#[allow(unused_variables)]
+pub fn __action8<
+    'input,
+>(
+    input: &'input str,
+    (_, _, _): (usize, &'input str, usize),
+    (_, _, _): (usize, &'input str, usize),
+    (_, a, _): (usize, Atom, usize),
+    (_, ts, _): (usize, ::std::vec::Vec<Box<Term>>, usize),
+    (_, _, _): (usize, &'input str, usize),
+) -> QueryTerm
+{
+    QueryTerm::Term(Term::Clause(Cell::default(), a, ts))
+}
+
+#[allow(unused_variables)]
+pub fn __action9<
+    'input,
+>(
+    input: &'input str,
+    (_, _, _): (usize, &'input str, usize),
+    (_, _, _): (usize, &'input str, usize),
+    (_, v, _): (usize, Var, usize),
+    (_, ts, _): (usize, ::std::vec::Vec<Box<Term>>, usize),
+    (_, _, _): (usize, &'input str, usize),
+) -> QueryTerm
+{
+    QueryTerm::CallN(Cell::default(), v, ts)
+}
+
+#[allow(unused_variables)]
+pub fn __action10<
+    'input,
 >(
     input: &'input str,
     (_, a, _): (usize, Atom, usize),
@@ -2338,7 +2924,7 @@ pub fn __action7<
 }
 
 #[allow(unused_variables)]
-pub fn __action8<
+pub fn __action11<
     'input,
 >(
     input: &'input str,
@@ -2349,7 +2935,7 @@ pub fn __action8<
 }
 
 #[allow(unused_variables)]
-pub fn __action9<
+pub fn __action12<
     'input,
 >(
     input: &'input str,
@@ -2362,7 +2948,7 @@ pub fn __action9<
 }
 
 #[allow(unused_variables)]
-pub fn __action10<
+pub fn __action13<
     'input,
 >(
     input: &'input str,
@@ -2376,7 +2962,7 @@ pub fn __action10<
 }
 
 #[allow(unused_variables)]
-pub fn __action11<
+pub fn __action14<
     'input,
 >(
     input: &'input str,
@@ -2391,7 +2977,7 @@ pub fn __action11<
 }
 
 #[allow(unused_variables)]
-pub fn __action12<
+pub fn __action15<
     'input,
 >(
     input: &'input str,
@@ -2404,7 +2990,7 @@ pub fn __action12<
 }
 
 #[allow(unused_variables)]
-pub fn __action13<
+pub fn __action16<
     'input,
 >(
     input: &'input str,
@@ -2420,7 +3006,7 @@ pub fn __action13<
 }
 
 #[allow(unused_variables)]
-pub fn __action14<
+pub fn __action17<
     'input,
 >(
     input: &'input str,
@@ -2432,7 +3018,7 @@ pub fn __action14<
 }
 
 #[allow(unused_variables)]
-pub fn __action15<
+pub fn __action18<
     'input,
 >(
     input: &'input str,
@@ -2444,13 +3030,13 @@ pub fn __action15<
 }
 
 #[allow(unused_variables)]
-pub fn __action16<
+pub fn __action19<
     'input,
 >(
     input: &'input str,
-    (_, tcs, _): (usize, ::std::vec::Vec<TermOrCut>, usize),
-    (_, tc, _): (usize, TermOrCut, usize),
-) -> Vec<TermOrCut>
+    (_, tcs, _): (usize, ::std::vec::Vec<QueryTerm>, usize),
+    (_, tc, _): (usize, QueryTerm, usize),
+) -> Vec<QueryTerm>
 {
     {
         let mut tcs = tcs;
@@ -2460,28 +3046,28 @@ pub fn __action16<
 }
 
 #[allow(unused_variables)]
-pub fn __action17<
+pub fn __action20<
     'input,
 >(
     input: &'input str,
     (_, c, _): (usize, Term, usize),
     (_, _, _): (usize, &'input str, usize),
-    (_, h, _): (usize, TermOrCut, usize),
-    (_, cs, _): (usize, ::std::vec::Vec<TermOrCut>, usize),
+    (_, h, _): (usize, QueryTerm, usize),
+    (_, cs, _): (usize, ::std::vec::Vec<QueryTerm>, usize),
 ) -> Rule
 {
     Rule { head: (c, h), clauses: cs }
 }
 
 #[allow(unused_variables)]
-pub fn __action18<
+pub fn __action21<
     'input,
 >(
     input: &'input str,
     (_, a, _): (usize, Atom, usize),
     (_, _, _): (usize, &'input str, usize),
-    (_, h, _): (usize, TermOrCut, usize),
-    (_, cs, _): (usize, ::std::vec::Vec<TermOrCut>, usize),
+    (_, h, _): (usize, QueryTerm, usize),
+    (_, cs, _): (usize, ::std::vec::Vec<QueryTerm>, usize),
 ) -> Rule
 {
     Rule { head: (Term::Constant(Cell::default(), Constant::Atom(a)),
@@ -2490,29 +3076,62 @@ pub fn __action18<
 }
 
 #[allow(unused_variables)]
-pub fn __action19<
+pub fn __action22<
+    'input,
+>(
+    input: &'input str,
+    (_, __0, _): (usize, QueryTerm, usize),
+) -> QueryTerm
+{
+    __0
+}
+
+#[allow(unused_variables)]
+pub fn __action23<
     'input,
 >(
     input: &'input str,
     (_, __0, _): (usize, &'input str, usize),
-) -> TermOrCut
+) -> QueryTerm
 {
-    TermOrCut::Cut
+    QueryTerm::Cut
 }
 
 #[allow(unused_variables)]
-pub fn __action20<
+pub fn __action24<
+    'input,
+>(
+    input: &'input str,
+    (_, __0, _): (usize, Var, usize),
+) -> QueryTerm
+{
+    QueryTerm::CallN(Cell::default(), __0, Vec::new())
+}
+
+#[allow(unused_variables)]
+pub fn __action25<
     'input,
 >(
     input: &'input str,
     (_, __0, _): (usize, Term, usize),
-) -> TermOrCut
+) -> QueryTerm
 {
-    TermOrCut::Term(__0)
+    QueryTerm::Term(__0)
 }
 
 #[allow(unused_variables)]
-pub fn __action21<
+pub fn __action26<
+    'input,
+>(
+    input: &'input str,
+    (_, __0, _): (usize, Atom, usize),
+) -> QueryTerm
+{
+    QueryTerm::Term(Term::Constant(Cell::default(), Constant::Atom(__0)))
+}
+
+#[allow(unused_variables)]
+pub fn __action27<
     'input,
 >(
     input: &'input str,
@@ -2523,7 +3142,7 @@ pub fn __action21<
 }
 
 #[allow(unused_variables)]
-pub fn __action22<
+pub fn __action28<
     'input,
 >(
     input: &'input str,
@@ -2534,7 +3153,7 @@ pub fn __action22<
 }
 
 #[allow(unused_variables)]
-pub fn __action23<
+pub fn __action29<
     'input,
 >(
     input: &'input str,
@@ -2545,7 +3164,7 @@ pub fn __action23<
 }
 
 #[allow(unused_variables)]
-pub fn __action24<
+pub fn __action30<
     'input,
 >(
     input: &'input str,
@@ -2556,7 +3175,7 @@ pub fn __action24<
 }
 
 #[allow(unused_variables)]
-pub fn __action25<
+pub fn __action31<
     'input,
 >(
     input: &'input str,
@@ -2567,7 +3186,7 @@ pub fn __action25<
 }
 
 #[allow(unused_variables)]
-pub fn __action26<
+pub fn __action32<
     'input,
 >(
     input: &'input str,
@@ -2578,77 +3197,77 @@ pub fn __action26<
 }
 
 #[allow(unused_variables)]
-pub fn __action27<
+pub fn __action33<
     'input,
 >(
     input: &'input str,
     __lookbehind: &usize,
     __lookahead: &usize,
-) -> ::std::vec::Vec<TermOrCut>
+) -> ::std::vec::Vec<QueryTerm>
 {
     vec![]
 }
 
 #[allow(unused_variables)]
-pub fn __action28<
+pub fn __action34<
     'input,
 >(
     input: &'input str,
-    (_, v, _): (usize, ::std::vec::Vec<TermOrCut>, usize),
-) -> ::std::vec::Vec<TermOrCut>
+    (_, v, _): (usize, ::std::vec::Vec<QueryTerm>, usize),
+) -> ::std::vec::Vec<QueryTerm>
 {
     v
 }
 
 #[allow(unused_variables)]
-pub fn __action29<
+pub fn __action35<
     'input,
 >(
     input: &'input str,
     (_, _, _): (usize, &'input str, usize),
-    (_, __0, _): (usize, TermOrCut, usize),
-) -> TermOrCut
+    (_, __0, _): (usize, QueryTerm, usize),
+) -> QueryTerm
 {
     (__0)
 }
 
 #[allow(unused_variables)]
-pub fn __action30<
+pub fn __action36<
     'input,
 >(
     input: &'input str,
     __lookbehind: &usize,
     __lookahead: &usize,
-) -> ::std::vec::Vec<TermOrCut>
+) -> ::std::vec::Vec<QueryTerm>
 {
     vec![]
 }
 
 #[allow(unused_variables)]
-pub fn __action31<
+pub fn __action37<
     'input,
 >(
     input: &'input str,
-    (_, v, _): (usize, ::std::vec::Vec<TermOrCut>, usize),
-) -> ::std::vec::Vec<TermOrCut>
+    (_, v, _): (usize, ::std::vec::Vec<QueryTerm>, usize),
+) -> ::std::vec::Vec<QueryTerm>
 {
     v
 }
 
 #[allow(unused_variables)]
-pub fn __action32<
+pub fn __action38<
     'input,
 >(
     input: &'input str,
-    (_, __0, _): (usize, TermOrCut, usize),
+    (_, __0, _): (usize, QueryTerm, usize),
     (_, _, _): (usize, &'input str, usize),
-) -> TermOrCut
+) -> QueryTerm
 {
     (__0)
 }
 
 #[allow(unused_variables)]
-pub fn __action33<
+pub fn __action39<
     'input,
 >(
     input: &'input str,
@@ -2659,7 +3278,7 @@ pub fn __action33<
 }
 
 #[allow(unused_variables)]
-pub fn __action34<
+pub fn __action40<
     'input,
 >(
     input: &'input str,
@@ -2671,7 +3290,7 @@ pub fn __action34<
 }
 
 #[allow(unused_variables)]
-pub fn __action35<
+pub fn __action41<
     'input,
 >(
     input: &'input str,
@@ -2682,7 +3301,7 @@ pub fn __action35<
 }
 
 #[allow(unused_variables)]
-pub fn __action36<
+pub fn __action42<
     'input,
 >(
     input: &'input str,
@@ -2694,7 +3313,7 @@ pub fn __action36<
 }
 
 #[allow(unused_variables)]
-pub fn __action37<
+pub fn __action43<
     'input,
 >(
     input: &'input str,
@@ -2705,128 +3324,186 @@ pub fn __action37<
 }
 
 #[allow(unused_variables)]
-pub fn __action38<
+pub fn __action44<
     'input,
 >(
     input: &'input str,
-    (_, __0, _): (usize, Box<Term>, usize),
     (_, _, _): (usize, &'input str, usize),
+    (_, __0, _): (usize, Box<Term>, usize),
 ) -> Box<Term>
 {
     (__0)
 }
 
 #[allow(unused_variables)]
-pub fn __action39<
+pub fn __action45<
     'input,
 >(
     input: &'input str,
-    (_, __0, _): (usize, Box<Term>, usize),
+    __lookbehind: &usize,
+    __lookahead: &usize,
 ) -> ::std::vec::Vec<Box<Term>>
 {
-    vec![__0]
+    vec![]
 }
 
 #[allow(unused_variables)]
-pub fn __action40<
+pub fn __action46<
     'input,
 >(
     input: &'input str,
     (_, v, _): (usize, ::std::vec::Vec<Box<Term>>, usize),
-    (_, e, _): (usize, Box<Term>, usize),
 ) -> ::std::vec::Vec<Box<Term>>
 {
-    { let mut v = v; v.push(e); v }
+    v
 }
 
 #[allow(unused_variables)]
-pub fn __action41<
+pub fn __action47<
     'input,
 >(
     input: &'input str,
-    (_, __0, _): (usize, TermOrCut, usize),
-) -> ::std::vec::Vec<TermOrCut>
+    (_, __0, _): (usize, Box<Term>, usize),
+    (_, _, _): (usize, &'input str, usize),
+) -> Box<Term>
 {
-    vec![__0]
+    (__0)
 }
 
 #[allow(unused_variables)]
-pub fn __action42<
+pub fn __action48<
     'input,
 >(
     input: &'input str,
-    (_, v, _): (usize, ::std::vec::Vec<TermOrCut>, usize),
-    (_, e, _): (usize, TermOrCut, usize),
-) -> ::std::vec::Vec<TermOrCut>
+    (_, __0, _): (usize, Box<Term>, usize),
+) -> ::std::vec::Vec<Box<Term>>
 {
-    { let mut v = v; v.push(e); v }
+    vec![__0]
 }
 
 #[allow(unused_variables)]
-pub fn __action43<
+pub fn __action49<
     'input,
 >(
     input: &'input str,
-    (_, __0, _): (usize, TermOrCut, usize),
-) -> ::std::vec::Vec<TermOrCut>
-{
+    (_, v, _): (usize, ::std::vec::Vec<Box<Term>>, usize),
+    (_, e, _): (usize, Box<Term>, usize),
+) -> ::std::vec::Vec<Box<Term>>
+{
+    { let mut v = v; v.push(e); v }
+}
+
+#[allow(unused_variables)]
+pub fn __action50<
+    'input,
+>(
+    input: &'input str,
+    (_, __0, _): (usize, Box<Term>, usize),
+) -> ::std::vec::Vec<Box<Term>>
+{
     vec![__0]
 }
 
 #[allow(unused_variables)]
-pub fn __action44<
+pub fn __action51<
     'input,
 >(
     input: &'input str,
-    (_, v, _): (usize, ::std::vec::Vec<TermOrCut>, usize),
-    (_, e, _): (usize, TermOrCut, usize),
-) -> ::std::vec::Vec<TermOrCut>
+    (_, v, _): (usize, ::std::vec::Vec<Box<Term>>, usize),
+    (_, e, _): (usize, Box<Term>, usize),
+) -> ::std::vec::Vec<Box<Term>>
 {
     { let mut v = v; v.push(e); v }
 }
 
 #[allow(unused_variables)]
-pub fn __action45<
+pub fn __action52<
+    'input,
+>(
+    input: &'input str,
+    (_, __0, _): (usize, QueryTerm, usize),
+) -> ::std::vec::Vec<QueryTerm>
+{
+    vec![__0]
+}
+
+#[allow(unused_variables)]
+pub fn __action53<
+    'input,
+>(
+    input: &'input str,
+    (_, v, _): (usize, ::std::vec::Vec<QueryTerm>, usize),
+    (_, e, _): (usize, QueryTerm, usize),
+) -> ::std::vec::Vec<QueryTerm>
+{
+    { let mut v = v; v.push(e); v }
+}
+
+#[allow(unused_variables)]
+pub fn __action54<
+    'input,
+>(
+    input: &'input str,
+    (_, __0, _): (usize, QueryTerm, usize),
+) -> ::std::vec::Vec<QueryTerm>
+{
+    vec![__0]
+}
+
+#[allow(unused_variables)]
+pub fn __action55<
+    'input,
+>(
+    input: &'input str,
+    (_, v, _): (usize, ::std::vec::Vec<QueryTerm>, usize),
+    (_, e, _): (usize, QueryTerm, usize),
+) -> ::std::vec::Vec<QueryTerm>
+{
+    { let mut v = v; v.push(e); v }
+}
+
+#[allow(unused_variables)]
+pub fn __action56<
     'input,
 >(
     input: &'input str,
     __0: (usize, &'input str, usize),
-    __1: (usize, TermOrCut, usize),
-) -> ::std::vec::Vec<TermOrCut>
+    __1: (usize, Box<Term>, usize),
+) -> ::std::vec::Vec<Box<Term>>
 {
     let __start0 = __0.0.clone();
     let __end0 = __1.2.clone();
-    let __temp0 = __action29(
+    let __temp0 = __action44(
         input,
         __0,
         __1,
     );
     let __temp0 = (__start0, __temp0, __end0);
-    __action43(
+    __action50(
         input,
         __temp0,
     )
 }
 
 #[allow(unused_variables)]
-pub fn __action46<
+pub fn __action57<
     'input,
 >(
     input: &'input str,
-    __0: (usize, ::std::vec::Vec<TermOrCut>, usize),
+    __0: (usize, ::std::vec::Vec<Box<Term>>, usize),
     __1: (usize, &'input str, usize),
-    __2: (usize, TermOrCut, usize),
-) -> ::std::vec::Vec<TermOrCut>
+    __2: (usize, Box<Term>, usize),
+) -> ::std::vec::Vec<Box<Term>>
 {
     let __start0 = __1.0.clone();
     let __end0 = __2.2.clone();
-    let __temp0 = __action29(
+    let __temp0 = __action44(
         input,
         __1,
         __2,
     );
     let __temp0 = (__start0, __temp0, __end0);
-    __action44(
+    __action51(
         input,
         __0,
         __temp0,
@@ -2834,24 +3511,262 @@ pub fn __action46<
 }
 
 #[allow(unused_variables)]
-pub fn __action47<
+pub fn __action58<
+    'input,
+>(
+    input: &'input str,
+    __0: (usize, &'input str, usize),
+    __1: (usize, &'input str, usize),
+    __2: (usize, Atom, usize),
+    __3: (usize, &'input str, usize),
+    __4: (usize, ::std::vec::Vec<Box<Term>>, usize),
+    __5: (usize, Box<Term>, usize),
+    __6: (usize, &'input str, usize),
+    __7: (usize, &'input str, usize),
+) -> QueryTerm
+{
+    let __start0 = __6.2.clone();
+    let __end0 = __7.0.clone();
+    let __temp0 = __action42(
+        input,
+        &__start0,
+        &__end0,
+    );
+    let __temp0 = (__start0, __temp0, __end0);
+    __action7(
+        input,
+        __0,
+        __1,
+        __2,
+        __3,
+        __4,
+        __5,
+        __6,
+        __temp0,
+        __7,
+    )
+}
+
+#[allow(unused_variables)]
+pub fn __action59<
+    'input,
+>(
+    input: &'input str,
+    __0: (usize, &'input str, usize),
+    __1: (usize, &'input str, usize),
+    __2: (usize, Atom, usize),
+    __3: (usize, &'input str, usize),
+    __4: (usize, ::std::vec::Vec<Box<Term>>, usize),
+    __5: (usize, Box<Term>, usize),
+    __6: (usize, &'input str, usize),
+    __7: (usize, ::std::vec::Vec<Box<Term>>, usize),
+    __8: (usize, &'input str, usize),
+) -> QueryTerm
+{
+    let __start0 = __7.0.clone();
+    let __end0 = __7.2.clone();
+    let __temp0 = __action43(
+        input,
+        __7,
+    );
+    let __temp0 = (__start0, __temp0, __end0);
+    __action7(
+        input,
+        __0,
+        __1,
+        __2,
+        __3,
+        __4,
+        __5,
+        __6,
+        __temp0,
+        __8,
+    )
+}
+
+#[allow(unused_variables)]
+pub fn __action60<
+    'input,
+>(
+    input: &'input str,
+    __0: (usize, &'input str, usize),
+    __1: (usize, &'input str, usize),
+    __2: (usize, Atom, usize),
+    __3: (usize, &'input str, usize),
+) -> QueryTerm
+{
+    let __start0 = __2.2.clone();
+    let __end0 = __3.0.clone();
+    let __temp0 = __action42(
+        input,
+        &__start0,
+        &__end0,
+    );
+    let __temp0 = (__start0, __temp0, __end0);
+    __action8(
+        input,
+        __0,
+        __1,
+        __2,
+        __temp0,
+        __3,
+    )
+}
+
+#[allow(unused_variables)]
+pub fn __action61<
+    'input,
+>(
+    input: &'input str,
+    __0: (usize, &'input str, usize),
+    __1: (usize, &'input str, usize),
+    __2: (usize, Atom, usize),
+    __3: (usize, ::std::vec::Vec<Box<Term>>, usize),
+    __4: (usize, &'input str, usize),
+) -> QueryTerm
+{
+    let __start0 = __3.0.clone();
+    let __end0 = __3.2.clone();
+    let __temp0 = __action43(
+        input,
+        __3,
+    );
+    let __temp0 = (__start0, __temp0, __end0);
+    __action8(
+        input,
+        __0,
+        __1,
+        __2,
+        __temp0,
+        __4,
+    )
+}
+
+#[allow(unused_variables)]
+pub fn __action62<
+    'input,
+>(
+    input: &'input str,
+    __0: (usize, &'input str, usize),
+    __1: (usize, &'input str, usize),
+    __2: (usize, Var, usize),
+    __3: (usize, &'input str, usize),
+) -> QueryTerm
+{
+    let __start0 = __2.2.clone();
+    let __end0 = __3.0.clone();
+    let __temp0 = __action42(
+        input,
+        &__start0,
+        &__end0,
+    );
+    let __temp0 = (__start0, __temp0, __end0);
+    __action9(
+        input,
+        __0,
+        __1,
+        __2,
+        __temp0,
+        __3,
+    )
+}
+
+#[allow(unused_variables)]
+pub fn __action63<
+    'input,
+>(
+    input: &'input str,
+    __0: (usize, &'input str, usize),
+    __1: (usize, &'input str, usize),
+    __2: (usize, Var, usize),
+    __3: (usize, ::std::vec::Vec<Box<Term>>, usize),
+    __4: (usize, &'input str, usize),
+) -> QueryTerm
+{
+    let __start0 = __3.0.clone();
+    let __end0 = __3.2.clone();
+    let __temp0 = __action43(
+        input,
+        __3,
+    );
+    let __temp0 = (__start0, __temp0, __end0);
+    __action9(
+        input,
+        __0,
+        __1,
+        __2,
+        __temp0,
+        __4,
+    )
+}
+
+#[allow(unused_variables)]
+pub fn __action64<
+    'input,
+>(
+    input: &'input str,
+    __0: (usize, &'input str, usize),
+    __1: (usize, QueryTerm, usize),
+) -> ::std::vec::Vec<QueryTerm>
+{
+    let __start0 = __0.0.clone();
+    let __end0 = __1.2.clone();
+    let __temp0 = __action35(
+        input,
+        __0,
+        __1,
+    );
+    let __temp0 = (__start0, __temp0, __end0);
+    __action54(
+        input,
+        __temp0,
+    )
+}
+
+#[allow(unused_variables)]
+pub fn __action65<
+    'input,
+>(
+    input: &'input str,
+    __0: (usize, ::std::vec::Vec<QueryTerm>, usize),
+    __1: (usize, &'input str, usize),
+    __2: (usize, QueryTerm, usize),
+) -> ::std::vec::Vec<QueryTerm>
+{
+    let __start0 = __1.0.clone();
+    let __end0 = __2.2.clone();
+    let __temp0 = __action35(
+        input,
+        __1,
+        __2,
+    );
+    let __temp0 = (__start0, __temp0, __end0);
+    __action55(
+        input,
+        __0,
+        __temp0,
+    )
+}
+
+#[allow(unused_variables)]
+pub fn __action66<
     'input,
 >(
     input: &'input str,
     __0: (usize, Term, usize),
     __1: (usize, &'input str, usize),
-    __2: (usize, TermOrCut, usize),
+    __2: (usize, QueryTerm, usize),
 ) -> Rule
 {
     let __start0 = __2.2.clone();
     let __end0 = __2.2.clone();
-    let __temp0 = __action27(
+    let __temp0 = __action33(
         input,
         &__start0,
         &__end0,
     );
     let __temp0 = (__start0, __temp0, __end0);
-    __action17(
+    __action20(
         input,
         __0,
         __1,
@@ -2861,24 +3776,24 @@ pub fn __action47<
 }
 
 #[allow(unused_variables)]
-pub fn __action48<
+pub fn __action67<
     'input,
 >(
     input: &'input str,
     __0: (usize, Term, usize),
     __1: (usize, &'input str, usize),
-    __2: (usize, TermOrCut, usize),
-    __3: (usize, ::std::vec::Vec<TermOrCut>, usize),
+    __2: (usize, QueryTerm, usize),
+    __3: (usize, ::std::vec::Vec<QueryTerm>, usize),
 ) -> Rule
 {
     let __start0 = __3.0.clone();
     let __end0 = __3.2.clone();
-    let __temp0 = __action28(
+    let __temp0 = __action34(
         input,
         __3,
     );
     let __temp0 = (__start0, __temp0, __end0);
-    __action17(
+    __action20(
         input,
         __0,
         __1,
@@ -2888,24 +3803,24 @@ pub fn __action48<
 }
 
 #[allow(unused_variables)]
-pub fn __action49<
+pub fn __action68<
     'input,
 >(
     input: &'input str,
     __0: (usize, Atom, usize),
     __1: (usize, &'input str, usize),
-    __2: (usize, TermOrCut, usize),
+    __2: (usize, QueryTerm, usize),
 ) -> Rule
 {
     let __start0 = __2.2.clone();
     let __end0 = __2.2.clone();
-    let __temp0 = __action27(
+    let __temp0 = __action33(
         input,
         &__start0,
         &__end0,
     );
     let __temp0 = (__start0, __temp0, __end0);
-    __action18(
+    __action21(
         input,
         __0,
         __1,
@@ -2915,24 +3830,24 @@ pub fn __action49<
 }
 
 #[allow(unused_variables)]
-pub fn __action50<
+pub fn __action69<
     'input,
 >(
     input: &'input str,
     __0: (usize, Atom, usize),
     __1: (usize, &'input str, usize),
-    __2: (usize, TermOrCut, usize),
-    __3: (usize, ::std::vec::Vec<TermOrCut>, usize),
+    __2: (usize, QueryTerm, usize),
+    __3: (usize, ::std::vec::Vec<QueryTerm>, usize),
 ) -> Rule
 {
     let __start0 = __3.0.clone();
     let __end0 = __3.2.clone();
-    let __temp0 = __action28(
+    let __temp0 = __action34(
         input,
         __3,
     );
     let __temp0 = (__start0, __temp0, __end0);
-    __action18(
+    __action21(
         input,
         __0,
         __1,
@@ -2942,7 +3857,7 @@ pub fn __action50<
 }
 
 #[allow(unused_variables)]
-pub fn __action51<
+pub fn __action70<
     'input,
 >(
     input: &'input str,
@@ -2952,20 +3867,20 @@ pub fn __action51<
 {
     let __start0 = __0.0.clone();
     let __end0 = __1.2.clone();
-    let __temp0 = __action38(
+    let __temp0 = __action47(
         input,
         __0,
         __1,
     );
     let __temp0 = (__start0, __temp0, __end0);
-    __action39(
+    __action48(
         input,
         __temp0,
     )
 }
 
 #[allow(unused_variables)]
-pub fn __action52<
+pub fn __action71<
     'input,
 >(
     input: &'input str,
@@ -2976,13 +3891,13 @@ pub fn __action52<
 {
     let __start0 = __1.0.clone();
     let __end0 = __2.2.clone();
-    let __temp0 = __action38(
+    let __temp0 = __action47(
         input,
         __1,
         __2,
     );
     let __temp0 = (__start0, __temp0, __end0);
-    __action40(
+    __action49(
         input,
         __0,
         __temp0,
@@ -2990,7 +3905,151 @@ pub fn __action52<
 }
 
 #[allow(unused_variables)]
-pub fn __action53<
+pub fn __action72<
+    'input,
+>(
+    input: &'input str,
+    __0: (usize, &'input str, usize),
+    __1: (usize, &'input str, usize),
+    __2: (usize, Atom, usize),
+    __3: (usize, &'input str, usize),
+    __4: (usize, Box<Term>, usize),
+    __5: (usize, &'input str, usize),
+    __6: (usize, &'input str, usize),
+) -> QueryTerm
+{
+    let __start0 = __3.2.clone();
+    let __end0 = __4.0.clone();
+    let __temp0 = __action45(
+        input,
+        &__start0,
+        &__end0,
+    );
+    let __temp0 = (__start0, __temp0, __end0);
+    __action58(
+        input,
+        __0,
+        __1,
+        __2,
+        __3,
+        __temp0,
+        __4,
+        __5,
+        __6,
+    )
+}
+
+#[allow(unused_variables)]
+pub fn __action73<
+    'input,
+>(
+    input: &'input str,
+    __0: (usize, &'input str, usize),
+    __1: (usize, &'input str, usize),
+    __2: (usize, Atom, usize),
+    __3: (usize, &'input str, usize),
+    __4: (usize, ::std::vec::Vec<Box<Term>>, usize),
+    __5: (usize, Box<Term>, usize),
+    __6: (usize, &'input str, usize),
+    __7: (usize, &'input str, usize),
+) -> QueryTerm
+{
+    let __start0 = __4.0.clone();
+    let __end0 = __4.2.clone();
+    let __temp0 = __action46(
+        input,
+        __4,
+    );
+    let __temp0 = (__start0, __temp0, __end0);
+    __action58(
+        input,
+        __0,
+        __1,
+        __2,
+        __3,
+        __temp0,
+        __5,
+        __6,
+        __7,
+    )
+}
+
+#[allow(unused_variables)]
+pub fn __action74<
+    'input,
+>(
+    input: &'input str,
+    __0: (usize, &'input str, usize),
+    __1: (usize, &'input str, usize),
+    __2: (usize, Atom, usize),
+    __3: (usize, &'input str, usize),
+    __4: (usize, Box<Term>, usize),
+    __5: (usize, &'input str, usize),
+    __6: (usize, ::std::vec::Vec<Box<Term>>, usize),
+    __7: (usize, &'input str, usize),
+) -> QueryTerm
+{
+    let __start0 = __3.2.clone();
+    let __end0 = __4.0.clone();
+    let __temp0 = __action45(
+        input,
+        &__start0,
+        &__end0,
+    );
+    let __temp0 = (__start0, __temp0, __end0);
+    __action59(
+        input,
+        __0,
+        __1,
+        __2,
+        __3,
+        __temp0,
+        __4,
+        __5,
+        __6,
+        __7,
+    )
+}
+
+#[allow(unused_variables)]
+pub fn __action75<
+    'input,
+>(
+    input: &'input str,
+    __0: (usize, &'input str, usize),
+    __1: (usize, &'input str, usize),
+    __2: (usize, Atom, usize),
+    __3: (usize, &'input str, usize),
+    __4: (usize, ::std::vec::Vec<Box<Term>>, usize),
+    __5: (usize, Box<Term>, usize),
+    __6: (usize, &'input str, usize),
+    __7: (usize, ::std::vec::Vec<Box<Term>>, usize),
+    __8: (usize, &'input str, usize),
+) -> QueryTerm
+{
+    let __start0 = __4.0.clone();
+    let __end0 = __4.2.clone();
+    let __temp0 = __action46(
+        input,
+        __4,
+    );
+    let __temp0 = (__start0, __temp0, __end0);
+    __action59(
+        input,
+        __0,
+        __1,
+        __2,
+        __3,
+        __temp0,
+        __5,
+        __6,
+        __7,
+        __8,
+    )
+}
+
+#[allow(unused_variables)]
+pub fn __action76<
     'input,
 >(
     input: &'input str,
@@ -3002,13 +4061,13 @@ pub fn __action53<
 {
     let __start0 = __1.2.clone();
     let __end0 = __2.0.clone();
-    let __temp0 = __action36(
+    let __temp0 = __action45(
         input,
         &__start0,
         &__end0,
     );
     let __temp0 = (__start0, __temp0, __end0);
-    __action7(
+    __action10(
         input,
         __0,
         __1,
@@ -3019,7 +4078,7 @@ pub fn __action53<
 }
 
 #[allow(unused_variables)]
-pub fn __action54<
+pub fn __action77<
     'input,
 >(
     input: &'input str,
@@ -3032,12 +4091,12 @@ pub fn __action54<
 {
     let __start0 = __2.0.clone();
     let __end0 = __2.2.clone();
-    let __temp0 = __action37(
+    let __temp0 = __action46(
         input,
         __2,
     );
     let __temp0 = (__start0, __temp0, __end0);
-    __action7(
+    __action10(
         input,
         __0,
         __1,
@@ -3048,7 +4107,7 @@ pub fn __action54<
 }
 
 #[allow(unused_variables)]
-pub fn __action55<
+pub fn __action78<
     'input,
 >(
     input: &'input str,
@@ -3057,19 +4116,19 @@ pub fn __action55<
 {
     let __start0 = __0.0.clone();
     let __end0 = __0.2.clone();
-    let __temp0 = __action35(
+    let __temp0 = __action41(
         input,
         __0,
     );
     let __temp0 = (__start0, __temp0, __end0);
-    __action33(
+    __action39(
         input,
         __temp0,
     )
 }
 
 #[allow(unused_variables)]
-pub fn __action56<
+pub fn __action79<
     'input,
 >(
     input: &'input str,
@@ -3079,12 +4138,12 @@ pub fn __action56<
 {
     let __start0 = __1.0.clone();
     let __end0 = __1.2.clone();
-    let __temp0 = __action35(
+    let __temp0 = __action41(
         input,
         __1,
     );
     let __temp0 = (__start0, __temp0, __end0);
-    __action34(
+    __action40(
         input,
         __0,
         __temp0,
@@ -3092,47 +4151,47 @@ pub fn __action56<
 }
 
 #[allow(unused_variables)]
-pub fn __action57<
+pub fn __action80<
     'input,
 >(
     input: &'input str,
-    __0: (usize, TermOrCut, usize),
+    __0: (usize, QueryTerm, usize),
     __1: (usize, &'input str, usize),
-) -> ::std::vec::Vec<TermOrCut>
+) -> ::std::vec::Vec<QueryTerm>
 {
     let __start0 = __0.0.clone();
     let __end0 = __1.2.clone();
-    let __temp0 = __action32(
+    let __temp0 = __action38(
         input,
         __0,
         __1,
     );
     let __temp0 = (__start0, __temp0, __end0);
-    __action41(
+    __action52(
         input,
         __temp0,
     )
 }
 
 #[allow(unused_variables)]
-pub fn __action58<
+pub fn __action81<
     'input,
 >(
     input: &'input str,
-    __0: (usize, ::std::vec::Vec<TermOrCut>, usize),
-    __1: (usize, TermOrCut, usize),
+    __0: (usize, ::std::vec::Vec<QueryTerm>, usize),
+    __1: (usize, QueryTerm, usize),
     __2: (usize, &'input str, usize),
-) -> ::std::vec::Vec<TermOrCut>
+) -> ::std::vec::Vec<QueryTerm>
 {
     let __start0 = __1.0.clone();
     let __end0 = __2.2.clone();
-    let __temp0 = __action32(
+    let __temp0 = __action38(
         input,
         __1,
         __2,
     );
     let __temp0 = (__start0, __temp0, __end0);
-    __action42(
+    __action53(
         input,
         __0,
         __temp0,
@@ -3140,22 +4199,22 @@ pub fn __action58<
 }
 
 #[allow(unused_variables)]
-pub fn __action59<
+pub fn __action82<
     'input,
 >(
     input: &'input str,
-    __0: (usize, TermOrCut, usize),
-) -> Vec<TermOrCut>
+    __0: (usize, QueryTerm, usize),
+) -> Vec<QueryTerm>
 {
     let __start0 = __0.0.clone();
     let __end0 = __0.0.clone();
-    let __temp0 = __action30(
+    let __temp0 = __action36(
         input,
         &__start0,
         &__end0,
     );
     let __temp0 = (__start0, __temp0, __end0);
-    __action16(
+    __action19(
         input,
         __temp0,
         __0,
@@ -3163,22 +4222,22 @@ pub fn __action59<
 }
 
 #[allow(unused_variables)]
-pub fn __action60<
+pub fn __action83<
     'input,
 >(
     input: &'input str,
-    __0: (usize, ::std::vec::Vec<TermOrCut>, usize),
-    __1: (usize, TermOrCut, usize),
-) -> Vec<TermOrCut>
+    __0: (usize, ::std::vec::Vec<QueryTerm>, usize),
+    __1: (usize, QueryTerm, usize),
+) -> Vec<QueryTerm>
 {
     let __start0 = __0.0.clone();
     let __end0 = __0.2.clone();
-    let __temp0 = __action31(
+    let __temp0 = __action37(
         input,
         __0,
     );
     let __temp0 = (__start0, __temp0, __end0);
-    __action16(
+    __action19(
         input,
         __temp0,
         __1,
index 1bcfeb83dd8f8ff194db9b7f498c4b610157ba66..fe2974f969058a43466b30fba5dfae3b39456265 100644 (file)
@@ -9,11 +9,12 @@ pub trait CompilationTarget<'a> {
     fn to_constant(Level, Constant, RegType) -> Self;
     fn to_list(Level, RegType) -> Self;
     fn to_structure(Level, Atom, usize, RegType) -> Self;
-    
+
     fn to_void(usize) -> Self;
     fn is_void_instr(&self) -> bool;
+
     fn incr_void_instr(&mut self);
-    
+
     fn constant_subterm(Constant) -> Self;
 
     fn argument_to_variable(RegType, usize) -> Self;
@@ -56,14 +57,14 @@ impl<'a> CompilationTarget<'a> for FactInstruction {
             _ => false
         }
     }
-    
+
     fn incr_void_instr(&mut self) {
         match self {
             &mut FactInstruction::UnifyVoid(ref mut incr) => *incr += 1,
             _ => {}
         }
     }
-    
+
     fn constant_subterm(constant: Constant) -> Self {
         FactInstruction::UnifyConstant(constant)
     }
@@ -129,7 +130,7 @@ impl<'a> CompilationTarget<'a> for QueryInstruction {
             _ => {}
         }
     }
-    
+
     fn constant_subterm(constant: Constant) -> Self {
         QueryInstruction::SetConstant(constant)
     }
@@ -137,7 +138,7 @@ impl<'a> CompilationTarget<'a> for QueryInstruction {
     fn argument_to_variable(arg: RegType, val: usize) -> Self {
         QueryInstruction::PutVariable(arg, val)
     }
-    
+
     fn move_to_register(arg: RegType, val: usize) -> Self {
         QueryInstruction::GetVariable(arg, val)
     }