diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 4665699863cf0eab14f88bf9fa470616799fe938..4e3787cd2de3acedf3196856480fd7d416687584 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -25,7 +25,7 @@ tests_with_recompilation:
   script:
    - rm -f Src/COLIBRI/lib/v7/x86_64_linux/* Src/COLIBRI/simplex_ocaml.pl
   #OCaml dependencies
-   - opam depext --install dune zarith ocplib-simplex parsexp menhir fmt spelll gen
+   - opam depext --install dune zarith ocplib-simplex parsexp menhir fmt spelll gen uutf
   #OCaml compilation
    - make ECLIPSEBIN=$(pwd)/Bin/ECLIPSE_V7.0_45/
   #Bundle in bundle directory
diff --git a/Src/COLIBRI/col_solve.pl b/Src/COLIBRI/col_solve.pl
index 406d395cad46ed49c3b7b7a553b7f2d9921d6d0b..ecc8a96b0c839ac79b122bea9e2f1740baefa4fb 100644
--- a/Src/COLIBRI/col_solve.pl
+++ b/Src/COLIBRI/col_solve.pl
@@ -725,7 +725,7 @@ smt_test(TO,Size) :-
     %StrDir = "./totest/",
     %StrDir = "./AdaCore/",
 %------------------------------------------------------------------------
-    StrDir = "./QF_ABVFPLRA/20190429-UltimateAutomizerSvcomp2019/",% 6 (2) !
+    %StrDir = "./QF_ABVFPLRA/20190429-UltimateAutomizerSvcomp2019/",% 6 (2) !
     %StrDir = "./QF_ABVFPLRA/20170501-Heizmann-UltimateAutomizer/",% 0 (0)
 %--------------------------------------------------------------------------
     %StrDir = "./QF_ABVFP/20170428-Liew-KLEE/imperial_synthetic_memcpy_and_use_as_bitvector_klee.x86_64/", % 0 TO (cvc4 0)
@@ -741,7 +741,7 @@ smt_test(TO,Size) :-
     %StrDir = "./QF_ABVFP/20170428-Liew-KLEE/imperial_synthetic_count_klee_bug.x86_64/", % 9 TO! (cvc4 0)
     %StrDir = "./QF_ABVFP/20170428-Liew-KLEE/imperial_gsl_benchmarks_histogram2d_klee_bug.x86_64/", %OK
 
-    %StrDir = "./QF_ABVFP/20170428-Liew-KLEE/", % 80 TO! (177 unsupported) (cvc4 95)
+    StrDir = "./QF_ABVFP/20170428-Liew-KLEE/", % 80 TO! (177 unsupported) (cvc4 95)
     %StrDir = "./QF_ABVFP/20170501-Heizmann-UltimateAutomizer/", % 0 (cvc4 2 TO)
 
 %----------------------------------------------------------------------
@@ -911,7 +911,7 @@ smt_test0(TO,Size,StrDir) :-
           os_file_name(OF,F),
           concat_string(["cmd.exe /D /C smt_test_file ",OF," ",TO],Com)
 %      ;   concat_string(["timeout --signal=KILL --kill-after=0.1 ",TO,"s ",ECLIPSE," -b col_solve -g ",SizeM," -e \"seed(0),use_delta,setval(def_real_for_int,1)@colibri,smt_solve_test(\'",F,"\',",0,")\""],Com)),
-      ;   concat_string(["timeout --signal=KILL --kill-after=0.1 ",TO,"s ",ECLIPSE," -b col_solve -g ",SizeM," -e \"seed(0),use_delta,setval(def_real_for_int,1)@colibri,setval(step_limit,3000),smt_solve_get_stat(\'",F,"\')\""],Com)),
+      ;   concat_string(["timeout --signal=KILL --kill-after=0.1 ",TO,"s ",ECLIPSE," -b col_solve -g ",SizeM," -e \"seed(0),use_delta,setval(def_real_for_int,1)@colibri,setval(step_limit,0),smt_solve_get_stat(\'",F,"\')\""],Com)),
 
 %;          concat_string(["timeout --signal=KILL --kill-after=0.1 ",TO,"s cvc4 ",F],Com)),
       exec(Com,[],Pid),
@@ -984,7 +984,7 @@ smt_unit_test(TO) :-
     %StrDir = "./smtlib_schanda-master/nyxbrain/",
     %StrDir = "./smtlib_schanda-master/spark_2014/",
 %------------------------------------------------------------------------
-    StrDir = "./QF_ABVFPLRA/20190429-UltimateAutomizerSvcomp2019/",% 2-3 (4)
+    %StrDir = "./QF_ABVFPLRA/20190429-UltimateAutomizerSvcomp2019/",% 2-3 (4)
     %StrDir = "./QF_ABVFPLRA/20170501-Heizmann-UltimateAutomizer/",% 0-1 (0)
 %------------------------------------------------------------------------
     %StrDir = "./QF_ABVFP/20170428-Liew-KLEE/", % 79 TO (cvc4 76)
@@ -1017,7 +1017,7 @@ smt_unit_test(TO) :-
     %StrDir = "./QF_FP/ramalho/",% 6-2 T0
     %StrDir = "./QF_FP/griggio/", % 59 TO en 24s, 51 en 60s (cvc4 90 en 60s)
     %StrDir = "./QF_FP/schanda/spark/",% 7 TO
-    %StrDir = "./QF_FP/wintersteiger/", % 0 TO
+    StrDir = "./QF_FP/wintersteiger/", % 0 TO
 %------------------------------------------------------------------------
     %StrDir = "QF_AX/",
     %StrDir = "QF_AX/storeinv/",
diff --git a/Src/COLIBRI/lib/v5/x86_64_linux/simplex_ocaml.so b/Src/COLIBRI/lib/v5/x86_64_linux/simplex_ocaml.so
index fde074487b9d066914e0b93c9d432c57dafa99ae..cb7f97356a5c6f02a55283acea5ae9c19e55b6c7 100755
Binary files a/Src/COLIBRI/lib/v5/x86_64_linux/simplex_ocaml.so and b/Src/COLIBRI/lib/v5/x86_64_linux/simplex_ocaml.so differ
diff --git a/Src/COLIBRI/lib/v7/x86_64_linux/simplex_ocaml.so b/Src/COLIBRI/lib/v7/x86_64_linux/simplex_ocaml.so
index 16fdc117ba74b006ff012ada30899d765afe620a..ca8c498f08c6e00317f18089b2f3672b72dec9d6 100755
Binary files a/Src/COLIBRI/lib/v7/x86_64_linux/simplex_ocaml.so and b/Src/COLIBRI/lib/v7/x86_64_linux/simplex_ocaml.so differ
diff --git a/Src/COLIBRI/realarith.pl b/Src/COLIBRI/realarith.pl
index 9df57b2f98d608aa4cbe5752476fbab14b7129de..3bd2216e898ad8423e03f821cbb922a15abd2973 100755
--- a/Src/COLIBRI/realarith.pl
+++ b/Src/COLIBRI/realarith.pl
@@ -3840,24 +3840,26 @@ set_interval_box(Var,Min,Max) :-
 %% avec une autre contrainte produisant une rbox
 %% pour les memes arguments
 check_rbox_cstrs(3,Goal) :-
-	%% Arite 3
-	Goal =.. [F,Type,A0,B0,C],
-	check_rbox_rat(A0,A),
-    check_rbox_rat(B0,B),
+    % Arite 3
+    Goal =.. [F,Type,A0,B0,C],
+    check_rbox_rat(A0,A),
+    (occurs(F,(power_real,inv_power_real)) ->
+        B = B0
+    ;   check_rbox_rat(B0,B)),
     var(C),
     !,
     (occurs(F,(add_real1,mult_real1)) ->
-		number_sort(0,=<,[A,B],[NA,NB])
-	;	(NA,NB) = (A,B)),
+        number_sort(0,=<,[A,B],[NA,NB])
+    ;   (NA,NB) = (A,B)),
     Key =.. [F,Type,NA,NB],
     (check_seen_expr(Key,NC,Type) ->
         protected_unify(C,NC)
     ;   add_seen_expr(Key,C,Type)),
     make_box_rat(F,A,B,C).
 check_rbox_cstrs(2,Goal) :-
-	%% Arite 2
-	Goal =.. [F,Type,A,B],
-	var(B),
+    % Arite 2
+    Goal =.. [F,Type,A,B],
+    var(B),
     !,
     Key =.. [F,Type,A],
     (check_seen_expr(Key,NB,Type) ->
@@ -7039,7 +7041,7 @@ cast_fp_int(Type,A,B) :-
 cast_fp_int(0,Type,A,B) ?- !,
     cast_real_int(Type,A,B).
 cast_fp_int(1,Type,A,B) ?- !,
-    uninterp(cast_fp_int,[Type,A],B).
+    uninterp(cast_fp_int,cast_fp_int,[Type,A],B).
 cast_fp_int(Cond,Type,A,B) :-
     get_priority(Prio),
 	set_priority(1),
@@ -15063,162 +15065,165 @@ power_real_type(Type,A,N,B) :-
     ;   fp_power(as(A,Type),as(N,int)) $= as(B,Type)).
 
 power_real(Type,A,2,B) ?- !,
-	%% square_real est plus efficace car 
-	%% elle a une projection inverse
+    % square_real est plus efficace car 
+    % elle a une projection inverse
     ensure_not_NaN((A,B)),
     set_lazy_domain(Type,A),
-	set_lazy_domain(Type,B),
+    set_lazy_domain(Type,B),
     check_no_float_error(Type,(A,B)),
-	square_real(Type,A,B).
+    square_real(Type,A,B).
 power_real(Type,A,N,B) :-
-	integer(N),
-	N >= 0,
-	N =< 2^53,
-	mreal:set_typed_intervals(A,Type,[-1.0Inf..1.0Inf]),
-	mreal:set_typed_intervals(B,Type,[-1.0Inf..1.0Inf]),
+    integer(N),
+    N >= 0,
+    N =< 2^53,
+    mreal:set_typed_intervals(A,Type,[-1.0Inf..1.0Inf]),
+    mreal:set_typed_intervals(B,Type,[-1.0Inf..1.0Inf]),
     ensure_not_NaN((A,B)),
-	(Type == real ->
-		true
-	;	launch_float_number(A),
-		launch_float_number(B)),
-	(N == 0 ->
-		protected_unify(B = 1.0)
-	;	(N == 1 ->
-			protected_unify(A = B)
-		;	same_float_int_number_status(Type,A,B),
+    (Type == real ->
+        true
+    ;   launch_float_number(A),
+        launch_float_number(B)),
+    (N == 0 ->
+        protected_unify(B = 1.0)
+    ;   (N == 1 ->
+            protected_unify(A = B)
+        ;   same_float_int_number_status(Type,A,B),
             power_real_interval(Type,A,N,B),
-			(mod(N,2,0) ->
-				mreal:set_typed_intervals(B,Type,[0.0..1.0Inf])
-			;	true),
-			power_real1(Type,A,N,B))).
+            (mod(N,2,0) ->
+                mreal:set_typed_intervals(B,Type,[0.0..1.0Inf])
+            ;   true),
+            power_real1(Type,A,N,B))).
 
 power_real1(Type,A,N,B) :-
-	get_priority(Prio),
-	set_priority(1),
-	same_float_int_number_status(Type,A,B),
+    get_priority(Prio),
+    set_priority(1),
+    same_float_int_number_status(Type,A,B),
     power_real_bis(Type,A,N,B),
-	set_priority(Prio),
-	wake_if_other_scheduled(Prio).
+    set_priority(Prio),
+    wake_if_other_scheduled(Prio).
 
 
 power_real_bis(Type,Val1,N,Val) :-
-	save_cstr_suspensions((Val1,Val)),
-	power_real_2_args_equal(Type,Val1,N,Val,Continue0),
-	(var(Continue0) ->
-		true
-	;	check_exists_power_real(Type,Val1,N,Val),
-		check_delta_power_real_int(Type,Val1,N,Mod2,Val),
+    save_cstr_suspensions((Val1,Val)),
+    power_real_2_args_equal(Type,Val1,N,Val,Continue0),
+    (var(Continue0) ->
+        true
+    ;   check_exists_power_real(Type,Val1,N,Val),
+        check_delta_power_real_int(Type,Val1,N,Mod2,Val),
         power_real_inst(Type,Val1,N,Val,Continue0),
         check_launch_power_int(Type,Val1,N,Val,Continue0,Continue), 
-		(nonvar(Continue) ->
-			power_real_rec(Type,Val1,N,Val),
-			% Ajouter des inegalites quand c est possible ici
-			% gt_real_ineq(Type,Val,Val1),
-			check_before_susp_power_real(Type,Val1,N,Val)
-		;	true)).
+        (nonvar(Continue) ->
+            (ground((Val1,N)) ->
+                % Val rationnel ?
+                true
+            ;   power_real_rec(Type,Val1,N,Val)),
+            % Ajouter des inegalites quand c est possible ici
+            % gt_real_ineq(Type,Val,Val1),
+            check_before_susp_power_real(Type,Val1,N,Val)
+        ;   true)).
 
 check_launch_power_int(Type,A,N,B,Continue,_) :-
     var(Continue),
     !.
 check_launch_power_int(Type,A,N,B,_,Continue) :-
-	((term_variables((A,B),[_,_]),
-	  is_float_int_number(A),
-	  is_float_int_number(B),
-	  is_inside_mantissa(Type,A),
+    ((term_variables((A,B),[_,_]),
+      is_float_int_number(A),
+      is_float_int_number(B),
+      is_inside_mantissa(Type,A),
       is_inside_mantissa(Type,B))
-	->
-		cast_real_int(Type,A,IA),
-		power(IA,N,IB),
-		cast_real_int(Type,B,IB)
-	;	Continue = 1).
+    ->
+        cast_real_int(Type,A,IA),
+        power(IA,N,IB),
+        cast_real_int(Type,B,IB)
+    ;   Continue = 1).
 
 check_delta_power_real_int(Type,A,N,Mod2,B) :-
     ((Type == real,
       is_float_int_number(A),
       exists_delta_Rel(A,B,Rel,_,_))
     ->
-		(Mod2 == 0 ->
-			Rel \== '>',
-			(Rel == '>=' ->
-				%% Donc A = B et A :: [0,1]
-				mreal:set_typed_intervals(A,real,[0.0,1.0]),
-				protected_unify(A = B)
-			;	(Rel == '=<' ->
-					true
-				;	%% A <> B
-					mreal:set_typed_intervals(A,real,[-1.0Inf .. -1.0,
+        (Mod2 == 0 ->
+            Rel \== '>',
+            (Rel == '>=' ->
+                % Donc A = B et A :: [0,1]
+                mreal:set_typed_intervals(A,real,[0.0,1.0]),
+                protected_unify(A = B)
+            ;   (Rel == '=<' ->
+                    true
+                ;   % A <> B
+                    mreal:set_typed_intervals(A,real,[-1.0Inf .. -1.0,
                                                       2.0 .. 1.0Inf]),
                     mreal:set_typed_intervals(B,real,[-1.0Inf .. -1.0,
-                                                    1.0..1.0Inf])))
-		;	%% A et B de meme signe
-			(Rel == '<' ->
-				%% A > 1
-				mreal:dvar_remove_smaller(A,2.0),
-				float_of_rat(real,rtn,RMinB,MinB),
+                                                      1.0..1.0Inf])))
+        ;   % A et B de meme signe
+            (Rel == '<' ->
+                % A > 1
+                mreal:dvar_remove_smaller(A,2.0),
+                float_of_rat(real,rtn,RMinB,MinB),
                 RMinB is 2_1^N,
-				float_of_rat(real,rtn,RMinB,MinB),
+                float_of_rat(real,rtn,RMinB,MinB),
                 mreal:dvar_remove_smaller(B,MinB)
-			;	(Rel == '=<' ->
-					%% A >= -1
-					mreal:dvar_remove_smaller(A,-1.0),
-					mreal:dvar_remove_smaller(B,-1.0)
-				;	(Rel == '>' ->
-						%% A < -1
-						mreal:dvar_remove_greater(A,-2.0),
-						RMaxB is -2_1^N,
+            ;   (Rel == '=<' ->
+                    % A >= -1
+                    mreal:dvar_remove_smaller(A,-1.0),
+                    mreal:dvar_remove_smaller(B,-1.0)
+                ;   (Rel == '>' ->
+                        % A < -1
+                        mreal:dvar_remove_greater(A,-2.0),
+                        RMaxB is -2_1^N,
                         float_of_rat(real,rtp,RMaxB,MaxB),
-						mreal:dvar_remove_greater(B,MaxB)
-					;	(Rel == '>=' ->
-							%% A =< 1
-							mreal:dvar_remove_greater(A,1.0),
-							mreal:dvar_remove_greater(B,1.0)
-					;	%% Rel = '#'
-						mreal:set_typed_intervals(A,real,[-1.0Inf.. -2.0, 2.0..1.0Inf]),
-                        mreal:set_typed_intervals(B,real,[-1.0Inf.. -2.0, 2.0..1.0Inf]))))))
-	;	true).
+                        mreal:dvar_remove_greater(B,MaxB)
+                    ;   (Rel == '>=' ->
+                            % A =< 1
+                            mreal:dvar_remove_greater(A,1.0),
+                            mreal:dvar_remove_greater(B,1.0)
+                        ;   % Rel = '#'
+                            mreal:set_typed_intervals(A,real,[-1.0Inf.. -2.0, 2.0..1.0Inf]),
+                            mreal:set_typed_intervals(B,real,[-1.0Inf.. -2.0, 2.0..1.0Inf]))))))
+    ;   true).
 
 %% Val^N = Val
 power_real_2_args_equal(Type,Val,N,Val,_) ?- !,
-	(Type == real ->
+    (Type == real ->
         (mod(N,2,0) ->
             Inter = [0.0,1.0]
-        ;	Inter = [-1.0,0.0,1.0])
+        ;   Inter = [-1.0,0.0,1.0])
     ;   (mod(N,2,0) ->
             Inter = [0.0,1.0,1.0Inf]
-        ;	Inter = [-1.0Inf,-1.0,-0.0,0.0,1.0,1.0Inf])),
-	mreal:set_typed_intervals(Val,Type,Inter).
+        ;   Inter = [-1.0Inf,-1.0,-0.0,0.0,1.0,1.0Inf])),
+    mreal:set_typed_intervals(Val,Type,Inter).
 %% Val^N = -Val
 power_real_2_args_equal(Type,Val1,N,Val,Continue) :-
-	get_saved_cstr_suspensions(LSusp),
-	((member((Susp,op_real1(Type,X,Y)),LSusp),
-	  (X == Val1, Y == Val;
-	   X == Val, Y == Val1))
-	->
-		% Val1: [-1.0Inf,-1.0,-0.0], Val: [0.0,1.0,1.0Inf], N pair
-		mod(N,2,0),
+    get_saved_cstr_suspensions(LSusp),
+    ((member((Susp,op_real1(Type,X,Y)),LSusp),
+      (X == Val1, Y == Val;
+       X == Val, Y == Val1))
+    ->
+        % Val1: [-1.0Inf,-1.0,-0.0], Val: [0.0,1.0,1.0Inf], N pair
+        mod(N,2,0),
         (Type == real ->
             mreal:set_typed_intervals(Val1,real,[-1.0,0.0]),	
             mreal:set_typed_intervals(Val,real,[0.0,1.0])
         ;   mreal:set_typed_intervals(Val1,Type,[-1.0Inf,-1.0,-0.0]),	
             mreal:set_typed_intervals(Val,Type,[0.0,1.0,1.0Inf]))
-	;	Continue = 1).	
+    ;   Continue = 1).	
 
 check_exists_power_real(Type,A,N,B) :-
-	((var(A),
-	  get_saved_cstr_suspensions(LSusp),
-	  member((Susp,power_real1(Type,X,N,Y)),LSusp),
-	  ( X == A, (U1,U2) = (Y,B)
-	  ; Type == real, mod(N,2,1), var(Y),Y == B, (U1,U2) = (X,A)))
-	->
-		kill_suspension(Susp),
-		protected_unify(U1 = U2)
-	;	true).
+    ((var(A),
+      get_saved_cstr_suspensions(LSusp),
+      member((Susp,power_real1(Type,X,N,Y)),LSusp),
+      ( X == A, (U1,U2) = (Y,B)
+      ; Type == real, mod(N,2,1), var(Y),Y == B, (U1,U2) = (X,A)))
+    ->
+        kill_suspension(Susp),
+        protected_unify(U1 = U2)
+    ;   true).
 
 check_before_susp_power_real(Type,Val1,N,Val) :-
-	power_real_inst(Type,Val1,N,Val,Continue),
-	(var(Continue) ->
-		true
-	;	ndelta:disable_delta_check,
+    power_real_inst(Type,Val1,N,Val,Continue),
+    (var(Continue) ->
+        true
+    ;   ndelta:disable_delta_check,
         check_other_power_ineqs_from_res(Type,N,Val1,Val),
         ndelta:allow_delta_check,
         
@@ -15438,36 +15443,36 @@ power_real_inst(Type,Val1,N,Val,Continue) :-
 		;	Continue = 1)).
 
 power_real_rec(Type,Val1,N,Val) :-
-	mreal:dvar_domain(Val1,Dom1),
-	mreal:dvar_domain(Val,Dom),
-	power_real_rec(Type,Val1,N,Val,Dom1,Dom).
+    mreal:dvar_domain(Val1,Dom1),
+    mreal:dvar_domain(Val,Dom),
+    power_real_rec(Type,Val1,N,Val,Dom1,Dom).
 
 power_real_rec(Type,Val1,N,Val,Dom1,Dom) :-
-	%% Val = exp(Val1)
-	mreal:dom_interval(Dom1,LInter1),
-	power_real_interval_list(Type,LInter1,N,PowLInter),
-	mreal:list_to_typed_dom(Type,PowLInter,PowDom),
-	mreal:dom_intersection(Dom,PowDom,NDom,_),
-	mreal:dvar_set(Val,NDom),
-	%% Val1 ~= pow(Val,1/N)
-	mreal:dvar_domain(Val,NewDom),
-	mreal:dom_interval(NewDom,NLInter),
-	inv_power_real_interval_list(Type,NLInter,N,InvPowLInter),
-	mreal:list_to_typed_dom(Type,InvPowLInter,InvPowDom),
-	mreal:dom_intersection(Dom1,InvPowDom,NDom1,_),
-	mreal:dvar_set(Val1,NDom1),
-	mreal:dvar_domain(Val1,NewDom1),
-	% = necessaire
-	(NewDom1 = Dom1 ->
-		%% On a fini
-		true
-	;	power_real_rec(Type,Val1,N,Val,NewDom1,NewDom)).
+    % Val = exp(Val1)
+    mreal:dom_interval(Dom1,LInter1),
+    power_real_interval_list(Type,LInter1,N,PowLInter),
+    mreal:list_to_typed_dom(Type,PowLInter,PowDom),
+    mreal:dom_intersection(Dom,PowDom,NDom,_),
+    mreal:dvar_set(Val,NDom),
+    % Val1 ~= pow(Val,1/N)
+    mreal:dvar_domain(Val,NewDom),
+    mreal:dom_interval(NewDom,NLInter),
+    inv_power_real_interval_list(Type,NLInter,N,InvPowLInter),
+    mreal:list_to_typed_dom(Type,InvPowLInter,InvPowDom),
+    mreal:dom_intersection(Dom1,InvPowDom,NDom1,_),
+    mreal:dvar_set(Val1,NDom1),
+    mreal:dvar_domain(Val1,NewDom1),
+    % = necessaire
+    (NewDom1 = Dom1 ->
+        % On a fini
+        true
+    ;   power_real_rec(Type,Val1,N,Val,NewDom1,NewDom)).
 
 
 %% Typage et calcul de la projection directe
 %% Utilise aussi pour l'evaluation
 power_real_interval(A,2,B) ?- !,
-	square_real_interval(A,B).
+    square_real_interval(A,B).
 power_real_interval(A,N,B) :-
     getval(float_eval,Type)@eclipse,
     integer(N),
@@ -15484,13 +15489,13 @@ power_real_interval_type(Type,A,N,B) :-
         ;   set_lazy_domain(Type,B))).
 
 power_real_interval(_,A,0,B) ?- !,
-	protected_unify(B = 1.0).
+    protected_unify(B = 1.0).
 power_real_interval(Type,A,1,B) ?- !,
-%	set_lazy_domain(Type,A),
-	mreal:set_typed_intervals(A,Type,[-1.0Inf..1.0Inf]),
-	protected_unify(B = A).
+    % set_lazy_domain(Type,A),
+    mreal:set_typed_intervals(A,Type,[-1.0Inf..1.0Inf]),
+    protected_unify(B = A).
 power_real_interval(Type,A,N,B) :-
-	N > 1,
+    N > 1,
     ((Type == real,
       check_rbox_rat(A,RatA))
     ->
@@ -15517,56 +15522,56 @@ power_real_interval(Type,A,N,B) :-
 
 %% Pour simplif_node
 power_real_intervals(IV,N,NIV) :-
-	getval(float_eval,Type)@eclipse,
-	integer(N),
-	N >= 0,
-	N =< 2^53,
+    getval(float_eval,Type)@eclipse,
+    integer(N),
+    N >= 0,
+    N =< 2^53,
     set_lazy_domain(Tyep,NIV),
-	power_interval_real(Type,IV,N,NIV).
+    power_interval_real(Type,IV,N,NIV).
 
 
 power_real_interval_list(Type,[],N,[]).
 power_real_interval_list(Type,[I|L],N,[NI|NL]) :-
-	power_interval_real(Type,I,N,NI),
-	power_real_interval_list(Type,L,N,NL).
+    power_interval_real(Type,I,N,NI),
+    power_real_interval_list(Type,L,N,NL).
 
 power_interval_real(Type,I,N,NI) :-
-	(float(I) ->
-		power_real_value(Type,I,N,Low,High)
-	;	min_max_inter(I,Min,Max),
-		((mod(N,2,0),
-		  Min < 0.0)
-		->
-			(Max >= 0.0 ->
-				%% I AUTOUR DE 0
-				Low = 0.0,
-				norm_zero_op(Type,Min,OpMin),
-				NMax is max(OpMin,Max),
-				power_real_max(Type,NMax,N,High)
-			;	%% I NEGATIF
-				norm_zero_op(Type,Max,OpMax),
-				power_real_min(Type,OpMax,N,Low),
-				norm_zero_op(Type,Min,OpMin),
-				power_real_max(Type,OpMin,N,High))
-		;	power_real_min(Type,Min,N,Low),
-			power_real_max(Type,Max,N,High))),
-	interval_from_bounds(Low,High,NI).
+    (float(I) ->
+        power_real_value(Type,I,N,Low,High)
+    ;   min_max_inter(I,Min,Max),
+        ((mod(N,2,0),
+          Min < 0.0)
+        ->
+            (Max >= 0.0 ->
+                % I AUTOUR DE 0
+                Low = 0.0,
+                norm_zero_op(Type,Min,OpMin),
+                NMax is max(OpMin,Max),
+                power_real_max(Type,NMax,N,High)
+            ;   % I NEGATIF
+                norm_zero_op(Type,Max,OpMax),
+                power_real_min(Type,OpMax,N,Low),
+                norm_zero_op(Type,Min,OpMin),
+                power_real_max(Type,OpMin,N,High))
+        ;   power_real_min(Type,Min,N,Low),
+            power_real_max(Type,Max,N,High))),
+    interval_from_bounds(Low,High,NI).
 
 
 power_real_value(real,Val,N,L,H) :-
-	power_real_value(Val,N,L,H).
+    power_real_value(Val,N,L,H).
 power_real_value(float_double,Val,N,PVal,PVal) :-
-	pow_double(Val,N,PVal0),
-	norm_zero(float_double,PVal0,PVal).
+    pow_double(Val,N,PVal0),
+    norm_zero(float_double,PVal0,PVal).
 power_real_value(float_simple,Val,N,PVal,PVal) :-
-	pow_float(Val,N,PVal0),
-	norm_zero(float_simple,PVal0,PVal).
+    pow_float(Val,N,PVal0),
+    norm_zero(float_simple,PVal0,PVal).
 
 %% N >= 1, mode real
 power_real_value(Val,1,Val,Val) :- !.
 power_real_value(0.0,N,0.0,0.0) :- !.
 power_real_value(Val,N,L,H) :-
-	pow_real_min_max(Val,N,L,H).
+    pow_real_min_max(Val,N,L,H).
 
 pow_real_min_max(Val,N,L,H) :-
     rational(Val,RatVal),
@@ -15622,75 +15627,75 @@ power_real_max(Type,Val,N,H) :-
 
 inv_power_real_interval_list(Type,[],N,[]).
 inv_power_real_interval_list(Type,[I|L],N,NL) :-
-	inv_power_real_interval(Type,I,N,NL,ENL),
-	inv_power_real_interval_list(Type,L,N,ENL).
+    inv_power_real_interval(Type,I,N,NL,ENL),
+    inv_power_real_interval_list(Type,L,N,ENL).
 
 inv_power_real_interval(Type,Min..Max,N,L,EL) :- !,
-	(Min >= 0.0 ->
-		min_inv_power_real(Type,Min,N,Low),
-		max_inv_power_real(Type,Max,N,High),
-		(Low > High ->
-			L = EL
-		;	interval_from_bounds(Low,High,NI),
-			(mod(N,2,0) ->
-				norm_zero_op(Type,Low,OpLow),
-				norm_zero_op(Type,High,OpHigh),
-				interval_from_bounds(OpHigh,OpLow,OpNI),
-				L = [OpNI,NI|EL]
-			;	L = [NI|EL]))
-	;	% Min < 0.0
-		% N est impair car on a enleve les negatifs
-		% pour les N pairs
-		OpMin is -Min,
-		(Max < 0.0 ->
-			OpMax is -Max,
-			max_inv_power_real(Type,OpMin,N,OpLow),
-			min_inv_power_real(Type,OpMax,N,OpHigh),
-			norm_zero_op(Type,OpLow,Low),
-			norm_zero_op(Type,OpHigh,High)
-		;	% Min =< 0.0 et Max >= 0.0
-			max_inv_power_real(Type,OpMin,N,OpLow),
-			norm_zero_op(Type,OpLow,Low),
-			max_inv_power_real(Type,Max,N,High)),
-		(Low > High ->
-			L = EL
-		;	interval_from_bounds(Low,High,NI),
-			L = [NI|EL])).
+    (Min >= 0.0 ->
+        min_inv_power_real(Type,Min,N,Low),
+        max_inv_power_real(Type,Max,N,High),
+        (Low > High ->
+            L = EL
+        ;   interval_from_bounds(Low,High,NI),
+            (mod(N,2,0) ->
+                norm_zero_op(Type,Low,OpLow),
+                norm_zero_op(Type,High,OpHigh),
+                interval_from_bounds(OpHigh,OpLow,OpNI),
+                L = [OpNI,NI|EL]
+            ;   L = [NI|EL]))
+    ;   % Min < 0.0
+        % N est impair car on a enleve les negatifs
+        % pour les N pairs
+        OpMin is -Min,
+        (Max < 0.0 ->
+            OpMax is -Max,
+            max_inv_power_real(Type,OpMin,N,OpLow),
+            min_inv_power_real(Type,OpMax,N,OpHigh),
+            norm_zero_op(Type,OpLow,Low),
+            norm_zero_op(Type,OpHigh,High)
+        ;   % Min =< 0.0 et Max >= 0.0
+            max_inv_power_real(Type,OpMin,N,OpLow),
+            norm_zero_op(Type,OpLow,Low),
+            max_inv_power_real(Type,Max,N,High)),
+        (Low > High ->
+            L = EL
+        ;   interval_from_bounds(Low,High,NI),
+            L = [NI|EL])).
 
 inv_power_real_interval(Type,Val,N,L,EL) :-
-	(Val < 0.0 ->
-		% N est impair
-		OpVal is -Val,
-		min_inv_power_real(Type,OpVal,N,OpHigh),
-		max_inv_power_real(Type,OpVal,N,OpLow),
-		(OpLow < OpHigh ->
-			L = EL
-		;	norm_zero_op(Type,OpLow,Low),
-			norm_zero_op(Type,OpHigh,High),
-			interval_from_bounds(Low,High,NI),
-			L = [NI|EL])
-	;	min_inv_power_real(Type,Val,N,Low),
-		max_inv_power_real(Type,Val,N,High),
-		(Low > High ->
-			L = EL
-		;	interval_from_bounds(Low,High,NI),
-			(mod(N,2,0) ->
-				(number(NI) ->
-					norm_zero_op(Type,NI,OpNI)
-				;	norm_zero_op(Type,Low,OpLow),
-					norm_zero_op(Type,High,OpHigh),
-					interval_from_bounds(OpHigh,OpLow,OpNI)),
-				L = [OpNI,NI|EL]
-			;	L = [NI|EL]))).
+    (Val < 0.0 ->
+        % N est impair
+        OpVal is -Val,
+        min_inv_power_real(Type,OpVal,N,OpHigh),
+        max_inv_power_real(Type,OpVal,N,OpLow),
+        (OpLow < OpHigh ->
+            L = EL
+        ;   norm_zero_op(Type,OpLow,Low),
+            norm_zero_op(Type,OpHigh,High),
+            interval_from_bounds(Low,High,NI),
+            L = [NI|EL])
+    ;   min_inv_power_real(Type,Val,N,Low),
+        max_inv_power_real(Type,Val,N,High),
+        (Low > High ->
+            L = EL
+        ;   interval_from_bounds(Low,High,NI),
+            (mod(N,2,0) ->
+                (number(NI) ->
+                    norm_zero_op(Type,NI,OpNI)
+                ;   norm_zero_op(Type,Low,OpLow),
+                    norm_zero_op(Type,High,OpHigh),
+                    interval_from_bounds(OpHigh,OpLow,OpNI)),
+                L = [OpNI,NI|EL]
+            ;   L = [NI|EL]))).
 	
 
 
 inv_powN_val(float_simple,ValpN,N,InvValpN) :- !,
-	InvN is 1/N,
-	pow_float(ValpN,InvN,InvValpN).
+    InvN is 1/N,
+    pow_float(ValpN,InvN,InvValpN).
 inv_powN_val(Type,ValpN,N,InvValpN) :-
-	InvN is 1/N,
-	pow_double(ValpN,InvN,InvValpN).
+    InvN is 1/N,
+    pow_double(ValpN,InvN,InvValpN).
 
 %% Pour memoriser le resultat de check_reachable_from_power
 %% entre les appels a min_inv_power_real et max_inv_power_real
@@ -15702,190 +15707,190 @@ inv_powN_val(Type,ValpN,N,InvValpN) :-
 
 % invariant Val >= 0
 check_reachable_from_pow0(real,Val,N,Unreachable,Low,High,ValpInvN) :- !,
-	(getval(reachable_from_pow,(real,Val,N,Unreachable,Low,High,ValpInvN)) ->
-		true
-	;	inv_powN_val(real,Val,N,ValpInvN0),
-		power_real_value(real,ValpInvN0,N,LVal0,HVal0),
-		((LVal0 == Val,
-		  HVal0 == Val)
-		->
-			ValpInvN = ValpInvN0
-		;	(LVal0 >= Val ->
-				check_down_reachable_from_pow_real(ValpInvN0,Val,N,Unreachable,Low,High,ValpInvN)
-			;	% LVal0 < Val, HVal0 =< Val
-				check_up_reachable_from_pow_real(ValpInvN0,Val,N,Unreachable,Low,High,ValpInvN))),
-		setval(reachable_from_pow,(real,Val,N,Unreachable,Low,High,ValpInvN))).
+    (getval(reachable_from_pow,(real,Val,N,Unreachable,Low,High,ValpInvN)) ->
+        true
+    ;   inv_powN_val(real,Val,N,ValpInvN0),
+        power_real_value(real,ValpInvN0,N,LVal0,HVal0),
+        ((LVal0 == Val,
+          HVal0 == Val)
+        ->
+            ValpInvN = ValpInvN0
+        ;   (LVal0 >= Val ->
+                check_down_reachable_from_pow_real(ValpInvN0,Val,N,Unreachable,Low,High,ValpInvN)
+            ;   % LVal0 < Val, HVal0 =< Val
+                check_up_reachable_from_pow_real(ValpInvN0,Val,N,Unreachable,Low,High,ValpInvN))),
+        setval(reachable_from_pow,(real,Val,N,Unreachable,Low,High,ValpInvN))).
 % double ou simple
 check_reachable_from_pow0(Type,Val,N,Unreachable,Low,High,ValpInvN) :-
-	(getval(reachable_from_pow,(Type,Val,N,Unreachable,Low,High,ValpInvN)) ->
-		true
-	;	inv_powN_val(Type,Val,N,ValpInvN0),
-		power_real_value(Type,ValpInvN0,N,Val0,_),
-		(Val0 == Val ->
-			ValpInvN = ValpInvN0
-		;	(Val0 > Val ->
-				check_down_reachable_from_pow(Type,ValpInvN0,Val,N,Unreachable,Low,High,ValpInvN)
-			;	% Val0 < Val
-				check_up_reachable_from_pow(Type,ValpInvN0,Val,N,Unreachable,Low,High,ValpInvN))),
-		setval(reachable_from_pow,(Type,Val,N,Unreachable,Low,High,ValpInvN))).
+    (getval(reachable_from_pow,(Type,Val,N,Unreachable,Low,High,ValpInvN)) ->
+        true
+    ;   inv_powN_val(Type,Val,N,ValpInvN0),
+        power_real_value(Type,ValpInvN0,N,Val0,_),
+        (Val0 == Val ->
+            ValpInvN = ValpInvN0
+        ;   (Val0 > Val ->
+                check_down_reachable_from_pow(Type,ValpInvN0,Val,N,Unreachable,Low,High,ValpInvN)
+            ;   % Val0 < Val
+                check_up_reachable_from_pow(Type,ValpInvN0,Val,N,Unreachable,Low,High,ValpInvN))),
+        setval(reachable_from_pow,(Type,Val,N,Unreachable,Low,High,ValpInvN))).
 
 
 check_up_reachable_from_pow_real(ValpInvN0,Val,N,Unreachable,Low,High,ValpInvN) :- !,
-	% On cherche un End tel que pow(Start,N) =< Val et pow(End,N) > Val
-	choose_end_narrow_pow_real(ValpInvN0,4,Val,N,ValpInvN0,Start,End),
-	power_real_value(real,End,N,LEndpN,HEndpN),
-	((LEndpN == Val,
-	  HEndpN == Val)
-	->
-		ValpInvN = End
-	;	get_number_of_double_floats_between(Start,End,Nb),
-		check_up_reachable_from_pow_real(Start,End,Val,N,Nb,Unreachable,Low,High,ValpInvN)).
+    % On cherche un End tel que pow(Start,N) =< Val et pow(End,N) > Val
+    choose_end_narrow_pow_real(ValpInvN0,4,Val,N,ValpInvN0,Start,End),
+    power_real_value(real,End,N,LEndpN,HEndpN),
+    ((LEndpN == Val,
+      HEndpN == Val)
+    ->
+        ValpInvN = End
+    ;   get_number_of_double_floats_between(Start,End,Nb),
+        check_up_reachable_from_pow_real(Start,End,Val,N,Nb,Unreachable,Low,High,ValpInvN)).
 % Delta > 0, on avance en doublant la distance a chaque fois
 choose_end_narrow_pow_real(ValpInvN0,Delta,Val,N,OStart,Start,End) :-
-	get_nth_double_float_from(ValpInvN0,Delta,End0),
-	power_real_value(real,End0,N,_,HEnd0pN),
-	((End0 < 1.0Inf,
-	  HEnd0pN =< Val)
-	->
-		NDelta is 2*Delta,
-		choose_end_narrow_pow_real(ValpInvN0,NDelta,Val,N,End0,Start,End)
-	;	Start = OStart,
-		End = End0).
+    get_nth_double_float_from(ValpInvN0,Delta,End0),
+    power_real_value(real,End0,N,_,HEnd0pN),
+    ((End0 < 1.0Inf,
+      HEnd0pN =< Val)
+    ->
+        NDelta is 2*Delta,
+        choose_end_narrow_pow_real(ValpInvN0,NDelta,Val,N,End0,Start,End)
+    ;   Start = OStart,
+        End = End0).
 
 % invariant: pow(Start,N) =< Val < pow(End,N)
 check_up_reachable_from_pow_real(Start,End,Val,N,Nb,Unreachable,Low,High,ValpInvN) :- !,
-	(Nb == 2 ->
-		Try = End
-	;	Rank is (Nb-1) div 2,
-		get_nth_float_from(real,Start,Rank,Try)),
-	power_real_value(real,Try,N,LTrypN,HTrypN),
-	((LTrypN == Val,
-	  HTrypN == Val)
-	->
-		ValpInvN = Try
-	;	(HTrypN =< Val ->
-			(Nb == 2 ->
-				% Start et End sont trop petits pour atteindre Val
-				Unreachable = 1,
-				Low = End,
-				get_next_float(real,Low,High)
-			;	NNb is Nb - Rank,
-				check_up_reachable_from_pow_real(Try,End,Val,N,NNb,Unreachable,Low,High,ValpInvN))
-		;	% HTrypN > Val
-			(Nb == 2 ->
-				% Start trop petit et Try trop grand
-				Unreachable = 1,
-				Low = Start,
-				High = Try
-			;	NNb is Rank + 1,
-				check_up_reachable_from_pow_real(Start,Try,Val,N,NNb,Unreachable,Low,High,ValpInvN)))).
+    (Nb == 2 ->
+        Try = End
+    ;   Rank is (Nb-1) div 2,
+        get_nth_float_from(real,Start,Rank,Try)),
+    power_real_value(real,Try,N,LTrypN,HTrypN),
+    ((LTrypN == Val,
+      HTrypN == Val)
+    ->
+        ValpInvN = Try
+    ;   (HTrypN =< Val ->
+            (Nb == 2 ->
+                % Start et End sont trop petits pour atteindre Val
+                Unreachable = 1,
+                Low = End,
+                get_next_float(real,Low,High)
+            ;   NNb is Nb - Rank,
+                check_up_reachable_from_pow_real(Try,End,Val,N,NNb,Unreachable,Low,High,ValpInvN))
+        ;   % HTrypN > Val
+            (Nb == 2 ->
+                % Start trop petit et Try trop grand
+                Unreachable = 1,
+                Low = Start,
+                High = Try
+            ;   NNb is Rank + 1,
+                check_up_reachable_from_pow_real(Start,Try,Val,N,NNb,Unreachable,Low,High,ValpInvN)))).
 
 check_down_reachable_from_pow_real(ValpInvN0,Val,N,Unreachable,Low,High,ValpInvN) :- !,
-	choose_start_narrow_pow_real(ValpInvN0,-4,Val,N,ValpInvN0,Start,End),
-	power_real_value(real,Start,N,LStartpN,HStartpN),
-	((LStartpN == Val,
-	  HStartpN == Val)
-	->
-		ValpInvN = Start
-	;	get_number_of_double_floats_between(Start,End,Nb),
-		check_up_reachable_from_pow_real(Start,End,Val,N,Nb,Unreachable,Low,High,ValpInvN)).
+    choose_start_narrow_pow_real(ValpInvN0,-4,Val,N,ValpInvN0,Start,End),
+    power_real_value(real,Start,N,LStartpN,HStartpN),
+    ((LStartpN == Val,
+      HStartpN == Val)
+    ->
+        ValpInvN = Start
+    ;   get_number_of_double_floats_between(Start,End,Nb),
+        check_up_reachable_from_pow_real(Start,End,Val,N,Nb,Unreachable,Low,High,ValpInvN)).
 
 % Delta < 0, on recule
 choose_start_narrow_pow_real(ValpInvN0,Delta,Val,N,OEnd,Start,End) :-
-	get_nth_double_float_from(ValpInvN0,Delta,Start0),
-	power_real_value(real,Start0,N,LStart0pN,_),
-	((Start0 >= 0.0,
-	  LStart0pN >= Val)
-	->
-		NDelta is 2*Delta,
-		choose_start_narrow_pow_real(ValpInvN0,NDelta,Val,N,Start0,Start,End)
-	;	Start is max(0.0,Start0),
-		End = OEnd).
+    get_nth_double_float_from(ValpInvN0,Delta,Start0),
+    power_real_value(real,Start0,N,LStart0pN,_),
+    ((Start0 >= 0.0,
+      LStart0pN >= Val)
+    ->
+        NDelta is 2*Delta,
+        choose_start_narrow_pow_real(ValpInvN0,NDelta,Val,N,Start0,Start,End)
+    ;   Start is max(0.0,Start0),
+        End = OEnd).
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 % double ou simple
 check_up_reachable_from_pow(Type,ValpInvN0,Val,N,Unreachable,Low,High,ValpInvN) :-
-	% On cherche un End tel que pow(Start,N) < Val et pow(End,N) >= Val
-	choose_end_narrow_pow(Type,ValpInvN0,4,Val,N,ValpInvN0,Start,End),
-	power_real_value(Type,End,N,EndpN,_),
-	(EndpN == Val ->
-		ValpInvN = End
-	;	get_number_of_floats_between(Type,Start,End,Nb),
-		check_up_reachable_from_pow(Type,Start,End,Val,N,Nb,Unreachable,Low,High,ValpInvN)).
+    % On cherche un End tel que pow(Start,N) < Val et pow(End,N) >= Val
+    choose_end_narrow_pow(Type,ValpInvN0,4,Val,N,ValpInvN0,Start,End),
+    power_real_value(Type,End,N,EndpN,_),
+    (EndpN == Val ->
+        ValpInvN = End
+    ;   get_number_of_floats_between(Type,Start,End,Nb),
+        check_up_reachable_from_pow(Type,Start,End,Val,N,Nb,Unreachable,Low,High,ValpInvN)).
 
 % Delta > 0, on avance en doublant la distance a chaque fois
 choose_end_narrow_pow(Type,ValpInvN0,Delta,Val,N,OStart,Start,End) :-
-	get_nth_float_from(Type,ValpInvN0,Delta,End0),
-	power_real_value(Type,End0,N,_,HEnd0pN),
-	(HEnd0pN < Val ->
-		NDelta is 2*Delta,
-		choose_end_narrow_pow(Type,ValpInvN0,NDelta,Val,N,End0,Start,End)
-	;	Start = OStart,
-		End = End0).
+    get_nth_float_from(Type,ValpInvN0,Delta,End0),
+    power_real_value(Type,End0,N,_,HEnd0pN),
+    (HEnd0pN < Val ->
+        NDelta is 2*Delta,
+        choose_end_narrow_pow(Type,ValpInvN0,NDelta,Val,N,End0,Start,End)
+    ;   Start = OStart,
+        End = End0).
 
 % invariant: pow(Start,N) < Val < pow(End,N)
 check_up_reachable_from_pow(Type,Start,End,Val,N,Nb,Unreachable,Low,High,ValpInvN) :-
-	(Nb == 2 ->
-		Try = End
-	;	Rank is (Nb-1) div 2,
-		get_nth_float_from(Type,Start,Rank,Try)),
-	power_real_value(Type,Try,N,TrypN,_),
-	(TrypN == Val ->
-		ValpInvN = Try
-	;	(TrypN < Val ->
-			(Nb == 2 ->
-				% Start et End sont trop petits pour atteindre Val
-				Unreachable = 1,
-				Low = End,
-				get_next_float(Type,Low,High)
-			;	NNb is Nb - Rank,
-				check_up_reachable_from_pow(Type,Try,End,Val,N,NNb,Unreachable,Low,High,ValpInvN))
-		;	% TrypN > Val
-			(Nb == 2 ->
-				% Start trop petit et Try trop grand
-				Unreachable = 1,
-				Low = Start,
-				High = Try
-			;	NNb is Rank + 1,
-				check_up_reachable_from_pow(Type,Start,Try,Val,N,NNb,Unreachable,Low,High,ValpInvN)))).
+    (Nb == 2 ->
+        Try = End
+    ;   Rank is (Nb-1) div 2,
+        get_nth_float_from(Type,Start,Rank,Try)),
+    power_real_value(Type,Try,N,TrypN,_),
+    (TrypN == Val ->
+        ValpInvN = Try
+    ;	(TrypN < Val ->
+            (Nb == 2 ->
+                % Start et End sont trop petits pour atteindre Val
+                Unreachable = 1,
+                Low = End,
+                get_next_float(Type,Low,High)
+            ;   NNb is Nb - Rank,
+                check_up_reachable_from_pow(Type,Try,End,Val,N,NNb,Unreachable,Low,High,ValpInvN))
+        ;   % TrypN > Val
+            (Nb == 2 ->
+                % Start trop petit et Try trop grand
+                Unreachable = 1,
+                Low = Start,
+                High = Try
+            ;   NNb is Rank + 1,
+                check_up_reachable_from_pow(Type,Start,Try,Val,N,NNb,Unreachable,Low,High,ValpInvN)))).
 
 check_down_reachable_from_pow(Type,ValpInvN0,Val,N,Unreachable,Low,High,ValpInvN) :-
-	choose_start_narrow_pow(Type,ValpInvN0,-4,Val,N,ValpInvN0,Start,End),
-	power_real_value(Type,Start,N,StartpN,_),
-	(StartpN == Val ->
-		ValpInvN = Start
-	;	get_number_of_floats_between(Type,Start,End,Nb),
-		check_up_reachable_from_pow(Type,Start,End,Val,N,Nb,Unreachable,Low,High,ValpInvN)).
+    choose_start_narrow_pow(Type,ValpInvN0,-4,Val,N,ValpInvN0,Start,End),
+    power_real_value(Type,Start,N,StartpN,_),
+    (StartpN == Val ->
+        ValpInvN = Start
+    ;   get_number_of_floats_between(Type,Start,End,Nb),
+        check_up_reachable_from_pow(Type,Start,End,Val,N,Nb,Unreachable,Low,High,ValpInvN)).
 
 % Delta < 0, on recule
 choose_start_narrow_pow(Type,ValpInvN0,Delta,Val,N,OEnd,Start,End) :-
-	get_nth_float_from(Type,ValpInvN0,Delta,Start0),
-	power_real_value(Type,Start0,N,LStart0pN,_),
-	(LStart0pN > Val ->
-		NDelta is 2*Delta,
-		choose_start_narrow_pow(Type,ValpInvN0,NDelta,Val,N,Start0,Start,End)
-	;	Start = Start0,
-		End = OEnd).
+    get_nth_float_from(Type,ValpInvN0,Delta,Start0),
+    power_real_value(Type,Start0,N,LStart0pN,_),
+    (LStart0pN > Val ->
+        NDelta is 2*Delta,
+        choose_start_narrow_pow(Type,ValpInvN0,NDelta,Val,N,Start0,Start,End)
+    ;   Start = Start0,
+        End = OEnd).
 
 
 
 min_inv_power_real(Type,0.0,N,Min) :- !,
-	max_inv_power_real(Type,0.0,N,Max),
-	Min is -Max.
+    max_inv_power_real(Type,0.0,N,Max),
+    Min is -Max.
 min_inv_power_real(real,Val,N,Min) :- !,
-	check_reachable_from_pow0(Type,Val,N,Unreachable,Min0,_,HMin),
-	(nonvar(Unreachable) ->
-		Min = Min0
-	;	%% en real HMin est le seul a atteindre Val (Err == 0)
-		Min = HMin).
+    check_reachable_from_pow0(Type,Val,N,Unreachable,Min0,_,HMin),
+    (nonvar(Unreachable) ->
+        Min = Min0
+    ;   % en real HMin est le seul a atteindre Val (Err == 0)
+        Min = HMin).
 % double ou simple
 min_inv_power_real(Type,Val,N,Min) :-
-	check_reachable_from_pow0(Type,Val,N,Unreachable,Min0,Max0,HMin),
-	(nonvar(Unreachable) ->
-		Min = Max0
-	;	get_previous_float(Type,Val,PVal),
-		inv_powN_val(Type,PVal,N,LMin),
-		narrow_min_inv_pow(Type,Val,N,LMin,HMin,Min)).
+    check_reachable_from_pow0(Type,Val,N,Unreachable,Min0,Max0,HMin),
+    (nonvar(Unreachable) ->
+        Min = Max0
+    ;   get_previous_float(Type,Val,PVal),
+        inv_powN_val(Type,PVal,N,LMin),
+        narrow_min_inv_pow(Type,Val,N,LMin,HMin,Min)).
 
 
 
@@ -15895,78 +15900,78 @@ min_inv_power_real(Type,Val,N,Min) :-
 % pow(Val,1/N) = HMin
 % On cherche Min par dichotomie entre LMin et HMin
 narrow_min_inv_pow(Type,Val,N,LMin,HMin,Min) :-
-	(LMin >= HMin ->
-		get_previous_float(Type,HMin,NLMin)
-		% A priori pow(NLMin,1/N) < Val
-	;	NLMin = LMin),
-	get_number_of_floats_between(Type,NLMin,HMin,Num),
-	narrow_min_inv_pow(Type,Val,N,NLMin,HMin,Num,Min).
+    (LMin >= HMin ->
+        get_previous_float(Type,HMin,NLMin)
+        % A priori pow(NLMin,1/N) < Val
+    ;   NLMin = LMin),
+    get_number_of_floats_between(Type,NLMin,HMin,Num),
+    narrow_min_inv_pow(Type,Val,N,NLMin,HMin,Num,Min).
 
 narrow_min_inv_pow(Type,Val,N,LMin,HMin,Num,Min) :-
-	Rank is (Num-1) div 2,
-	get_nth_float_from(Type,LMin,Rank,Min0),
-	power_real_value(Type,Min0,N,Val0,_),
-	(Val0 == Val ->
-		(Min0 == LMin ->
-			Min = LMin
-		;	NNum is Rank + 1,
-			narrow_min_inv_pow(Type,Val,N,LMin,Min0,NNum,Min))
-	;	% Val0 < Val
-		((Num == 2,
-		  Rank == 0)
-		->
-			Min = HMin
-		;	% on ignore Min0,
-			get_next_float(Type,Min0,NLMin),
-			NNum is -1 + Num - Rank,
-			narrow_min_inv_pow(Type,Val,N,NLMin,HMin,NNum,Min))).
+    Rank is (Num-1) div 2,
+    get_nth_float_from(Type,LMin,Rank,Min0),
+    power_real_value(Type,Min0,N,Val0,_),
+    (Val0 == Val ->
+        (Min0 == LMin ->
+            Min = LMin
+        ;   NNum is Rank + 1,
+            narrow_min_inv_pow(Type,Val,N,LMin,Min0,NNum,Min))
+    ;   % Val0 < Val
+        ((Num == 2,
+          Rank == 0)
+        ->
+            Min = HMin
+        ;   % on ignore Min0,
+            get_next_float(Type,Min0,NLMin),
+            NNum is -1 + Num - Rank,
+            narrow_min_inv_pow(Type,Val,N,NLMin,HMin,NNum,Min))).
 
 
 max_inv_power_real(_,1.0Inf,N,1.0Inf) :- !.
 max_inv_power_real(real,Val,N,Max) :- !,
-	check_reachable_from_pow0(real,Val,N,Unreachable,_,Max0,LMax),
-	(nonvar(Unreachable) ->
-		Max = Max0
-	;	%% en real LMax est le seul a atteindre Val (Err == 0)
-		Max = LMax).
+    check_reachable_from_pow0(real,Val,N,Unreachable,_,Max0,LMax),
+    (nonvar(Unreachable) ->
+        Max = Max0
+    ;   % en real LMax est le seul a atteindre Val (Err == 0)
+        Max = LMax).
 % double ou simple
 max_inv_power_real(Type,Val,N,Max) :-
-	check_reachable_from_pow0(Type,Val,N,Unreachable,Min0,Max0,LMax),
-	(nonvar(Unreachable) ->
-		Max = Min0
-	;	get_next_float(Type,Val,NVal),
-		inv_powN_val(Type,NVal,N,HMax),
-		narrow_max_inv_pow(Type,Val,N,LMax,HMax,Max)).
+    check_reachable_from_pow0(Type,Val,N,Unreachable,Min0,Max0,LMax),
+    (nonvar(Unreachable) ->
+        Max = Min0
+    ;   get_next_float(Type,Val,NVal),
+        inv_powN_val(Type,NVal,N,HMax),
+        narrow_max_inv_pow(Type,Val,N,LMax,HMax,Max)).
 
 
 
 %% LMax atteint Val
 narrow_max_inv_pow(Type,Val,N,LMax,HMax,Max) :-
-	(LMax >= HMax ->
-		get_next_float(Type,LMax,NHMax)
-		% A priori pow(NHMax,N) > Val
-	;	NHMax = HMax),
-	get_number_of_floats_between(Type,LMax,NHMax,Num),
-	narrow_max_inv_pow(Type,Val,N,LMax,NHMax,Num,Max).
+    (LMax >= HMax ->
+        get_next_float(Type,LMax,NHMax)
+        % A priori pow(NHMax,N) > Val
+    ;   NHMax = HMax),
+    get_number_of_floats_between(Type,LMax,NHMax,Num),
+    narrow_max_inv_pow(Type,Val,N,LMax,NHMax,Num,Max).
 
 % double ou simple
 narrow_max_inv_pow(Type,Val,N,LMax,HMax,Num,Max) :-
-	Rank is Num div 2,
-	get_nth_float_from(Type,LMax,Rank,Max0),
-	power_real_value(Type,Max0,N,Val0,_),
-	(Val == Val0 ->
-		(Max0 == HMax ->
-			Max = Max0
-		;	NNum is Num - Rank,
-			narrow_max_inv_pow(Type,Val,N,Max0,HMax,NNum,Max))
-	;	% Val0 > Val
-		((Num == 2,
-		  Rank == 1)
-		->
-			Max = LMax
-		;	% on ignore Max0
-			get_previous_float(Type,Max0,NHMax),
-			narrow_max_inv_pow(Type,Val,N,LMax,NHMax,Rank,Max))).
+    Rank is Num div 2,
+    get_nth_float_from(Type,LMax,Rank,Max0),
+    power_real_value(Type,Max0,N,Val0,_),
+    (Val == Val0 ->
+        (Max0 == HMax ->
+            Max = Max0
+        ;   NNum is Num - Rank,
+            narrow_max_inv_pow(Type,Val,N,Max0,HMax,NNum,Max))
+    ;   % Val0 > Val
+        ((Num == 2,
+          Rank == 1)
+        ->
+            Max = LMax
+        ;   % on ignore Max0
+            get_previous_float(Type,Max0,NHMax),
+            narrow_max_inv_pow(Type,Val,N,LMax,NHMax,Rank,Max))).
 
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -17097,7 +17102,7 @@ min_real_bis(Type,A,B,C) :-
              B == -0.0)
         ->
             concat_atom([fp_min,Type],F),
-            uninterp(F,[A,B],C)
+            uninterp(F,F,[A,B],C)
         ;   set_prio_inst([A,B,C],3,4,Prio),
             my_suspend(min_real(Type,A,B,C),Prio,(A,B,C)->suspend:constrained))
     ;   true).
@@ -17364,7 +17369,7 @@ max_real_bis(Type,A,B,C) :-
              B == -0.0)
         ->
             concat_atom([fp_max,Type],F),
-            uninterp(F,[A,B],C)
+            uninterp(F,F,[A,B],C)
         ;   my_suspend(max_real(Type,A,B,C),Prio,(A,B,C) -> suspend:constrained))
     ;	true).
 
diff --git a/Src/COLIBRI/simplex_ocaml/Dockerfile b/Src/COLIBRI/simplex_ocaml/Dockerfile
index b66e9c9cdf71cfa34c8c6e70a566c9158b12117d..06a0b5faa49592c5d6da3bd57d8f5001b9e4ba9f 100644
--- a/Src/COLIBRI/simplex_ocaml/Dockerfile
+++ b/Src/COLIBRI/simplex_ocaml/Dockerfile
@@ -2,18 +2,18 @@ FROM ocaml/opam2:debian-8
 
 ENV OPAMSWITCH=4.07
 
-RUN [ "opam", "depext", "--install", "dune", "ocplib-simplex", "zarith", "parsexp", "menhir", "fmt", "spelll", "gen" ]
+RUN [ "opam", "depext", "--install", "dune", "ocplib-simplex", "zarith", "parsexp", "menhir", "fmt", "spelll", "uutf", "gen" ]
 
 ENV OPAMSWITCH=4.08
 
-RUN [ "opam", "depext", "--install", "dune", "ocplib-simplex", "zarith", "parsexp", "menhir", "fmt", "spelll", "gen" ]
+RUN [ "opam", "depext", "--install", "dune", "ocplib-simplex", "zarith", "parsexp", "menhir", "fmt", "spelll", "uutf", "gen" ]
 
 ENV OPAMSWITCH=4.09
 
-RUN [ "opam", "depext", "--install", "dune", "ocplib-simplex", "zarith", "parsexp", "menhir", "fmt", "spelll", "gen" ]
+RUN [ "opam", "depext", "--install", "dune", "ocplib-simplex", "zarith", "parsexp", "menhir", "fmt", "spelll", "uutf", "gen" ]
 
 ENV OPAMSWITCH=4.10
 
-RUN [ "opam", "depext", "--install", "dune", "ocplib-simplex", "zarith", "parsexp", "menhir", "fmt", "spelll", "gen" ]
+RUN [ "opam", "depext", "--install", "dune", "ocplib-simplex", "zarith", "parsexp", "menhir", "fmt", "spelll", "uutf", "gen" ]
 
 RUN [ "mkdir", "/home/opam/build" ]
diff --git a/Src/COLIBRI/simplex_ocaml/Makefile b/Src/COLIBRI/simplex_ocaml/Makefile
index 479e6675481d628d6690b17217fdb9decaf25cca..1df2bd3e37b54863dd174cbaf2652ec1f11fc38c 100644
--- a/Src/COLIBRI/simplex_ocaml/Makefile
+++ b/Src/COLIBRI/simplex_ocaml/Makefile
@@ -23,15 +23,15 @@ windows_32:
 
 
 docker:
-	sudo docker build - -t simplex_ocaml_build < Dockerfile
-	sudo docker run -v $(PWD)/../../..:/home/opam/build -w /home/opam/build/Src/COLIBRI/simplex_ocaml/ --env DUNE_BUILD_DIR=_build_docker simplex_ocaml_build opam exec -- make
+	docker build - -t simplex_ocaml_build < Dockerfile
+	docker run -v $(shell pwd)/../../..:/home/opam/build -w /home/opam/build/Src/COLIBRI/simplex_ocaml/ --env DUNE_BUILD_DIR=_build_docker simplex_ocaml_build opam exec -- make
 	cp _build_docker/default/simplex_ocaml.pl ..
 	cp _build_docker/default/simplex_ocaml_mod.so ../lib/v5/x86_64_linux/simplex_ocaml.so
 	cp _build_docker/default/simplex_ocaml_mod_v7.so ../lib/v7/x86_64_linux/simplex_ocaml.so
 
 test_version:
-	sudo docker build - -t simplex_ocaml_build < Dockerfile
-	sudo docker run -v $(PWD)/../../..:/home/opam/build -w /home/opam/build/Src/COLIBRI/simplex_ocaml/ --env DUNE_BUILD_DIR=_build_docker simplex_ocaml_build opam exec -- make all_version
+	docker build - -t simplex_ocaml_build < Dockerfile
+	docker run -v $(shell pwd)/../../..:/home/opam/build -w /home/opam/build/Src/COLIBRI/simplex_ocaml/ --env DUNE_BUILD_DIR=_build_docker simplex_ocaml_build opam exec -- make all_version
 
 clean:
 	dune clean
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/Makefile b/Src/COLIBRI/simplex_ocaml/dolmen/Makefile
index 3afc29c028e9d439c9fabf7653e2954d6298cf2c..705b15d002c684eeb3e5dddc929f16821a904846 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/Makefile
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/Makefile
@@ -15,9 +15,16 @@ dune:
 doc:
 	dune build $(FLAGS) @doc
 
-test:
+test: dune
+	dune exec -- tools/gentests.exe tests/
 	dune build $(FLAGS) @runtest
 
+test-promote:
+	dune exec -- tests/gentests.exe tests/
+	-dune build $(FLAGS) @runtest
+	dune promote $(FLAGS)
+
+
 clean:
 	$(COMP) clean
 
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/doc/lsp.md b/Src/COLIBRI/simplex_ocaml/dolmen/doc/lsp.md
index 6bff895627c880ee122dcce27d9263c25988e921..9442adfe711e19c3181fc870b542fe6e2f255cfc 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/doc/lsp.md
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/doc/lsp.md
@@ -17,10 +17,25 @@ Once you have opam, you can install `dolmen_lsp` with the following command:
 This will install (among other things) the dolmen lsp server in binary called
 `dolmenls` (for dolmen language server).
 
+## Demo
+
+<a href="https://asciinema.org/a/MoaXpOZJnrJDyrB5gZneuWZxd" target="_blank"><img src="https://asciinema.org/a/MoaXpOZJnrJDyrB5gZneuWZxd.svg" /></a>
+
 ## Configuration
 
 ### Vim & Neovim
 
+### 'autozimu/LanguageClient-neovim'
+
+```vim
+let g:LanguageClient_serverCommands = {
+\ 'smt2': ['dolmenls'],
+\ 'p': ['dolmenls'],
+\ 'cnf': ['dolmenls'],
+\ 'zf': ['dolmenls'],
+\ }
+```
+
 #### ALE setup
 
 ```vim
@@ -41,7 +56,7 @@ For a remote connection (replace the `'address'` field):
 for ft in ['smt2', 'tptp', 'p', 'cnf', 'icnf', 'zf']
   call ale#linter#Define(ft, {
   \   'name': 'dolmenls',
-  \   'lsp': 'socket', 
+  \   'lsp': 'socket',
   \   'address': '127.0.0.1:8854',
   \   'project_root': '.',
   \})
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/dolmen_bin.opam b/Src/COLIBRI/simplex_ocaml/dolmen/dolmen_bin.opam
index 21abc11991ed28b7a09b5ecc6c6a4056cf9529a0..0b7efea914f5d97e478324a9501efcb4b20574ac 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/dolmen_bin.opam
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/dolmen_bin.opam
@@ -15,6 +15,7 @@ depends: [
   "dolmen_loop"
   "dune"
   "fmt"
+  "cmdliner"
 ]
 tags: [ "logic" "computation" "automated theorem prover" "lsp" "language server protocol"]
 homepage: "https://github.com/Gbury/dolmen"
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/dolmen_lsp.opam b/Src/COLIBRI/simplex_ocaml/dolmen/dolmen_lsp.opam
index 8a9809370ffb8ff0cf2c745a6c09e1ac1ab8829c..9b88793de5dece4c76f6ff852f9e1ab61d501b70 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/dolmen_lsp.opam
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/dolmen_lsp.opam
@@ -17,7 +17,7 @@ depends: [
   "dune"
   "ocaml-syntax-shims"
 ]
-pin-depends: [ "lsp.dev" "git+https://github.com/ocaml/ocaml-lsp.git" ]
+pin-depends: [ "lsp.dev" "git+https://github.com/ocaml/ocaml-lsp.git#5782d1da" ]
 tags: [ "logic" "computation" "automated theorem prover" "lsp" "language server protocol"]
 homepage: "https://github.com/Gbury/dolmen"
 dev-repo: "https://github.com/Gbury/dolmen.git"
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/dune b/Src/COLIBRI/simplex_ocaml/dolmen/dune
new file mode 100644
index 0000000000000000000000000000000000000000..6c6150674f6bc11869c75bd604097292f1dee80c
--- /dev/null
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/dune
@@ -0,0 +1,3 @@
+; Ensure no inlinging takes place in dev mode to have more accurate backtraces
+(env (dev (ocamlopt_flags -g -inline 0)))
+
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/bin/dune b/Src/COLIBRI/simplex_ocaml/dolmen/src/bin/dune
index 656e055a3ef8950411a403bf85ee0d1132cdd745..3e439a4d475adece96b153d801458c013e1036e0 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/bin/dune
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/bin/dune
@@ -3,7 +3,13 @@
   (name           main)
   (public_name    dolmen)
   (package        dolmen_bin)
-  (libraries      dolmen dolmen_type dolmen_loop cmdliner fmt)
+  (libraries
+    ; external deps
+    cmdliner fmt gen
+    ; dolmen deps
+    dolmen dolmen.intf dolmen.std
+    dolmen_type dolmen_loop
+    )
 )
 
 ; Rule to generate a man page for dolmen
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/bin/errors.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/bin/errors.ml
index b25be3353f947c5d562bc6f1809df22eeafcc6dd..f0b8328a34ae9750a91921054e4aae2c23bbc7c1 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/bin/errors.ml
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/bin/errors.ml
@@ -2,13 +2,11 @@
 (* Some helper functions *)
 (* ************************************************************************ *)
 
-module State = Bin_state
-
-let prelude (st : State.t) =
+let prelude (st : Loop.State.t) =
   match st.input_lang with
   | None -> "prompt> @?"
   | Some l ->
-    Format.asprintf "(%s)# @?" (Dolmen_loop.Parser.string_of_language l)
+    Format.asprintf "(%s)# @?" (Dolmen_loop.Logic.string_of_language l)
 
 let prelude_space st =
   String.make (String.length (prelude st) - 8) ' '
@@ -16,97 +14,92 @@ let prelude_space st =
 (* Location functions *)
 (* ************************************************************************ *)
 
-let default_loc (st : State.t) =
-  Dolmen.ParseLocation.mk
-    (Options.input_to_string st.input_source) 0 0 0 0
-
-let get_loc st = function
-  | Some l -> l
-  | None -> default_loc st
-
 (* Exceptions *)
 (* ************************************************************************* *)
 
-let sigint st = State.error st "User Interrupt"
-let out_of_time st = State.error st "Time limit reached"
-let out_of_space st = State.error st "Memory limit reached"
-
 let exn st = function
+
+  (* Sigint, potentially wrapped by the typechecker *)
+  | Loop.Pipeline.Sigint
+  | Dolmen_loop.Typer.T.Typing_error (
+      Dolmen_loop.Typer.T.Error (_, _, Dolmen_loop.Typer.T.Uncaught_exn (
+          Loop.Pipeline.Sigint, _))) ->
+    Format.pp_print_flush Format.std_formatter ();
+    Loop.State.error st "User Interrupt"
+
+  (* Timeout, potentially wrapped by the typechecker *)
+  | Loop.Pipeline.Out_of_time
+  | Dolmen_loop.Typer.T.Typing_error (
+      Dolmen_loop.Typer.T.Error (_, _, Dolmen_loop.Typer.T.Uncaught_exn (
+          Loop.Pipeline.Out_of_time, _))) ->
+    Format.pp_print_flush Format.std_formatter ();
+    Loop.State.error st "Time limit reached"
+
+  | Loop.Pipeline.Out_of_space
+  | Dolmen_loop.Typer.T.Typing_error (
+      Dolmen_loop.Typer.T.Error (_, _, Dolmen_loop.Typer.T.Uncaught_exn (
+          Loop.Pipeline.Out_of_space, _))) ->
+    Format.pp_print_flush Format.std_formatter ();
+    Loop.State.error st "Memory limit reached"
+
   (* Parsing errors *)
-  | Dolmen.ParseLocation.Uncaught (loc, exn) ->
-    if Dolmen.State.is_interactive st then
-      Format.eprintf "%s%a@\n"
-        (if Dolmen.ParseLocation.(loc.start_line = 1) then prelude_space st else "")
-        Dolmen.ParseLocation.fmt_hint loc;
-    State.error st "%a:@\n%s@."
-      Dolmen.ParseLocation.fmt loc (Printexc.to_string exn)
-  | Dolmen.ParseLocation.Lexing_error (loc, msg) ->
-    if Dolmen.State.is_interactive st then
-      Format.eprintf "%s%a@\n"
-        (if Dolmen.ParseLocation.(loc.start_line = 1) then prelude_space st else "")
-        Dolmen.ParseLocation.fmt_hint loc;
-    State.error st "%a:@\nLexing error: invalid character '%s'@."
-      Dolmen.ParseLocation.fmt loc msg
-  | Dolmen.ParseLocation.Syntax_error (loc, msg) ->
-    if Dolmen.State.is_interactive st then
-      Format.eprintf "%s%a@\n"
-        (if Dolmen.ParseLocation.(loc.start_line = 1) then prelude_space st else "")
-        Dolmen.ParseLocation.fmt_hint loc;
-    State.error st "%a:@\n%s@."
-      Dolmen.ParseLocation.fmt loc
-      (match msg with "" -> "Syntax error" | x -> x)
+  | Dolmen.Std.Loc.Uncaught (loc, exn) ->
+    let file = Dolmen_loop.State.input_file_loc st in
+    Loop.State.error ~loc:{ file; loc; } st "%s" (Printexc.to_string exn)
+  | Dolmen.Std.Loc.Lexing_error (loc, lex) ->
+    let file = Dolmen_loop.State.input_file_loc st in
+    Loop.State.error ~loc:{ file; loc; } st "Lexing error: invalid character '%s'" lex
+  | Dolmen.Std.Loc.Syntax_error (loc, msg) ->
+    let file = Dolmen_loop.State.input_file_loc st in
+    Loop.State.error ~loc: { file; loc; } st "%t@." msg
+
 
   (* Typing errors *)
-  | Typer.T.Typing_error (err, _, t) ->
-    let loc = get_loc st t.Dolmen.Term.loc in
-    if Dolmen.State.is_interactive st then
-      Format.eprintf "%s%a@\n"
-        (if Dolmen.ParseLocation.(loc.start_line = 1) then prelude_space st else "")
-        Dolmen.ParseLocation.fmt_hint loc;
-    State.error st
-      "@[<hv>While typing:@ @[<hov>%a@]@]@.%a:@\n@[<hv>%a@]"
-      Dolmen.Term.print t
-      Dolmen.ParseLocation.fmt loc
-      Typer.report_error err
+  | Dolmen_loop.Typer.T.Typing_error (
+      Dolmen_loop.Typer.T.Error (env, fragment, _err) as error) ->
+    let loc = Dolmen_loop.Typer.T.fragment_loc env fragment in
+    if st.context then
+      Format.eprintf "@[<hv 2>While typing:@ @[<hov>%a@]@]@."
+        Loop.Typer.print_fragment (env, fragment);
+    Loop.State.error ~loc st "%a"
+      Loop.Typer.report_error error
 
   (* State errors *)
-  | Dolmen_loop.State.File_not_found (None, dir, f) ->
-    State.error st "File not found: '%s' in directory '%s'" f dir
-  | Dolmen_loop.State.File_not_found (Some loc, dir, f) ->
-    State.error st "@[<v>%a:@ File not found: '%s' in directory '%s'@]"
-      Dolmen.ParseLocation.fmt loc f dir
-  | Dolmen_loop.State.Missing_smtlib_logic ->
-    State.error st "Missing smtlib set-logic statement"
+  | Dolmen_loop.State.File_not_found (loc, dir, f) ->
+    if dir = "." then
+      Loop.State.error ~loc st "File not found: '%s'" f
+    else
+      Loop.State.error ~loc st "File not found: '%s' in directory '%s'" f dir
   | Dolmen_loop.State.Input_lang_changed (l, l') ->
-    State.error st "Input language changed from %s to %s (probably because of an include statement)"
-      (Dolmen_loop.Parser.string_of_language l)
-      (Dolmen_loop.Parser.string_of_language l')
+    Loop.State.error st "Input language changed from %s to %s (probably because of an include statement)"
+      (Dolmen_loop.Logic.string_of_language l)
+      (Dolmen_loop.Logic.string_of_language l')
 
   (* Internal Dolmen Expr errors *)
-  | Dolmen.Expr.Bad_ty_arity (c, l) ->
+  | Dolmen.Std.Expr.Bad_ty_arity (c, l) ->
     let pp_sep fmt () = Format.fprintf fmt ";@ " in
-    State.error st "@[<hv>Bad arity for type constant '%a', which was provided arguments:@ [@[<hv>%a@]]@]"
-      Dolmen.Expr.Print.ty_const c (Format.pp_print_list ~pp_sep Dolmen.Expr.Ty.print) l
-  | Dolmen.Expr.Bad_term_arity (c, tys, ts) ->
+    Loop.State.error st "@[<hv>Internal error: Bad arity for type constant '%a',@ which was provided arguments:@ [@[<hv>%a@]]@]"
+      Dolmen.Std.Expr.Print.ty_const c (Format.pp_print_list ~pp_sep Dolmen.Std.Expr.Ty.print) l
+  | Dolmen.Std.Expr.Bad_term_arity (c, tys, ts) ->
     let pp_sep fmt () = Format.fprintf fmt ";@ " in
-    State.error st "@[<hv>Bad arity for type constant '%a', which was provided arguments:@ [@[<hv>%a;@ %a@]]@]"
-      Dolmen.Expr.Print.term_const c
-      (Format.pp_print_list ~pp_sep Dolmen.Expr.Ty.print) tys
-      (Format.pp_print_list ~pp_sep Dolmen.Expr.Term.print) ts
-  | Dolmen.Expr.Type_already_defined c ->
-    State.error st "Type constant '%a' was already defined earlier, cannot re-define it."
-      Dolmen.Expr.Print.id c
-
-  | Dolmen.Expr.Term.Wrong_type (t, ty) ->
-    State.error st "@[<hv>A term of type@ %a@ was expected but instead got a term of type@ %a@]"
-      Dolmen.Expr.Ty.print ty Dolmen.Expr.Ty.print (Dolmen.Expr.Term.ty t)
+    Loop.State.error st "@[<hv>Internal error: Bad arity for type constant '%a',@ which was provided arguments:@ [@[<hv>%a;@ %a@]]@]"
+      Dolmen.Std.Expr.Print.term_const c
+      (Format.pp_print_list ~pp_sep Dolmen.Std.Expr.Ty.print) tys
+      (Format.pp_print_list ~pp_sep Dolmen.Std.Expr.Term.print) ts
+  | Dolmen.Std.Expr.Type_already_defined c ->
+    Loop.State.error st "@[<hv>Internal error: Type constant '%a' was already defined earlier,@ cannot re-define it.@]"
+      Dolmen.Std.Expr.Print.id c
+
+  | Dolmen.Std.Expr.Term.Wrong_type (t, ty) ->
+    Loop.State.error st "@[<hv>Internal error: A term of type@ %a@ was expected but instead got a term of type@ %a@]"
+      Dolmen.Std.Expr.Ty.print ty Dolmen.Std.Expr.Ty.print (Dolmen.Std.Expr.Term.ty t)
 
   (* File format auto-detect *)
-  | Dolmen_loop.Parser.Extension_not_found ext ->
-    State.error st "@[<hv>The following extension was not recognized: '%s'.@ %s" ext
+  | Dolmen_loop.Logic.Extension_not_found ext ->
+    Loop.State.error st "@[<hv>The following extension was not recognized: '%s'.@ %s" ext
       "Please use a recognised extension or specify an input language on the command line"
 
   (* Generic catch-all *)
-  | e -> State.error st "@[<hv>Unhandled exception:@ %s@]" (Printexc.to_string e)
+  | e -> Loop.State.error st "@[<hv>Unhandled exception:@ %s@]" (Printexc.to_string e)
 
 
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/bin/loop.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/bin/loop.ml
new file mode 100644
index 0000000000000000000000000000000000000000..c29e6d7b7cb8e738932d46b6eac846c27dba3f90
--- /dev/null
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/bin/loop.ml
@@ -0,0 +1,14 @@
+
+(* This file is free software, part of dolmen. See file "LICENSE" for more information *)
+
+module State = Dolmen_loop.State
+module Pipeline = Dolmen_loop.Pipeline.Make(State)
+
+module Parser = Dolmen_loop.Parser.Pipe(Dolmen.Std.Expr)(State)
+module Header = Dolmen_loop.Headers.Pipe(State)
+module Typer = struct
+  module T = Dolmen_loop.Typer.Make(State)
+  include T
+  include Dolmen_loop.Typer.Pipe(Dolmen.Std.Expr)(State)(T)
+end
+
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/bin/main.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/bin/main.ml
index 9bfc937c1f98c24e3866272d88d8c95d83723bba..a16a73a386a445186fd7fcd9a4d3f59eb8b8b528 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/bin/main.ml
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/bin/main.ml
@@ -1,31 +1,26 @@
 
 (* This file is free software, part of dolmen. See file "LICENSE" for more information *)
 
-module Pipeline = Dolmen_loop.Pipeline.Make(Bin_state)
-module Pipe = Dolmen_loop.Pipes.Make(Dolmen.Expr)(Bin_state)(Typer)
-
-let handle_exn st = function
-  | Pipeline.Sigint ->
-    Format.pp_print_flush Format.std_formatter ();
-    let _ = Errors.sigint st in
-    exit 1
-  | Pipeline.Out_of_time ->
-    Format.pp_print_flush Format.std_formatter ();
-    let _ = Errors.out_of_time st in
-    exit 1
-  | Pipeline.Out_of_space ->
-    Format.pp_print_flush Format.std_formatter ();
-    let _ = Errors.out_of_space st in
-    exit 1
-  | exn ->
-    let _ = Errors.exn st exn in
-    exit 1
+let handle_exn st exn =
+  if st.Loop.State.debug then
+    Format.eprintf "%a@\n%s@."
+      Loop.State.debug st
+      (Printexc.to_string exn);
+  let () = Errors.exn st exn in
+  exit 1
 
 let finally st e =
   match e with
   | None -> st
   | Some exn -> handle_exn st exn
 
+let debug_pipe st c =
+  if st.Loop.State.debug then
+    Format.eprintf "%a@\n%a@."
+      Loop.State.debug st
+      Dolmen.Std.Statement.print c;
+  st, c
+
 let () =
   let man = [
     `S Options.common_section;
@@ -40,22 +35,26 @@ let () =
   let info = Cmdliner.Term.info ~man ~version:"0.1" "dolmen" in
   let st = match Cmdliner.Term.eval (Options.state, info) with
     | `Version | `Help -> exit 0
-    | `Error `Parse | `Error `Term | `Error `Exn -> exit 1
+    | `Error `Parse | `Error `Term | `Error `Exn -> exit 2
     | `Ok opt -> opt
   in
   let st, g =
-    try Pipe.parse [] st
+    try Loop.Parser.parse [] st
     with exn -> handle_exn st exn
   in
-  let _st =
-    let open Pipeline in
+  let st =
+    let open Loop.Pipeline in
     run ~finally g st (
-      (fix (apply ~name:"expand" Pipe.expand) (
-          (apply ~name:"typecheck" Pipe.typecheck)
-          @>|> ((apply fst) @>>> _end)
+      (fix (op ~name:"expand" Loop.Parser.expand) (
+          (op ~name:"debug" debug_pipe)
+          @>>> (op ~name:"headers" Loop.Header.inspect)
+          @>>> (op ~name:"typecheck" Loop.Typer.typecheck)
+          @>|> (op (fun st _ -> st, ())) @>>> _end
         )
       )
     )
   in
+  let st = Loop.Header.check st in
+  let _st = Dolmen_loop.State.flush st () in
   ()
 
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/bin/options.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/bin/options.ml
index 9b95ba1341f6c210ae98e12f12e10980724bed4e..cd098a631ae56ba5283bffd240e0eac695215998 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/bin/options.ml
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/bin/options.ml
@@ -31,7 +31,10 @@ let mk_state
     gc gc_opt bt colors
     time_limit size_limit
     input_lang input_mode input
-    type_check type_infer type_shadow
+    header_check header_licenses
+    header_lang_version
+    type_check type_strict
+    debug context max_warn
   =
   (* Side-effects *)
   let () = Gc.set gc_opt in
@@ -43,19 +46,27 @@ let mk_state
   let () = if gc then at_exit (fun () -> Gc.print_stat stdout;) in
   (* State creation *)
   let input_dir, input_source = split_input input in
-  let st : Bin_state.t = {
+  let st : Loop.State.t = {
+    debug;
+
+    context; max_warn;
+    cur_warn = 0;
+
     time_limit; size_limit;
 
     input_dir; input_lang;
     input_mode; input_source;
+    input_file_loc = Dolmen.Std.Loc.mk_file "";
+
+    header_check; header_licenses; header_lang_version;
+    header_state = Dolmen_loop.Headers.empty;
 
-    type_state = Typer.T.new_state ();
-    type_check; type_infer; type_shadow;
-    type_smtlib_logic = None;
+    type_check; type_strict;
+    type_state = Dolmen_loop.Typer.new_state ();
 
     solve_state = ();
 
-    export_lang = None;
+    export_lang = [];
   } in
   st
 
@@ -63,7 +74,7 @@ let mk_state
 (* ************************************************************************* *)
 
 (* Converter for input formats/languages *)
-let input_format_conv = Arg.enum Dolmen_loop.Parser.enum
+let input_format_conv = Arg.enum Dolmen_loop.Logic.enum
 
 (* Converter for input file/stdin *)
 let input_to_string = function
@@ -78,9 +89,9 @@ let input_source_conv =
 
 (* Converter for permissions *)
 let perm_conv = Arg.enum [
-    "allow", Dolmen.State.Allow;
-    "warn", Dolmen.State.Warn;
-    "error", Dolmen.State.Error;
+    "allow", Dolmen_loop.State.Allow;
+    "warn", Dolmen_loop.State.Warn;
+    "error", Dolmen_loop.State.Error;
   ]
 
 (* Converter for input modes *)
@@ -89,6 +100,22 @@ let mode_conv = Arg.enum [
     "incremental", `Incremental;
   ]
 
+(* Output converters *)
+(* ************************************************************************* *)
+
+let output_to_string = function
+  | `Stdout -> "<stdout>"
+  | `File f -> f
+
+let parse_output = function
+  | "stdout" -> Ok `Stdout
+  | f -> Ok (`File f)
+
+let output_conv =
+  let print fmt o = Format.fprintf fmt "%s" (output_to_string o) in
+  Arg.conv (parse_output, print)
+
+
 (* Argument converter for integer with multiplier suffix *)
 (* ************************************************************************ *)
 
@@ -224,7 +251,7 @@ let state =
   let in_lang =
     let doc = Format.asprintf
         "Set the input language to $(docv) (%s)."
-        (Arg.doc_alts_enum ~quoted:false Dolmen_loop.Parser.enum) in
+        (Arg.doc_alts_enum ~quoted:false Dolmen_loop.Logic.enum) in
     Arg.(value & opt (some input_format_conv) None & info ["i"; "input"; "lang"] ~docv:"INPUT" ~doc ~docs)
   in
   let in_mode =
@@ -239,22 +266,57 @@ let state =
                dolmen will enter interactive mode and read on stdin." in
     Arg.(value & pos 0 input_source_conv `Stdin & info [] ~docv:"FILE" ~doc)
   in
+  let header_check =
+    let doc = "If true, then the presence of headers will be checked in the
+               input file (and errors raised if they are not present)." in
+    Arg.(value & opt bool false & info ["check-headers"] ~doc ~docs)
+  in
+  let header_licenses =
+    let doc = "Set the allowed set of licenses in the headers.
+               An empty list means allow everything." in
+    Arg.(value & opt (list string) [] & info ["header-licenses"] ~doc ~docs)
+  in
+  let header_lang_version =
+    let doc = "Set the only allowed language version for headers. If not set,
+               all conforming version numbers are allowed." in
+    Arg.(value & opt (some string) None & info ["header-lang-version"] ~docs ~doc)
+  in
   let typing =
     let doc = "Decide whether to type-check input expressions. If false, only parsing
                is done. " in
     Arg.(value & opt bool true & info ["type"] ~doc ~docs)
   in
-  let infer =
+  let strict =
+    let doc = "Be strict or more lenient wrt to typing" in
+    Arg.(value & opt bool true & info ["strict"] ~doc ~docs)
+  in
+  (*
+  let locs =
+    let doc = "Whether to keep location information during typing. \
+               Setting this to true results in better warning/error \
+               messages, but will use more memory when running." in
+    Arg.(value & opt bool true & info ["locs"] ~doc ~docs)
+  in
+  *)
+  let debug =
+    let doc = Format.asprintf
+        "Print the parsed dolmen statement (after expansion of includes)" in
+    Arg.(value & flag & info ["debug"] ~docs ~doc)
+  in
+  let context =
     let doc = Format.asprintf
-        "Decide the permissions for type inference" in
-    Arg.(value & opt (some perm_conv) None & info ["infer"] ~docs ~doc)
+        "Print the context / fragment of parsed AST with errors" in
+    Arg.(value & flag & info ["context"] ~docs ~doc)
   in
-  let shadow =
+  let max_warn =
     let doc = Format.asprintf
-        "Decide the permissions for shadowing of symbols" in
-    Arg.(value & opt (some perm_conv) None & info ["shadow"] ~doc ~docs)
+        "Maximum number of warnings to display (excess warnings will be
+         counted and a count of silenced warnings reported at the end)." in
+    Arg.(value & opt int max_int & info ["max-warn"] ~docs ~doc)
   in
   Term.(const mk_state $ gc $ gc_t $ bt $ colors $
-        time $ size $ in_lang $ in_mode $ input $ typing $ infer $ shadow)
+        time $ size $ in_lang $ in_mode $ input $
+        header_check $ header_licenses $ header_lang_version $
+        typing $ strict $ debug $ context $ max_warn)
 
 
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/classes/dune b/Src/COLIBRI/simplex_ocaml/dolmen/src/classes/dune
index 4f4d2f8880f0b51ad029c26e43f478353e2a21b1..bf0895106ae86198c88cba80cad638736de3d8a2 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/classes/dune
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/classes/dune
@@ -2,9 +2,16 @@
 (library
   (name            dolmen_class)
   (public_name     dolmen.class)
-  (libraries       dolmen_intf dolmen_std
-                   dolmen_ae dolmen_dimacs dolmen_icnf
-                   dolmen_smtlib2 dolmen_tptp dolmen_zf
-                   menhirLib)
+  (libraries
+    ;
+    dolmen_intf dolmen_std
+    ; Languages without versions
+    dolmen_ae dolmen_dimacs dolmen_icnf dolmen_zf
+    ; Smtlib2 & versions
+    dolmen_smtlib2 dolmen_smtlib2_v6
+    ; TPTP & versions
+    dolmen_tptp dolmen_tptp_v6_3_0
+    ; Menhir deps
+    menhirLib)
   (modules Logic)
 )
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/classes/logic.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/classes/logic.ml
index 04edfdbc088f595e68a01af3fc2f3e54bbb0df02..bc119b16e305c09dd2923025ccda2ec2c2035b98 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/classes/logic.ml
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/classes/logic.ml
@@ -23,6 +23,9 @@ module type S = sig
   val parse_file :
     ?language:language ->
     string -> language * statement list
+  val parse_file_lazy :
+    ?language:language ->
+    string -> language * statement list Lazy.t
 
   val parse_input :
     ?language:language ->
@@ -128,12 +131,21 @@ module Make
       P.find ~dir file
 
   let parse_file ?language file =
-    let l, _, (module P : S) = match language with
+    let l, _, (module P : S) =
+      match language with
       | None -> of_filename file
       | Some l -> of_language l
     in
     l, P.parse_file file
 
+  let parse_file_lazy ?language file =
+    let l, _, (module P : S) =
+      match language with
+      | None -> of_filename file
+      | Some l -> of_language l
+    in
+    l, lazy (P.parse_file file)
+
   let parse_input ?language = function
     | `File file ->
       let l, _, (module P : S) =
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/classes/logic.mli b/Src/COLIBRI/simplex_ocaml/dolmen/src/classes/logic.mli
index 6f3b42f9f89ab311f6cff6ef31070b515281aa8a..58dc407bf9724ebd7a5ecdfd56351b051440d070 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/classes/logic.mli
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/classes/logic.mli
@@ -50,6 +50,13 @@ module type S = sig
       together with the list of statements parsed.
       @param language specify a language; overrides auto-detection. *)
 
+  val parse_file_lazy :
+    ?language:language ->
+    string -> language * statement list Lazy.t
+  (** Given a filename, parse the file, and return the detected language
+      together with the list of statements parsed.
+      @param language specify a language; overrides auto-detection. *)
+
   val parse_input :
     ?language:language ->
     [< `File of string
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/dolmen.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/dolmen.ml
index 413b733a7a70125b3512d5790f1149d7ea8d1370..13a5f03aee5814440b771de1304b05e1fd897a85 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/dolmen.ml
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/dolmen.ml
@@ -1,35 +1,17 @@
 
-module Intf = struct
-  module Lex = Dolmen_intf.Lex
-  module Parse = Dolmen_intf.Parse
-  module Location = Dolmen_intf.Location
-  module Id = Dolmen_intf.Id
-  module Ty = Dolmen_intf.Type
-  module Tag = Dolmen_intf.Tag
-  module Term = Dolmen_intf.Term
-  module Stmt = Dolmen_intf.Stmt
-  module Language = Dolmen_intf.Language
-end
-
-module State = Dolmen_std.State
-module Misc = Dolmen_std.Misc
-module Id = Dolmen_std.Id
-module Tag = Dolmen_std.Tag
-module Term = Dolmen_std.Term
-module Expr = Dolmen_std.Expr
-module Statement = Dolmen_std.Statement
-module Normalize = Dolmen_std.Normalize
-module Transformer = Dolmen_std.Transformer
-module ParseLocation = Dolmen_std.ParseLocation
+(* Re-export manually the sub libs/modules *)
+module Std = Dolmen_std
+module Intf = Dolmen_intf
 
+(* Languages *)
 module Line = Dolmen_line
-
 module Ae = Dolmen_ae
 module Dimacs = Dolmen_dimacs
 module ICNF = Dolmen_icnf
-module Smtlib2 = Dolmen_smtlib2
 module Tptp = Dolmen_tptp
+module Smtlib2 = Dolmen_smtlib2
 module Zf = Dolmen_zf
 
-module Logic = Dolmen_class.Logic
+(* Classes *)
+module Class = Dolmen_class
 
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/interface/dune b/Src/COLIBRI/simplex_ocaml/dolmen/src/interface/dune
index a9a6082c650c9b5dc958a153952674067548a3ab..cd84ad1990db93f3188aa1251cc5328be1145703 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/interface/dune
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/interface/dune
@@ -2,6 +2,6 @@
   (name           dolmen_intf)
   (public_name    dolmen.intf)
   (libraries      menhirLib)
-  (modules        Lex Parse Location
-                  Id Tag Type Term Stmt Language)
+  (modules        Msg Tok Lex Parse Location
+                  Id Tag Ty Term Stmt Language)
 )
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/interface/id.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/interface/id.ml
index d764e664d2533ab89a82d7774a9ce4ed556034f3..2a63943be1eced1e81727a08a489bb70708b2cbf 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/interface/id.ml
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/interface/id.ml
@@ -51,3 +51,19 @@ module type Logic = sig
   (** An identifier with an additional name for tracking purposes. *)
 
 end
+
+module type Escape = sig
+
+  type t
+  (** The type of identifiers. *)
+
+  val hash : t -> int
+  (** Hash function *)
+
+  val equal : t -> t -> bool
+  (** Equality function *)
+
+  val name : t -> string
+  (** The name / string to print for the identifier *)
+
+end
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/interface/lex.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/interface/lex.ml
index e67c571fd61b1d8eba23c9c7c1e408496e7f3a70..a94043860f8562af19508b09df2be990331daacf 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/interface/lex.ml
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/interface/lex.ml
@@ -11,7 +11,10 @@ module type S = sig
   exception Error
   (** The exception raised by the lexer when it cannot produce a token. *)
 
-  val token : Lexing.lexbuf -> token
+  val descr : token -> Tok.descr
+  (** Asspcoate a description to each token, to help with error messages. *)
+
+  val token : (Lexing.lexbuf -> unit) -> Lexing.lexbuf -> token
   (** The function producing token from a lexbuf. *)
 
 end
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/interface/location.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/interface/location.ml
index 32c372723f6bbe535bcc3545cd72087247156224..8273ec8e4d4530417640acbbcc9cdb60a156c929 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/interface/location.ml
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/interface/location.ml
@@ -20,7 +20,7 @@ module type S = sig
   exception Lexing_error of t * string
   (** The exception to be raised when the lexer cannot parse the input. *)
 
-  exception Syntax_error of t * string
+  exception Syntax_error of t * Msg.t
   (** The exception to be raised whenever a syntax error is encountered by the parser. *)
 
   val of_lexbuf : Lexing.lexbuf -> t
@@ -29,5 +29,9 @@ module type S = sig
   val mk_pos : Lexing.position -> Lexing.position -> t
   (** Make a position from two lewing positions. *)
 
+  val newline : string -> (Lexing.lexbuf -> unit)
+  (** A function first given the name of the file, and which should return a
+      closure that will be called on each new_line. *)
+
 end
 
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/interface/msg.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/interface/msg.ml
new file mode 100644
index 0000000000000000000000000000000000000000..757412b197d96d752745ef70d4ec43762b9a0ea4
--- /dev/null
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/interface/msg.ml
@@ -0,0 +1,17 @@
+
+(* This file is free software, part of dolmen. See file "LICENSE" for more information *)
+
+(** Messages
+
+    This module deines an abstraction for text/messages. Using strings to pass around
+    text is certainly useful, but suffers from a few problems, mainly the fact that
+    id doesn't compose well with Format's boxes: particularly, if a message is generated,
+    and then included in another larger message, it is problematic to format the first
+    message alone, because then when inlcuded in the larger one, boxes and break hints
+    can no longer be used. Fortunaltely, there is a solution: mainly delay printing
+    using closures and use format's %t. *)
+
+type t = Format.formatter -> unit
+(** A message is a delayed format printer. Such values can be created using
+    {Foormat.dprintf}, and consumed using "%t" in format strings *)
+
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/interface/stmt.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/interface/stmt.ml
index 45e1167f064f9409a6b4a327b9548b042e4d04e2..9bd987114a27ae8f29569e0350fae8a32bb75972 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/interface/stmt.ml
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/interface/stmt.ml
@@ -85,6 +85,9 @@ module type Logic = sig
   (** Header of dimacs files. First argument is the number of variables,
       second is the number of clauses. *)
 
+  val p_inccnf       : ?loc:location -> unit -> t
+  (** Header of iCNF files. *)
+
   val clause      : ?loc:location -> term list -> t
   (** Add to the current set of assertions the given list of terms as a clause. *)
 
@@ -132,17 +135,17 @@ module type Logic = sig
   (** Inductive type definitions.
       TODO: some more documentation. *)
 
-  val fun_decl    : ?loc:location -> id -> term list -> term -> t
-  (** Symbol declaration. [fun_decl f args ret] defines [f] as a function
+  val fun_decl    : ?loc:location -> id -> term list -> term list -> term -> t
+  (** Symbol declaration. [fun_decl f vars args ret] defines [f] as a function
       which takes arguments of type as described in [args] and which returns
       a value of type [ret]. *)
 
-  val fun_def     : ?loc:location -> id -> term list -> term -> term -> t
-  (** Symbol definition. [fun_def f args ret body] means that "f(args) = (body : ret)",
+  val fun_def     : ?loc:location -> id -> term list -> term list -> term -> term -> t
+  (** Symbol definition. [fun_def f vars args ret body] means that "f(args) = (body : ret)",
       i.e f is a function symbol with arguments [args], and which returns the value
       [body] which is of type [ret]. *)
 
-  val funs_def_rec : ?loc:location -> (id * term list * term * term) list -> t
+  val funs_def_rec : ?loc:location -> (id * term list * term list * term * term) list -> t
   (** Define a list of mutually recursive functions. Each functions has the same
       definition as in [fun_def] *)
 
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/interface/tag.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/interface/tag.ml
index 4548fde109b04b892343cec4f301fa7360389fb1..6676a907ee6514e8fafe19a674e133b90f635ce5 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/interface/tag.ml
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/interface/tag.ml
@@ -15,6 +15,9 @@ end
 (** Minium required signature for tags to typecheck smtlib's core/base theory. *)
 module type Smtlib_Base = sig
 
+    type term
+    (** The type of terms *)
+
     type 'a t
     (** Polymorphic tags *)
 
@@ -22,8 +25,12 @@ module type Smtlib_Base = sig
     (** A tag used to named formulas in smtlib.
         Should correspond to the `:named` attribute. *)
 
+    val triggers : term list t
+    (** Multi-triggers (typically annotated on the body of
+        a quantified formula and not the quantified formula itself). *)
+
     val rwrt : unit t
-    (** A flag (i.e. unit tag), indicatgin that the tagged term/formula
+    (** A flag (i.e. unit tag), indicating that the tagged term/formula
         is to be considered as a rewrite rule. *)
 
 end
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/interface/term.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/interface/term.ml
index 31eca6aca6414461623536059353aa85afd9ad2f..0d238bc67e63a35b9d29e4fb5ca55f223fd66123 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/interface/term.ml
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/interface/term.ml
@@ -125,13 +125,16 @@ module type Logic = sig
       so in the example above, [const] would be called with ["Apple"] as
       string argument, while [distinct] would be called with the string ["\"Apple\""] *)
 
+  val str      : ?loc:location -> string -> t
   val int      : ?loc:location -> string -> t
   val rat      : ?loc:location -> string -> t
   val real     : ?loc:location -> string -> t
   val hexa     : ?loc:location -> string -> t
   val binary   : ?loc:location -> string -> t
-  (** Constructors for words defined as numeric formats by the languages
-      specifications. These also can be safely aliased to [const]. *)
+  (** Constructors for words defined as numeric or string formats by the languages
+      specifications. These also can be safely aliased to [const], but then the
+      provenance information is lost, which might complicate the task of a
+      type-checker. *)
 
   val bitv     : ?loc:location -> string -> t
   (** Bitvetor litteral, defined as a specific token in Alt-ergo;
@@ -368,12 +371,6 @@ module type Tff = sig
     type t
     (** The type of variables the can occur in terms *)
 
-    val hash : t -> int
-    (** A hash function for term variables, should be suitable to create hashtables. *)
-
-    val equal : t -> t -> bool
-    (** An equality function on term variables. Should be compatible with the hash function. *)
-
     val compare : t -> t -> int
     (** Comparison function on variables. *)
 
@@ -391,11 +388,8 @@ module type Tff = sig
     type t
     (** The type of constant symbols that can occur in terms *)
 
-    val hash : t -> int
-    (** A hash function for term constants, should be suitable to create hashtables. *)
-
-    val equal : t -> t -> bool
-    (** An equality function on term constants. Should be compatible with the hash function. *)
+    val compare : t -> t -> int
+    (** Comparison function on constant symbols. *)
 
     val arity : t -> int * int
     (** Returns the arity of a term constant. *)
@@ -418,15 +412,17 @@ module type Tff = sig
         constructors, while [list] would be a type constant of arity 1 used to
         name the type. *)
 
-    val hash : t -> int
-    (** A hash function for adt constructors, should be suitable to create hashtables. *)
-
-    val equal : t -> t -> bool
-    (** An equality function on adt constructors. Should be compatible with the hash function. *)
+    val compare : t -> t -> int
+    (** Comparison function on constant symbols. *)
 
     val arity : t -> int * int
     (** Returns the arity of a constructor. *)
 
+    val pattern_arity : t -> ty -> ty list -> ty list
+    (** Used in the type-checking of pattern matching.
+        [pattern_arity cstr ret ty_args] should return the types of the expected arguments
+        [args] such that [apply_cstr cstr ty_args args] has type [ret]. *)
+
   end
 
   module Field : sig
@@ -434,11 +430,8 @@ module type Tff = sig
     type t
     (** A field of a record. *)
 
-    val hash : t -> int
-    (** A hash function for adt constructors, should be suitable to create hashtables. *)
-
-    val equal : t -> t -> bool
-    (** An equality function on adt constructors. Should be compatible with the hash function. *)
+    val compare : t -> t -> int
+    (** Comparison function on constant symbols. *)
 
   end
 
@@ -480,6 +473,10 @@ module type Tff = sig
       [Wrong_type (t, ty)] should be raised by term constructor functions when some term [t]
       is expected to have type [ty], but does not have that type. *)
 
+  exception Wrong_sum_type of Cstr.t * ty
+  (** Raised when some constructor was expected to belong to some type but does not
+      belong to the given type. *)
+
   exception Wrong_record_type of Field.t * ty_const
   (** Exception raised in case of typing error during term construction.
       This should be raised when the returned field was expected to be a field
@@ -562,8 +559,20 @@ module type Tff = sig
       The first pair of arguments are the variables that are free in the resulting
       quantified formula, and the second pair are the variables bound. *)
 
+  val bind : Var.t -> t -> t
+  (** Bind a variable to an expressions. This function is called when typing
+      a let-binding, before the body of the let-binding is typed. The returned
+      expressions is used to replace the variable everywhere in the body of the
+      let-binding being typed. *)
+
   val letin : (Var.t * t) list -> t -> t
-  (** Let-binding. Variabels can be bound to either terms or formulas. *)
+  (** Create a let-binding. This function is called after the body of the
+      let-binding has been typed. *)
+
+  val pattern_match : t -> (t * t) list -> t
+  (** [pattern_match scrutinee branches] creates a pattern match expression
+      on the scrutinee with the given branches, each of the form
+      [(pattern, body)] *)
 
   val ite : t -> t -> t -> t
   (** [ite condition then_t else_t] creates a conditional branch. *)
@@ -740,9 +749,16 @@ module type Smtlib_Base = sig
   type t
   (** The type of terms. *)
 
+  type cstr
+  (** The type of ADT constructor *)
+
   val eqs : t list -> t
   (** Create a chain of equalities. *)
 
+  val cstr_tester : cstr -> t -> t
+  (** Given a constructor [c] and a term [t], returns a terms that evaluates
+      to [true] iff [t] has [c] as head constructor. *)
+
 end
 
 (** Common signature for first-order arithmetic *)
@@ -751,6 +767,11 @@ module type Smtlib_Arith_Common = sig
   type t
   (** The type of terms *)
 
+  val mk : string -> t
+  (** Build a constant. The literal is passed
+      as a string to avoid overflow caused
+      by the limited precision of native number formats. *)
+
   val minus : t -> t
   (** Arithmetic unary minus/negation. *)
 
@@ -763,9 +784,6 @@ module type Smtlib_Arith_Common = sig
   val mul : t -> t -> t
   (** Arithmetic multiplication *)
 
-  val div : t -> t -> t
-  (** Division. See Smtlib theory for a full description. *)
-
   val lt : t -> t -> t
   (** Arithmetic "less than" comparison. *)
 
@@ -787,13 +805,11 @@ module type Smtlib_Int = sig
 
   include Smtlib_Arith_Common
 
-  val int : string -> t
-  (** Build an integer constant. The integer is passed
-          as a string, and not an [int], to avoid overflow caused
-          by the limited precision of native intgers. *)
+  val div : t -> t -> t
+  (** Euclidian division. See Smtlib theory for a full description. *)
 
   val rem : t -> t -> t
-  (** Integer remainder See Smtlib theory for a full description. *)
+  (** Euclidiane integer remainder See Smtlib theory for a full description. *)
 
   val abs : t -> t
   (** Arithmetic absolute value. *)
@@ -809,9 +825,8 @@ module type Smtlib_Real = sig
 
   include Smtlib_Arith_Common
 
-  val real : string -> t
-  (** Build a real constant. The string should respect
-      smtlib's syntax for INTEGER or DECIMAL. *)
+  val div : t -> t -> t
+  (** Real division. See Smtlib theory for a full description. *)
 
 end
 
@@ -864,9 +879,6 @@ module type Smtlib_Array = sig
   (** [store arr idx value] creates the set operation on
       functional array [arr] for value [value] at index [idx]. *)
 
-  val const : t -> t
-  (** [const value] a constant array with the given value. *)
-
 end
 
 module type Smtlib_Bitv = sig
@@ -874,19 +886,19 @@ module type Smtlib_Bitv = sig
   type t
   (** The type of terms *)
 
-  val mk_bitv : string -> t
+  val mk : string -> t
   (** Create a bitvector litteral from a string representation.
         The string should only contain characters '0' or '1'. *)
 
-  val bitv_concat : t -> t -> t
+  val concat : t -> t -> t
   (** Bitvector concatenation. *)
 
-  val bitv_extract : int -> int -> t -> t
+  val extract : int -> int -> t -> t
   (** Bitvector extraction, using in that order,
       the end (exclusive) and then the start (inclusive)
       position of the bitvector to extract. *)
 
-  val bitv_repeat : int -> t -> t
+  val repeat : int -> t -> t
   (** Repetition of a bitvector. *)
 
   val zero_extend : int -> t -> t
@@ -902,137 +914,146 @@ module type Smtlib_Bitv = sig
   val rotate_left : int -> t -> t
   (** [rotate_left i x] means rotate bits of x to the left i times. *)
 
-  val bvnot : t -> t
+  val not : t -> t
   (** Bitwise negation. *)
 
-  val bvand : t -> t -> t
+  val and_ : t -> t -> t
   (** Bitwise conjunction. *)
 
-  val bvor : t -> t -> t
+  val or_ : t -> t -> t
   (** Bitwise disjunction. *)
 
-  val bvnand : t -> t -> t
-  (** [bvnand s t] abbreviates [bvnot (bvand s t)]. *)
+  val nand : t -> t -> t
+  (** [nand s t] abbreviates [not (and_ s t)]. *)
 
-  val bvnor : t -> t -> t
-  (** [bvnor s t] abbreviates [bvnot (bvor s t)]. *)
+  val nor : t -> t -> t
+  (** [nor s t] abbreviates [not (or_ s t)]. *)
 
-  val bvxor : t -> t -> t
-  (** [bvxor s t] abbreviates [bvor (bvand s (bvnot t)) (bvand (bvnot s) t)]. *)
+  val xor : t -> t -> t
+  (** [xor s t] abbreviates [or_ (and_ s (not t)) (and_ (not s) t)]. *)
 
-  val bvxnor : t -> t -> t
-  (** [bvxnor s t] abbreviates [bvor (bvand s t) (bvand (bvnot s) (bvnot t))]. *)
+  val xnor : t -> t -> t
+  (** [xnor s t] abbreviates [or_ (and_ s t) (and_ (not s) (not t))]. *)
 
-  val bvcomp : t -> t -> t
-  (** Bitwise comparison. [bvcomp s t] equald [#b1] iff [s] and [t]
+  val comp : t -> t -> t
+  (** Bitwise comparison. [comp s t] equald [#b1] iff [s] and [t]
       are bitwise equal. *)
 
-
-  val bvneg : t -> t
+  val neg : t -> t
   (** Arithmetic complement on bitvectors.
       Supposing an input bitvector of size [m] representing
       an integer [k], the resulting term should represent
       the integer [2^m - k]. *)
 
-  val bvadd : t -> t -> t
+  val add : t -> t -> t
   (** Arithmetic addition on bitvectors, modulo the size of
       the bitvectors (overflows wrap around [2^m] where [m]
       is the size of the two input bitvectors). *)
 
-  val bvsub : t -> t -> t
+  val sub : t -> t -> t
   (** Arithmetic substraction on bitvectors, modulo the size
       of the bitvectors (2's complement subtraction modulo).
-      [bvsub s t] should be equal to [bvadd s (bvneg t)]. *)
+      [sub s t] should be equal to [add s (neg t)]. *)
 
-  val bvmul : t -> t -> t
+  val mul : t -> t -> t
   (** Arithmetic multiplication on bitvectors, modulo the size
-      of the bitvectors (see {!bvadd}). *)
+      of the bitvectors (see {!add}). *)
 
-  val bvudiv : t -> t -> t
+  val udiv : t -> t -> t
   (** Arithmetic euclidian integer division on bitvectors. *)
 
-  val bvurem : t -> t -> t
+  val urem : t -> t -> t
   (** Arithmetic euclidian integer remainder on bitvectors. *)
 
-  val bvsdiv : t -> t -> t
+  val sdiv : t -> t -> t
   (** Arithmetic 2's complement signed division.
       (see smtlib's specification for more information). *)
 
-  val bvsrem : t -> t -> t
+  val srem : t -> t -> t
   (** Arithmetic 2's coplement signed remainder (sign follows dividend).
       (see smtlib's specification for more information). *)
 
-  val bvsmod : t -> t -> t
+  val smod : t -> t -> t
   (** Arithmetic 2's coplement signed remainder (sign follows divisor).
       (see smtlib's specification for more information). *)
 
-  val bvshl : t -> t -> t
-  (** Logical shift left. [bvshl t k] return the result of
+  val shl : t -> t -> t
+  (** Logical shift left. [shl t k] return the result of
       shifting [t] to the left [k] times. In other words,
       this should return the bitvector representing
       [t * 2^k] (since bitvectors represent integers using
       the least significatn bit in cell 0). *)
 
-  val bvlshr : t -> t -> t
-  (** Logical shift right. [bvlshr t k] return the result of
+  val lshr : t -> t -> t
+  (** Logical shift right. [lshr t k] return the result of
       shifting [t] to the right [k] times. In other words,
       this should return the bitvector representing
       [t / (2^k)]. *)
 
-  val bvashr : t -> t -> t
+  val ashr : t -> t -> t
   (** Arithmetic shift right, like logical shift right except that the most
       significant bits of the result always copy the most significant
       bit of the first argument*)
 
-  val bvult : t -> t -> t
+  val ult : t -> t -> t
   (** Boolean arithmetic comparison (less than).
-      [bvult s t] should return the [true] term iff [s < t]. *)
+      [ult s t] should return the [true] term iff [s < t]. *)
 
-  val bvule : t -> t -> t
+  val ule : t -> t -> t
   (** Boolean arithmetic comparison (less or equal than). *)
 
-  val bvugt : t -> t -> t
+  val ugt : t -> t -> t
   (** Boolean arithmetic comparison (greater than). *)
 
-  val bvuge : t -> t -> t
+  val uge : t -> t -> t
   (** Boolean arithmetic comparison (greater or equal than). *)
 
-  val bvslt : t -> t -> t
+  val slt : t -> t -> t
   (** Boolean signed arithmetic comparison (less than).
       (See smtlib's specification for more information) *)
 
-  val bvsle : t -> t -> t
+  val sle : t -> t -> t
   (** Boolean signed arithmetic comparison (less or equal than). *)
 
-  val bvsgt : t -> t -> t
+  val sgt : t -> t -> t
   (** Boolean signed arithmetic comparison (greater than). *)
 
-  val bvsge : t -> t -> t
+  val sge : t -> t -> t
   (** Boolean signed arithmetic comparison (greater or equal than). *)
+
 end
 
-module type Smtlib_Float = sig
+(** Bitvector part of the smtlib float requirements *)
+module type Smtlib_Float_Bitv = sig
+
   type t
-  (** The type of terms *)
+  (** the type of terms *)
+
+  val mk : string -> t
+  (** Bitvector litteral. *)
 
-  val classify: t -> [ `Real | ` Bitv of int | `Float of int * int | `Other ]
-  (** Give the type of the given term *)
+end
 
-  module Float: sig
-    (** Floating points are complicated so this documentation is not in anyway
-        sufficient. A detailed description of the theory together with the
-        rationale of several models decisions as well as a formal semantics of the
-        theory can be found in
+(** Real part of the smtlib float requirements *)
+module type Smtlib_Float_Real = sig
 
-        [BTRW15] Martin Brain, Cesare Tinelli, Philipp Ruemmer, and Thomas Wahl. An
-        Automatable Formal Semantics for IEEE-754 Floating-Point Arithmetic
-        Technical Report, 2015. (http://smt-lib.org/papers/BTRW15.pdf)
-    *)
+  type t
+  (** the type of terms *)
+
+  val mk : string -> t
+  (** Bitvector litteral. *)
 
+end
+
+(** Float part of the smtlib float requirements *)
+module type Smtlib_Float_Float = sig
+
+    type t
+    (** the type of terms *)
 
     val fp : t -> t -> t -> t
-    (** Construct a floating point from bitvectors.
-        Sign is of size 1*)
+    (** Construct a floating point from bitvector literals
+        (sign, exponent, significand). The sign should be of size 1. *)
 
     val roundNearestTiesToEven: t
     (** constant for rounding mode RNE *)
@@ -1065,85 +1086,85 @@ module type Smtlib_Float = sig
     (** The constant Non-numbers, it is also equivalent to many literals which are
         equivalent together *)
 
-    val fp_abs : t -> t
+    val abs : t -> t
     (** absolute value *)
 
-    val fp_neg : t -> t
+    val neg : t -> t
     (** negation *)
 
-    val fp_add : t -> t -> t -> t
-    (** [fp_add rm f1 f2] addition *)
+    val add : t -> t -> t -> t
+    (** [add rm f1 f2] addition *)
 
-    val fp_sub : t -> t -> t -> t
-    (** [fp_sub rm f1 f2] subtraction *)
+    val sub : t -> t -> t -> t
+    (** [sub rm f1 f2] subtraction *)
 
-    val fp_mul : t -> t -> t -> t
-    (** [fp_mul rm f1 f2] multiplication *)
+    val mul : t -> t -> t -> t
+    (** [mul rm f1 f2] multiplication *)
 
-    val fp_div : t -> t -> t -> t
-    (** [fp_mul rm f1 f2] division *)
+    val div : t -> t -> t -> t
+    (** [mul rm f1 f2] division *)
 
-    val fp_fma : t -> t -> t -> t -> t
-    (** [fp_mul rm f1 f2] fused multiplication and addition *)
+    val fma : t -> t -> t -> t -> t
+    (** [mul rm f1 f2] fused multiplication and addition *)
 
-    val fp_sqrt : t -> t -> t
-    (** [fp_sqrt rm f] square root *)
+    val sqrt : t -> t -> t
+    (** [sqrt rm f] square root *)
 
-    val fp_rem : t -> t -> t
-    (** [fp_rem f1 f2] remainder *)
+    val rem : t -> t -> t
+    (** [rem f1 f2] remainder *)
 
-    val fp_roundToIntegral : t -> t -> t
-    (** [fp_roundToIntegral rm f] rounding to integral *)
+    val roundToIntegral : t -> t -> t
+    (** [roundToIntegral rm f] rounding to integral *)
 
-    val fp_min : t -> t -> t
-    (** [fp_min f1 f2] minimum *)
+    val min : t -> t -> t
+    (** [min f1 f2] minimum *)
 
-    val fp_max : t -> t -> t
-    (** [fp_max f1 f2] maximum *)
+    val max : t -> t -> t
+    (** [max f1 f2] maximum *)
 
-    val fp_leq : t -> t -> t
-    (** [fp_leq f1 f2] less or equal floating point comparison *)
+    val leq : t -> t -> t
+    (** [leq f1 f2] less or equal floating point comparison *)
 
-    val fp_lt : t -> t -> t
-    (** [fp_lt f1 f2] less than floating point comparison *)
+    val lt : t -> t -> t
+    (** [lt f1 f2] less than floating point comparison *)
 
-    val fp_geq : t -> t -> t
-    (** [fp_geq f1 f2] greater or equal floating point comparison *)
+    val geq : t -> t -> t
+    (** [geq f1 f2] greater or equal floating point comparison *)
 
-    val fp_gt : t -> t -> t
-    (** [fp_lt f1 f2] greater than floating point comparison *)
+    val gt : t -> t -> t
+    (** [lt f1 f2] greater than floating point comparison *)
 
-    val fp_eq : t -> t -> t
-    (** [fp_eq f1 f2] floating point equality *)
+    val eq : t -> t -> t
+    (** [eq f1 f2] floating point equality *)
 
-    val fp_isNormal : t -> t
-    (** [fp_isNormal f] test if it is a normal floating point *)
+    val isNormal : t -> t
+    (** [isNormal f] test if it is a normal floating point *)
 
-    val fp_isSubnormal : t -> t
-    (** [fp_isSubnormal f] test if it is a subnormal floating point *)
+    val isSubnormal : t -> t
+    (** [isSubnormal f] test if it is a subnormal floating point *)
 
-    val fp_isZero : t -> t
-    (** [fp_isZero f] test if it is a zero *)
+    val isZero : t -> t
+    (** [isZero f] test if it is a zero *)
 
-    val fp_isInfinite : t -> t
-    (** [fp_isInfinite f] test if it is an infinite *)
+    val isInfinite : t -> t
+    (** [isInfinite f] test if it is an infinite *)
 
-    val fp_isNaN : t -> t
-    (** [fp_isNaN f] test if it is NaN *)
+    val isNaN : t -> t
+    (** [isNaN f] test if it is NaN *)
 
-    val fp_isNegative : t -> t
-    (** [fp_isNegative f] test if it is a negative floating point *)
+    val isNegative : t -> t
+    (** [isNegative f] test if it is a negative floating point *)
 
-    val fp_isPositive : t -> t
-    (** [fp_isPositive f] test if it is a positive floating point *)
+    val isPositive : t -> t
+    (** [isPositive f] test if it is a positive floating point *)
 
     val ieee_format_to_fp: int -> int -> t -> t
     (** [ieee_format_to_fp e s bv] Convert a bitvector into a floating point using IEEE 754-2008 interchange format.
         (reinterpret the bitvector into floating-point)
     *)
 
-    val fp_to_fp: int -> int -> t -> t -> t
-    (** [fp_to_fp e s rm f] convert from one floating point format to another *)
+    val to_fp: int -> int -> t -> t -> t
+    (** [to_fp e s rm f] convert from one floating point format to another *)
 
     val real_to_fp: int -> int -> t -> t -> t
     (** [real_to_fp e s rm r] convert from a real *)
@@ -1162,5 +1183,187 @@ module type Smtlib_Float = sig
 
     val to_real: t -> t
     (** [to_real f] convert to a real *)
-  end
+
 end
+
+(* Requirement for the Floats SMTLIB theory *)
+module type Smtlib_Float = sig
+
+  (** Floating points are complicated so this documentation is not in anyway
+      sufficient. A detailed description of the theory together with the
+      rationale of several models decisions as well as a formal semantics of the
+      theory can be found in
+
+      [BTRW15] Martin Brain, Cesare Tinelli, Philipp Ruemmer, and Thomas Wahl. An
+      Automatable Formal Semantics for IEEE-754 Floating-Point Arithmetic
+      Technical Report, 2015. (http://smt-lib.org/papers/BTRW15.pdf)
+  *)
+
+  type t
+  (** The type of terms *)
+
+  type ty
+  (** The type of types. *)
+
+  val ty : t -> ty
+  (** Type of a term. *)
+
+  module Real : Smtlib_Float_Real with type t := t
+  (** Sub-module used for namespacing the real part
+      of the theory requirements *)
+
+  module Bitv : Smtlib_Float_Bitv with type t := t
+  (** Sub-module used for namespacing the bitvector part
+      of the theory requirements *)
+
+  module Float : Smtlib_Float_Float with type t := t
+  (** Sub-module used for namespacing the floating number part
+      of the theory requirements *)
+
+end
+
+module type Smtlib_String_RegLan = sig
+
+  type t
+  (** The type of terms *)
+
+  val empty : t
+  (** The empty regular language. *)
+
+  val all : t
+  (** The language that contains all strings *)
+
+  val allchar : t
+  (** The language that contains all strings of length 1 *)
+
+  val of_string : t -> t
+  (** Singleton language containing a single string. *)
+
+  val range : t -> t -> t
+  (** [range s1 s2] is the language containing all singleton strings
+      (i.e. string of length 1) that are lexicographically beetween
+      [s1] and [s2], **assuming [s1] and [s2] are singleton strings**.
+      Else it is the empty language. *)
+
+  val concat : t -> t -> t
+  (** Language concatenation. *)
+
+  val union : t -> t -> t
+  (** Language union. *)
+
+  val inter : t -> t -> t
+  (** language intersection. *)
+
+  val star : t -> t
+  (** Kleene closure. *)
+
+  val cross : t -> t
+  (** Kleene cross. [cross e] abreviates [concat e (star e)] *)
+
+  val complement : t -> t
+  (** Complement. *)
+
+  val diff : t -> t -> t
+  (** Difference *)
+
+  val option : t -> t
+  (** Option. [option e] abbreviates [union e (of_string "")] *)
+
+  val power : int -> t -> t
+  (** [power n e] is [n]-th power of [e]. *)
+
+  val loop : int -> int -> t -> t
+  (** Loop. See SMTLIb documentation. *)
+
+end
+
+module type Smtlib_String_String = sig
+
+  type t
+  (** The type of terms *)
+
+  val of_ustring : string -> t
+  (** Create a string from a unicode UTF-8 encoded string (with escape sequences
+      already interpreted as unicode characters). *)
+
+  val length : t -> t
+  (** Length of a string expression. *)
+
+  val at : t -> t -> t
+  (** Get the char at the given position. *)
+
+  val is_digit : t -> t
+  (** Is the string a singleton string with a single digit character ? *)
+
+  val to_code : t -> t
+  (** Returns the code point of the single character of the string,
+      or [(-1)] is the string is not a singleton. *)
+
+  val of_code : t -> t
+  (** Returns the singleton string whose only character is the given
+      code point. *)
+
+  val to_int : t -> t
+  (** Evaluates the string as a decimal natural number, or [(-1)] if
+      it's not possible. *)
+
+  val of_int : t -> t
+  (** Convert an int expression to a string in decimal representation. *)
+
+  val concat : t -> t -> t
+  (** String concatenation. *)
+
+  val sub : t -> t -> t -> t
+  (** Substring extraction. *)
+
+  val index_of : t -> t -> t -> t
+  (** Index of the first occurrence of the second string in
+      first one, starting at the position of the third argument. *)
+
+  val replace : t -> t -> t -> t
+  (** Replace the first occurrence. *)
+
+  val replace_all : t -> t -> t -> t
+  (** Replace all occurrences. *)
+
+  val replace_re : t -> t -> t -> t
+  (** Replace the leftmost, shortest re ocurrence. *)
+
+  val replace_re_all : t -> t -> t -> t
+  (** Replace left-to-right, each shortest non empty re occurrence. *)
+
+  val is_prefix : t -> t -> t
+  (** First string is a prefix of the second one. *)
+
+  val is_suffix : t -> t -> t
+  (** First string is a suffix of the second one. *)
+
+  val contains : t -> t -> t
+  (** First string contains the second one. *)
+
+  val lt : t -> t -> t
+  (** Lexicographic strict ordering. *)
+
+  val leq : t -> t -> t
+  (** Lexicographic large ordering. *)
+
+  val in_re : t -> t -> t
+  (** String Regular languager membership *)
+
+  module RegLan : Smtlib_String_RegLan with type t := t
+  (** Sub-module used for namespacing for the regular language part
+      of the theory requirements. *)
+
+end
+
+module type Smtlib_String = sig
+
+  type t
+  (** The type of terms *)
+
+  module String : Smtlib_String_String with type t := t
+  (** Sub-module used for namespacing for the string part
+      of the theory requirements. *)
+
+end
+
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/interface/tok.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/interface/tok.ml
new file mode 100644
index 0000000000000000000000000000000000000000..10521c71307b8987fb19359d835d117387b84992
--- /dev/null
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/interface/tok.ml
@@ -0,0 +1,18 @@
+
+(* This file is free software, part of dolmen. See file "LICENSE" for more information *)
+
+(** Interface for token descriptions
+    This doe snot define an interface for token descriptions but rather defines
+    a type for token description, that will then be used by others interfaces.
+*)
+
+type descr = {
+  article : string;
+  kind : string;
+  lexeme : string;
+  hint : string option;
+}
+(** The description fo a token, to be used when pretty-printing error messages.
+    The idea is to be able to ouput a message such as
+    "the parser expetced something, but got %{article} %{kind}: '%{lexeme}'" *)
+
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/interface/ty.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/interface/ty.ml
new file mode 100644
index 0000000000000000000000000000000000000000..78980da029e5e7baa1e11865da934f8bf039548b
--- /dev/null
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/interface/ty.ml
@@ -0,0 +1,265 @@
+
+(* This file is free software, part of dolmen. See file "LICENSE" for more information *)
+
+(** Interfaces for Types
+    This module defines Interfaces that implementation of types must
+    respect in order to be used to instantiate functors. *)
+
+
+(** {2 Signature for Typecheked types} *)
+
+(** Signature required by types for typing first-order
+    polymorphic terms. *)
+module type Tff = sig
+
+  type t
+  (** The type of types. *)
+
+  type 'a tag
+  (** A type for tags to attach to arbitrary types. *)
+
+  (** A module for variables that occur in types. *)
+  module Var : sig
+
+    type t
+    (** The type of variables the can occur in types *)
+
+    val compare : t -> t -> int
+    (** Comparison function on variables. *)
+
+    val mk : string -> t
+    (** Create a new type variable with the given name. *)
+
+  end
+
+  (** A module for constant symbols the occur in types. *)
+  module Const : sig
+
+    type t
+    (** The type of constant symbols the can occur in types *)
+
+    val compare : t -> t -> int
+    (** Comparison function on type constants. *)
+
+    val arity : t -> int
+    (** Return the arity of the given symbol. *)
+
+    val mk : string -> int -> t
+    (** Create a type constant with the given arity. *)
+
+    val tag : t -> 'a tag -> 'a -> unit
+    (** Tag a variable. *)
+
+  end
+
+  val prop : t
+  (** The type of propositions *)
+
+  val of_var : Var.t -> t
+  (** Create a type from a variable. *)
+
+  val apply : Const.t -> t list -> t
+  (** Application for types. *)
+
+  val wildcard : unit -> t
+  (** Create a fresh type wildcard. *)
+
+  val tag : t -> 'a tag -> 'a -> unit
+  (** Annotate the given type with the given tag and value. *)
+
+end
+
+(** Signature required by types for typing ae *)
+module type Ae_Base = sig
+
+  type t
+  (** The type of types. *)
+
+  val bool : t
+  (** The type of booleans *)
+
+  val unit : t
+  (** Unit type *)
+
+end
+
+
+(** Signature required by types for typing tptp *)
+module type Ae_Arith = sig
+
+  type t
+  (** The type of types. *)
+
+  val int : t
+  (** The type of integers. *)
+
+end
+
+(** Signature required by types for typing tptp *)
+module type Tptp_Base = sig
+
+    type t
+    (** The type of types *)
+
+    val prop : t
+    (** The type of propositions. *)
+
+    val base : t
+    (** An arbitrary base type. *)
+
+end
+
+(** Signature required by types for typing tptp *)
+module type Tptp_Arith = sig
+
+    type t
+    (** The type of types *)
+
+    val int : t
+    (** The type of integers *)
+
+    val rat : t
+    (** The type of rationals *)
+
+    val real : t
+    (** The type of reals *)
+
+    val equal : t -> t -> bool
+    (** Equality on types. *)
+
+end
+
+
+
+(** Signature required by types for typing smtlib core theory *)
+module type Smtlib_Base = sig
+
+  type t
+  (** The type of type constants (i.e. type constructors) *)
+
+  val prop : t
+  (** The type constructor of propositions. *)
+
+end
+
+(** Signature required by types for typing smtlib integer arithmetic *)
+module type Smtlib_Int = sig
+
+  type t
+  (** The type of types *)
+
+  val int : t
+  (** The type for integer expressions. *)
+
+end
+
+(** Signature required by types for typing smtlib real arithmetic *)
+module type Smtlib_Real = sig
+
+  type t
+  (** The type of types *)
+
+  val real : t
+  (** The type for integer expressions. *)
+
+end
+
+(** Signature required for types for typing smtlib real_int arithmetic. *)
+module type Smtlib_Real_Int = sig
+
+  include Smtlib_Int
+  include Smtlib_Real with type t := t
+
+  type view = private [>
+    | `Int
+    | `Real
+  ]
+  (** Partial view for types. These are used by the Reals_Ints theory
+      to perform type-based dispatch, and automatic conversion of Ints
+      to Reals when specified by the specification. *)
+
+  val view : t -> view
+  (** Partial view of a type. *)
+
+end
+
+(** Signature required for types for typing smtlib arrays *)
+module type Smtlib_Array = sig
+
+  type t
+  (** The type of types *)
+
+  val array : t -> t -> t
+  (** The type of functionnal arrays from one type to another. *)
+
+  type view = private [>
+    | `Int
+    | `Real
+    | `Bitv of int
+    | `Array of t * t
+  ]
+  (** Partial views for types. These are used in the Array theory
+      to enforce some restrictions logics impose on the types of
+      arrays that cna occur. *)
+
+  val view : t -> view
+  (** Partial view of a type. *)
+
+end
+
+(** Signature required for types for typing smtlib bitvectors *)
+module type Smtlib_Bitv = sig
+
+  type t
+  (** The type of types *)
+
+  val bitv : int -> t
+  (** Create a fixed size bitvector type. *)
+
+end
+
+(** Signature required for types for typing smtlib bitvectors *)
+module type Smtlib_Float = sig
+
+  type t
+  (** The type of types *)
+
+  val bitv : int -> t
+  (** Create a fixed size bitvector type. *)
+
+  val float : int -> int -> t
+  (** Create a float type with fixed exponent size in bits and fixed significand,
+      including the hidden bit. *)
+
+  val roundingMode: t
+  (** Type of the rounding modes *)
+
+  type view = private [>
+    | `Real
+    | `Bitv of int
+    | `Float of int * int
+  ]
+  (** Partial views for types. These are used in the Float theory to
+      perform type-base dispatch for some conversion functions. *)
+
+  val view : t -> view
+  (** Partial view of a type. *)
+
+end
+
+(* Signature required for types for typing the smtlib string theory *)
+module type Smtlib_String = sig
+
+  type t
+  (** The type of types *)
+
+  val int : t
+  (** The type of ints *)
+
+  val string : t
+  (** The type of strings *)
+
+  val string_reg_lang : t
+  (** The type of regular languages over strings *)
+
+end
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/ae/ast_ae.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/ae/ast_ae.ml
index 66c2b2ca4d9a999dcf27bcd14045375c0d59e0aa..af816018775ff58e6b8fbcfaba60c762ff431903 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/ae/ast_ae.ml
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/ae/ast_ae.ml
@@ -194,7 +194,7 @@ module type Statement = sig
   val record_type : ?loc:location -> id -> term list -> (id * term) list -> t
   (** Record type definition. *)
 
-  val fun_def : ?loc:location -> id -> term list -> term -> term -> t
+  val fun_def : ?loc:location -> id -> term list -> term list -> term -> term -> t
   (** Function definition. *)
 
   val abstract_type : ?loc:location -> id -> term list -> t
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/ae/dolmen_ae.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/ae/dolmen_ae.ml
index c3706618a1332d57cf9dfb8a7d3cd0b29bfdb285..f33dcacc024dec214a79a36b8b5c6790a4528f02 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/ae/dolmen_ae.ml
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/ae/dolmen_ae.ml
@@ -15,6 +15,6 @@ module Make
     type statement = S.t
     let env = []
     let incremental = false
-    let error _ = ""
+    let error s = Syntax_messages.message s
   end)(LexAe)(ParseAe.Make(L)(I)(T)(S))
 
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/ae/dune b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/ae/dune
index 53d3a857c1e47e44edca37106eb6d60fc423b385..cfd516aa032b36f6eae60a891b46b222f3cd6fdb 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/ae/dune
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/ae/dune
@@ -13,9 +13,53 @@
  (merge_into parseAe)
 )
 
+(rule
+  (target syntax_messages.ml)
+  (deps   (:tokens tokens_ae.mly)
+          (:parser parseAe.mly)
+          (:msg syntax.messages))
+  (action (with-stdout-to %{target}
+          (run menhir --external-tokens Tokens_ae %{tokens}
+                      %{parser} --base %{parser} --compile-errors %{msg})))
+)
+
 (library
   (name           dolmen_ae)
   (public_name    dolmen.ae)
-  (libraries      dolmen_std menhirLib)
-  (modules        Tokens_ae LexAe ParseAe Ast_ae Dolmen_ae)
+  (libraries      dolmen_std dolmen_intf menhirLib)
+  (modules        Tokens_ae LexAe ParseAe Ast_ae Syntax_messages Dolmen_ae)
+)
+
+; Convenience rule to generate a fresh messages file,
+; and update an already existing one.
+(rule
+  (target new.messages)
+  (mode   promote-until-clean)
+  (deps   (:tokens tokens_ae.mly)
+          (:parser parseAe.mly))
+  (action (with-stdout-to %{target}
+          (run menhir --external-tokens Tokens_ae %{tokens}
+                      %{parser} --base %{parser} --list-errors)))
+)
+
+(rule
+  (target updated.messages)
+  (mode   promote-until-clean)
+  (deps   (:tokens tokens_ae.mly)
+          (:parser parseAe.mly)
+          (:msg syntax.messages))
+  (action (with-stdout-to %{target}
+          (run menhir --external-tokens Tokens_ae %{tokens}
+                      %{parser} --base %{parser} --update-errors %{msg})))
+)
+
+; Additional rule to add to runtest a check that the messages file is up-to-date
+(rule
+  (alias runtest)
+  (deps   (:tokens tokens_ae.mly)
+          (:parser parseAe.mly)
+          (:new new.messages)
+          (:msg syntax.messages))
+  (action (run menhir --external-tokens Tokens_ae %{tokens}
+                      %{parser} --base %{parser} --compare-errors %{new} --compare-errors %{msg}))
 )
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/ae/lexAe.mll b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/ae/lexAe.mll
index 5647ced22567b3284c8087020482e23902513821..cb8e4a1872229e98a1b611623545c3344670559b 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/ae/lexAe.mll
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/ae/lexAe.mll
@@ -4,15 +4,72 @@
 (** {1 Alt-ergo Lexer} *)
 
 {
+  exception Error
+
+  module T = Dolmen_std.Tok
+
   open Tokens_ae
 
+  (* Token printing *)
+
+  let reserved s =
+    T.descr s
+      ~kind:"reserved word"
+      ~hint:"reserved words cannot be used as identifiers"
+
+  let descr token : T.descr =
+    match (token : token) with
+    | ID s -> T.descr ~kind:"identifier" s
+    | QM_ID s -> T.descr ~kind:"variable id" s
+    | INTEGER s -> T.descr ~kind:"integer" s
+    | DECIMAL s -> T.descr ~kind:"decimal" s
+    | HEXADECIMAL s -> T.descr ~kind:"hexadecimal" s
+    | STRING s -> T.descr ~kind:"string" s
+    | MATCH -> reserved "match"
+    | WITH -> reserved "with"
+    | THEORY -> reserved "theory"
+    | EXTENDS -> reserved "extends"
+    | END -> reserved "end"
+    | QM -> reserved "?"
+    | AND -> reserved "and"
+    | LEFTARROW -> reserved "<-"
+                     (*
+    | RIGHTARROW AC AT AXIOM CASESPLIT REWRITING
+%token BAR HAT
+%token BOOL COLON COMMA PV DISTINCT DOT SHARP ELSE OF EOF EQUAL
+%token EXISTS FALSE VOID FORALL FUNC GE GOAL GT CHECK CUT
+%token IF IN INT BITV MAPS_TO
+%token LE LET LEFTPAR LEFTSQ LEFTBR LOGIC LRARROW XOR LT MINUS
+%token NOT NOTEQ OR PERCENT PLUS PRED PROP
+%token QUOTE REAL UNIT
+%token RIGHTPAR RIGHTSQ RIGHTBR
+%token SLASH POW POWDOT
+%token THEN TIMES TRUE TYPE
+%nonassoc IN
+%nonassoc prec_forall prec_exists
+%right RIGHTARROW LRARROW XOR
+%right OR
+%right AND
+%nonassoc prec_ite
+%left prec_relation EQUAL NOTEQ LT LE GT GE
+%left PLUS MINUS
+%left TIMES SLASH PERCENT POW POWDOT AT
+%nonassoc HAT
+%nonassoc uminus
+%nonassoc NOT
+%right prec_named
+%nonassoc CHECK CUT
+*)
+    | _ -> assert false
+
+  (* Token parsing *)
+
   let escaped_char = function
     | 'n' -> '\n'
     | 'r' -> '\r'
     | 't' -> '\t'
     | c -> c
 
-  exception Error
 }
 
 let letter = ['a'-'z' 'A'-'Z']
@@ -30,9 +87,9 @@ let hex = digit | ['a'-'f''A'-'F']
 let hex_exp = ['p' 'P'] signed_integer
 let real_hex = "0x" hex+ '.' hex* hex_exp
 
-rule token = parse
-  | '\n'                      { Lexing.new_line lexbuf; token lexbuf }
-  | [' ' '\t' '\r']+          { token lexbuf }
+rule token newline = parse
+  | '\n'                      { newline lexbuf; token newline lexbuf }
+  | [' ' '\t' '\r']+          { token newline lexbuf }
   | '?'                       { QM }
   | '?' identifier as id      { QM_ID id }
   | identifier as i           { match i with
@@ -79,7 +136,7 @@ rule token = parse
   | integer as s              { INTEGER s }
   | real as s                 { DECIMAL s }
   | real_hex as s             { HEXADECIMAL s }
-  | "(*"                      { parse_comment lexbuf; token lexbuf }
+  | "(*"                      { parse_comment newline lexbuf; token newline lexbuf }
   | "'"                       { QUOTE }
   | ","                       { COMMA }
   | ";"                       { PV }
@@ -112,26 +169,25 @@ rule token = parse
   | "|"                       { BAR }
   | "^"                       { HAT }
   | "|->"                     { MAPS_TO }
-  | "\""                      { parse_string (Buffer.create 1024) lexbuf }
+  | "\""                      { parse_string newline (Buffer.create 1024) lexbuf }
   | eof                       { EOF }
   | _ { raise Error }
 
-and parse_comment = parse
+and parse_comment newline = parse
   | "*)"    { () }
-  | "(*"    { parse_comment lexbuf; parse_comment lexbuf }
+  | "(*"    { parse_comment newline lexbuf; parse_comment newline lexbuf }
   | eof     { raise Error }
-  | _ as c  { if c = '\n' then Lexing.new_line lexbuf;
-              parse_comment lexbuf }
+  | _ as c  { if c = '\n' then newline lexbuf; parse_comment newline lexbuf }
 
-and parse_string str_buf = parse
+and parse_string newline str_buf = parse
   | "\""          { STRING (Buffer.contents str_buf) }
   | "\\" (_ as c) { Buffer.add_char str_buf (escaped_char c);
-                    parse_string str_buf lexbuf }
-  | '\n'          { Lexing.new_line lexbuf;
+                    parse_string newline str_buf lexbuf }
+  | '\n'          { newline lexbuf;
                     Buffer.add_char str_buf '\n';
-                    parse_string str_buf lexbuf }
+                    parse_string newline str_buf lexbuf }
   | eof           { raise Error }
   | _ as c        { Buffer.add_char str_buf c;
-                    parse_string str_buf lexbuf }
+                    parse_string newline str_buf lexbuf }
 
 
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/ae/parseAe.mly b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/ae/parseAe.mly
index 84ceb67bd1adb29855234be9b2ef091c076d56a7..82d4991f2a7d90cca5bba02457ccca17be1c9c00 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/ae/parseAe.mly
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/ae/parseAe.mly
@@ -538,18 +538,18 @@ decl:
     LEFTPAR args=separated_list(COMMA, logic_binder) RIGHTPAR
     COLON ret_ty=primitive_type EQUAL body=lexpr
     { let loc = L.mk_pos $startpos $endpos in
-      S.fun_def ~loc f args ret_ty body }
+      S.fun_def ~loc f [] args ret_ty body }
 
   | PRED p=raw_named_ident EQUAL body=lexpr
     { let loc = L.mk_pos $startpos $endpos in
       let ret_ty = T.prop ~loc () in
-      S.fun_def ~loc p [] ret_ty body }
+      S.fun_def ~loc p [] [] ret_ty body }
 
   | PRED p=raw_named_ident
     LEFTPAR args=separated_list(COMMA, logic_binder) RIGHTPAR EQUAL body=lexpr
     { let loc = L.mk_pos $startpos $endpos in
       let ret_ty = T.prop ~loc () in
-      S.fun_def ~loc p args ret_ty body }
+      S.fun_def ~loc p [] args ret_ty body }
 
   | AXIOM name=decl_ident COLON body=lexpr
     { let loc = L.mk_pos $startpos $endpos in
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/ae/syntax.messages b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/ae/syntax.messages
new file mode 100644
index 0000000000000000000000000000000000000000..cba510baf204caf7a5b529d272b39b10e8a18fa7
--- /dev/null
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/ae/syntax.messages
@@ -0,0 +1,3981 @@
+input: XOR
+##
+## Ends in an error in state: 362.
+##
+## input' -> . input [ # ]
+##
+## The known suffix of the stack is as follows:
+##
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: AXIOM ID COLON VOID WITH
+##
+## Ends in an error in state: 356.
+##
+## decl -> AXIOM decl_ident COLON lexpr . [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM ]
+## lexpr -> lexpr . PLUS lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . MINUS lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . TIMES lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . SLASH lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . PERCENT lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . POW lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . POWDOT lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . AND lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . OR lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . XOR lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . LRARROW lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . RIGHTARROW lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . LT lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . LE lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . GT lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . GE lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . EQUAL lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . NOTEQ lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . HAT LEFTBR INTEGER COMMA INTEGER RIGHTBR [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . AT lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## AXIOM decl_ident COLON lexpr
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 123, spurious reduction of production lexpr -> simple_expr 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: AXIOM ID COLON XOR
+##
+## Ends in an error in state: 355.
+##
+## decl -> AXIOM decl_ident COLON . lexpr [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM ]
+##
+## The known suffix of the stack is as follows:
+## AXIOM decl_ident COLON
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: AXIOM ID XOR
+##
+## Ends in an error in state: 354.
+##
+## decl -> AXIOM decl_ident . COLON lexpr [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM ]
+##
+## The known suffix of the stack is as follows:
+## AXIOM decl_ident
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: AXIOM XOR
+##
+## Ends in an error in state: 353.
+##
+## decl -> AXIOM . decl_ident COLON lexpr [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM ]
+##
+## The known suffix of the stack is as follows:
+## AXIOM
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: FUNC ID EQUAL
+##
+## Ends in an error in state: 345.
+##
+## decl -> FUNC raw_named_ident . LEFTPAR loption(separated_nonempty_list(COMMA,logic_binder)) RIGHTPAR COLON primitive_type EQUAL lexpr [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM ]
+##
+## The known suffix of the stack is as follows:
+## FUNC raw_named_ident
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 108, spurious reduction of production raw_named_ident -> ID 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: FUNC ID LEFTPAR RIGHTPAR COLON UNIT EQUAL VOID WITH
+##
+## Ends in an error in state: 352.
+##
+## decl -> FUNC raw_named_ident LEFTPAR loption(separated_nonempty_list(COMMA,logic_binder)) RIGHTPAR COLON primitive_type EQUAL lexpr . [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM ]
+## lexpr -> lexpr . PLUS lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . MINUS lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . TIMES lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . SLASH lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . PERCENT lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . POW lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . POWDOT lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . AND lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . OR lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . XOR lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . LRARROW lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . RIGHTARROW lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . LT lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . LE lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . GT lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . GE lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . EQUAL lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . NOTEQ lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . HAT LEFTBR INTEGER COMMA INTEGER RIGHTBR [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . AT lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## FUNC raw_named_ident LEFTPAR loption(separated_nonempty_list(COMMA,logic_binder)) RIGHTPAR COLON primitive_type EQUAL lexpr
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 123, spurious reduction of production lexpr -> simple_expr 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: FUNC ID LEFTPAR RIGHTPAR COLON UNIT EQUAL XOR
+##
+## Ends in an error in state: 351.
+##
+## decl -> FUNC raw_named_ident LEFTPAR loption(separated_nonempty_list(COMMA,logic_binder)) RIGHTPAR COLON primitive_type EQUAL . lexpr [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM ]
+##
+## The known suffix of the stack is as follows:
+## FUNC raw_named_ident LEFTPAR loption(separated_nonempty_list(COMMA,logic_binder)) RIGHTPAR COLON primitive_type EQUAL
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: FUNC ID LEFTPAR RIGHTPAR COLON UNIT XOR
+##
+## Ends in an error in state: 350.
+##
+## decl -> FUNC raw_named_ident LEFTPAR loption(separated_nonempty_list(COMMA,logic_binder)) RIGHTPAR COLON primitive_type . EQUAL lexpr [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM ]
+## primitive_type -> primitive_type . ident [ ID EQUAL ]
+##
+## The known suffix of the stack is as follows:
+## FUNC raw_named_ident LEFTPAR loption(separated_nonempty_list(COMMA,logic_binder)) RIGHTPAR COLON primitive_type
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: FUNC ID LEFTPAR RIGHTPAR COLON XOR
+##
+## Ends in an error in state: 349.
+##
+## decl -> FUNC raw_named_ident LEFTPAR loption(separated_nonempty_list(COMMA,logic_binder)) RIGHTPAR COLON . primitive_type EQUAL lexpr [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM ]
+##
+## The known suffix of the stack is as follows:
+## FUNC raw_named_ident LEFTPAR loption(separated_nonempty_list(COMMA,logic_binder)) RIGHTPAR COLON
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: FUNC ID LEFTPAR RIGHTPAR XOR
+##
+## Ends in an error in state: 348.
+##
+## decl -> FUNC raw_named_ident LEFTPAR loption(separated_nonempty_list(COMMA,logic_binder)) RIGHTPAR . COLON primitive_type EQUAL lexpr [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM ]
+##
+## The known suffix of the stack is as follows:
+## FUNC raw_named_ident LEFTPAR loption(separated_nonempty_list(COMMA,logic_binder)) RIGHTPAR
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: FUNC ID LEFTPAR XOR
+##
+## Ends in an error in state: 346.
+##
+## decl -> FUNC raw_named_ident LEFTPAR . loption(separated_nonempty_list(COMMA,logic_binder)) RIGHTPAR COLON primitive_type EQUAL lexpr [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM ]
+##
+## The known suffix of the stack is as follows:
+## FUNC raw_named_ident LEFTPAR
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: FUNC XOR
+##
+## Ends in an error in state: 344.
+##
+## decl -> FUNC . raw_named_ident LEFTPAR loption(separated_nonempty_list(COMMA,logic_binder)) RIGHTPAR COLON primitive_type EQUAL lexpr [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM ]
+##
+## The known suffix of the stack is as follows:
+## FUNC
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: GOAL ID COLON VOID WITH
+##
+## Ends in an error in state: 343.
+##
+## decl -> GOAL decl_ident COLON lexpr . [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM ]
+## lexpr -> lexpr . PLUS lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . MINUS lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . TIMES lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . SLASH lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . PERCENT lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . POW lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . POWDOT lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . AND lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . OR lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . XOR lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . LRARROW lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . RIGHTARROW lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . LT lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . LE lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . GT lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . GE lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . EQUAL lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . NOTEQ lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . HAT LEFTBR INTEGER COMMA INTEGER RIGHTBR [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . AT lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## GOAL decl_ident COLON lexpr
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 123, spurious reduction of production lexpr -> simple_expr 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: GOAL ID COLON XOR
+##
+## Ends in an error in state: 342.
+##
+## decl -> GOAL decl_ident COLON . lexpr [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM ]
+##
+## The known suffix of the stack is as follows:
+## GOAL decl_ident COLON
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: GOAL ID XOR
+##
+## Ends in an error in state: 341.
+##
+## decl -> GOAL decl_ident . COLON lexpr [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM ]
+##
+## The known suffix of the stack is as follows:
+## GOAL decl_ident
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: GOAL XOR
+##
+## Ends in an error in state: 340.
+##
+## decl -> GOAL . decl_ident COLON lexpr [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM ]
+##
+## The known suffix of the stack is as follows:
+## GOAL
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: LOGIC AC XOR
+##
+## Ends in an error in state: 325.
+##
+## decl -> LOGIC ac_modifier . separated_nonempty_list(COMMA,raw_named_ident) COLON logic_type [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM ]
+##
+## The known suffix of the stack is as follows:
+## LOGIC ac_modifier
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: LOGIC ID COLON BITV LEFTSQ INTEGER XOR
+##
+## Ends in an error in state: 29.
+##
+## primitive_type -> BITV LEFTSQ INTEGER . RIGHTSQ [ XOR WITH TYPE TIMES THEORY THEN SLASH SHARP RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING QM_ID QM PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTSQ LEFTBR LEFTARROW LE IN ID HAT GT GOAL GE FUNC EQUAL EOF END ELSE DOT COMMA COLON CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## BITV LEFTSQ INTEGER
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: LOGIC ID COLON BITV LEFTSQ XOR
+##
+## Ends in an error in state: 28.
+##
+## primitive_type -> BITV LEFTSQ . INTEGER RIGHTSQ [ XOR WITH TYPE TIMES THEORY THEN SLASH SHARP RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING QM_ID QM PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTSQ LEFTBR LEFTARROW LE IN ID HAT GT GOAL GE FUNC EQUAL EOF END ELSE DOT COMMA COLON CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## BITV LEFTSQ
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: LOGIC ID COLON BITV XOR
+##
+## Ends in an error in state: 27.
+##
+## primitive_type -> BITV . LEFTSQ INTEGER RIGHTSQ [ XOR WITH TYPE TIMES THEORY THEN SLASH SHARP RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING QM_ID QM PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTSQ LEFTBR LEFTARROW LE IN ID HAT GT GOAL GE FUNC EQUAL EOF END ELSE DOT COMMA COLON CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## BITV
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: LOGIC ID COLON LEFTPAR UNIT RIGHTARROW
+##
+## Ends in an error in state: 32.
+##
+## primitive_type -> LEFTPAR separated_nonempty_list(COMMA,primitive_type) . RIGHTPAR ident [ XOR WITH TYPE TIMES THEORY THEN SLASH SHARP RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING QM_ID QM PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTSQ LEFTBR LEFTARROW LE IN ID HAT GT GOAL GE FUNC EQUAL EOF END ELSE DOT COMMA COLON CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## LEFTPAR separated_nonempty_list(COMMA,primitive_type)
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 36, spurious reduction of production separated_nonempty_list(COMMA,primitive_type) -> primitive_type 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: LOGIC ID COLON LEFTPAR UNIT RIGHTPAR XOR
+##
+## Ends in an error in state: 33.
+##
+## primitive_type -> LEFTPAR separated_nonempty_list(COMMA,primitive_type) RIGHTPAR . ident [ XOR WITH TYPE TIMES THEORY THEN SLASH SHARP RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING QM_ID QM PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTSQ LEFTBR LEFTARROW LE IN ID HAT GT GOAL GE FUNC EQUAL EOF END ELSE DOT COMMA COLON CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## LEFTPAR separated_nonempty_list(COMMA,primitive_type) RIGHTPAR
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: LOGIC ID COLON LEFTPAR UNIT XOR
+##
+## Ends in an error in state: 36.
+##
+## primitive_type -> primitive_type . ident [ RIGHTPAR RIGHTARROW ID COMMA ]
+## separated_nonempty_list(COMMA,primitive_type) -> primitive_type . [ RIGHTPAR RIGHTARROW ]
+## separated_nonempty_list(COMMA,primitive_type) -> primitive_type . COMMA separated_nonempty_list(COMMA,primitive_type) [ RIGHTPAR RIGHTARROW ]
+##
+## The known suffix of the stack is as follows:
+## primitive_type
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: LOGIC ID COLON LEFTPAR XOR
+##
+## Ends in an error in state: 24.
+##
+## primitive_type -> LEFTPAR . separated_nonempty_list(COMMA,primitive_type) RIGHTPAR ident [ XOR WITH TYPE TIMES THEORY THEN SLASH SHARP RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING QM_ID QM PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTSQ LEFTBR LEFTARROW LE IN ID HAT GT GOAL GE FUNC EQUAL EOF END ELSE DOT COMMA COLON CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## LEFTPAR
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: LOGIC ID COLON PROP XOR
+##
+## Ends in an error in state: 360.
+##
+## list(decl) -> decl . list(decl) [ EOF ]
+##
+## The known suffix of the stack is as follows:
+## decl
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: LOGIC ID COLON RIGHTARROW UNIT XOR
+##
+## Ends in an error in state: 335.
+##
+## primitive_type -> primitive_type . ident [ TYPE THEORY REWRITING PRED LOGIC ID GOAL FUNC EOF AXIOM ]
+## primitive_type_or_prop -> primitive_type . [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM ]
+##
+## The known suffix of the stack is as follows:
+## primitive_type
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: LOGIC ID COLON RIGHTARROW XOR
+##
+## Ends in an error in state: 333.
+##
+## logic_type -> loption(separated_nonempty_list(COMMA,primitive_type)) RIGHTARROW . primitive_type_or_prop [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM ]
+##
+## The known suffix of the stack is as follows:
+## loption(separated_nonempty_list(COMMA,primitive_type)) RIGHTARROW
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: LOGIC ID COLON UNIT COMMA BOOL RIGHTPAR
+##
+## Ends in an error in state: 332.
+##
+## logic_type -> loption(separated_nonempty_list(COMMA,primitive_type)) . RIGHTARROW primitive_type_or_prop [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM ]
+##
+## The known suffix of the stack is as follows:
+## loption(separated_nonempty_list(COMMA,primitive_type))
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 36, spurious reduction of production separated_nonempty_list(COMMA,primitive_type) -> primitive_type 
+## In state 38, spurious reduction of production separated_nonempty_list(COMMA,primitive_type) -> primitive_type COMMA separated_nonempty_list(COMMA,primitive_type) 
+## In state 329, spurious reduction of production loption(separated_nonempty_list(COMMA,primitive_type)) -> separated_nonempty_list(COMMA,primitive_type) 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: LOGIC ID COLON UNIT COMMA XOR
+##
+## Ends in an error in state: 37.
+##
+## separated_nonempty_list(COMMA,primitive_type) -> primitive_type COMMA . separated_nonempty_list(COMMA,primitive_type) [ RIGHTPAR RIGHTARROW ]
+##
+## The known suffix of the stack is as follows:
+## primitive_type COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: LOGIC ID COLON UNIT XOR
+##
+## Ends in an error in state: 331.
+##
+## primitive_type -> primitive_type . ident [ TYPE THEORY RIGHTARROW REWRITING PRED LOGIC ID GOAL FUNC EOF COMMA AXIOM ]
+## primitive_type_or_prop -> primitive_type . [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM ]
+## separated_nonempty_list(COMMA,primitive_type) -> primitive_type . [ RIGHTARROW ]
+## separated_nonempty_list(COMMA,primitive_type) -> primitive_type . COMMA separated_nonempty_list(COMMA,primitive_type) [ RIGHTARROW ]
+##
+## The known suffix of the stack is as follows:
+## primitive_type
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: LOGIC ID COLON XOR
+##
+## Ends in an error in state: 327.
+##
+## decl -> LOGIC ac_modifier separated_nonempty_list(COMMA,raw_named_ident) COLON . logic_type [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM ]
+##
+## The known suffix of the stack is as follows:
+## LOGIC ac_modifier separated_nonempty_list(COMMA,raw_named_ident) COLON
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: LOGIC ID COMMA XOR
+##
+## Ends in an error in state: 338.
+##
+## separated_nonempty_list(COMMA,raw_named_ident) -> raw_named_ident COMMA . separated_nonempty_list(COMMA,raw_named_ident) [ COLON ]
+##
+## The known suffix of the stack is as follows:
+## raw_named_ident COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: LOGIC ID LEFTPAR
+##
+## Ends in an error in state: 337.
+##
+## separated_nonempty_list(COMMA,raw_named_ident) -> raw_named_ident . [ COLON ]
+## separated_nonempty_list(COMMA,raw_named_ident) -> raw_named_ident . COMMA separated_nonempty_list(COMMA,raw_named_ident) [ COLON ]
+##
+## The known suffix of the stack is as follows:
+## raw_named_ident
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 108, spurious reduction of production raw_named_ident -> ID 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: LOGIC XOR
+##
+## Ends in an error in state: 323.
+##
+## decl -> LOGIC . ac_modifier separated_nonempty_list(COMMA,raw_named_ident) COLON logic_type [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM ]
+##
+## The known suffix of the stack is as follows:
+## LOGIC
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: PRED ID COMMA
+##
+## Ends in an error in state: 308.
+##
+## decl -> PRED raw_named_ident . EQUAL lexpr [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM ]
+## decl -> PRED raw_named_ident . LEFTPAR loption(separated_nonempty_list(COMMA,logic_binder)) RIGHTPAR EQUAL lexpr [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM ]
+##
+## The known suffix of the stack is as follows:
+## PRED raw_named_ident
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 108, spurious reduction of production raw_named_ident -> ID 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: PRED ID EQUAL VOID WITH
+##
+## Ends in an error in state: 322.
+##
+## decl -> PRED raw_named_ident EQUAL lexpr . [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM ]
+## lexpr -> lexpr . PLUS lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . MINUS lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . TIMES lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . SLASH lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . PERCENT lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . POW lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . POWDOT lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . AND lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . OR lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . XOR lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . LRARROW lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . RIGHTARROW lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . LT lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . LE lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . GT lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . GE lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . EQUAL lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . NOTEQ lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . HAT LEFTBR INTEGER COMMA INTEGER RIGHTBR [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . AT lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## PRED raw_named_ident EQUAL lexpr
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 123, spurious reduction of production lexpr -> simple_expr 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: PRED ID EQUAL XOR
+##
+## Ends in an error in state: 321.
+##
+## decl -> PRED raw_named_ident EQUAL . lexpr [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM ]
+##
+## The known suffix of the stack is as follows:
+## PRED raw_named_ident EQUAL
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: PRED ID LEFTPAR ID COLON BOOL COMMA XOR
+##
+## Ends in an error in state: 316.
+##
+## separated_nonempty_list(COMMA,logic_binder) -> logic_binder COMMA . separated_nonempty_list(COMMA,logic_binder) [ RIGHTPAR ]
+##
+## The known suffix of the stack is as follows:
+## logic_binder COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: PRED ID LEFTPAR ID COLON UNIT XOR
+##
+## Ends in an error in state: 320.
+##
+## logic_binder -> ident COLON primitive_type . [ RIGHTPAR COMMA ]
+## primitive_type -> primitive_type . ident [ RIGHTPAR ID COMMA ]
+##
+## The known suffix of the stack is as follows:
+## ident COLON primitive_type
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: PRED ID LEFTPAR ID COLON XOR
+##
+## Ends in an error in state: 319.
+##
+## logic_binder -> ident COLON . primitive_type [ RIGHTPAR COMMA ]
+##
+## The known suffix of the stack is as follows:
+## ident COLON
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: PRED ID LEFTPAR ID XOR
+##
+## Ends in an error in state: 318.
+##
+## logic_binder -> ident . COLON primitive_type [ RIGHTPAR COMMA ]
+##
+## The known suffix of the stack is as follows:
+## ident
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: PRED ID LEFTPAR RIGHTPAR EQUAL VOID WITH
+##
+## Ends in an error in state: 314.
+##
+## decl -> PRED raw_named_ident LEFTPAR loption(separated_nonempty_list(COMMA,logic_binder)) RIGHTPAR EQUAL lexpr . [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM ]
+## lexpr -> lexpr . PLUS lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . MINUS lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . TIMES lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . SLASH lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . PERCENT lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . POW lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . POWDOT lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . AND lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . OR lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . XOR lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . LRARROW lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . RIGHTARROW lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . LT lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . LE lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . GT lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . GE lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . EQUAL lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . NOTEQ lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . HAT LEFTBR INTEGER COMMA INTEGER RIGHTBR [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . AT lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## PRED raw_named_ident LEFTPAR loption(separated_nonempty_list(COMMA,logic_binder)) RIGHTPAR EQUAL lexpr
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 123, spurious reduction of production lexpr -> simple_expr 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: PRED ID LEFTPAR RIGHTPAR EQUAL XOR
+##
+## Ends in an error in state: 313.
+##
+## decl -> PRED raw_named_ident LEFTPAR loption(separated_nonempty_list(COMMA,logic_binder)) RIGHTPAR EQUAL . lexpr [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM ]
+##
+## The known suffix of the stack is as follows:
+## PRED raw_named_ident LEFTPAR loption(separated_nonempty_list(COMMA,logic_binder)) RIGHTPAR EQUAL
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: PRED ID LEFTPAR RIGHTPAR XOR
+##
+## Ends in an error in state: 312.
+##
+## decl -> PRED raw_named_ident LEFTPAR loption(separated_nonempty_list(COMMA,logic_binder)) RIGHTPAR . EQUAL lexpr [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM ]
+##
+## The known suffix of the stack is as follows:
+## PRED raw_named_ident LEFTPAR loption(separated_nonempty_list(COMMA,logic_binder)) RIGHTPAR
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: PRED ID LEFTPAR XOR
+##
+## Ends in an error in state: 309.
+##
+## decl -> PRED raw_named_ident LEFTPAR . loption(separated_nonempty_list(COMMA,logic_binder)) RIGHTPAR EQUAL lexpr [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM ]
+##
+## The known suffix of the stack is as follows:
+## PRED raw_named_ident LEFTPAR
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: PRED ID XOR
+##
+## Ends in an error in state: 108.
+##
+## raw_named_ident -> ID . [ LEFTPAR EQUAL COMMA COLON ]
+## raw_named_ident -> ID . STRING [ LEFTPAR EQUAL COMMA COLON ]
+##
+## The known suffix of the stack is as follows:
+## ID
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: PRED XOR
+##
+## Ends in an error in state: 307.
+##
+## decl -> PRED . raw_named_ident EQUAL lexpr [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM ]
+## decl -> PRED . raw_named_ident LEFTPAR loption(separated_nonempty_list(COMMA,logic_binder)) RIGHTPAR EQUAL lexpr [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM ]
+##
+## The known suffix of the stack is as follows:
+## PRED
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON CHECK XOR
+##
+## Ends in an error in state: 122.
+##
+## lexpr -> CHECK . lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## CHECK
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON CUT XOR
+##
+## Ends in an error in state: 121.
+##
+## lexpr -> CUT . lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## CUT
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON DISTINCT LEFTPAR VOID COMMA VOID WITH
+##
+## Ends in an error in state: 203.
+##
+## lexpr -> lexpr . PLUS lexpr [ XOR TIMES SLASH RIGHTPAR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . MINUS lexpr [ XOR TIMES SLASH RIGHTPAR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . TIMES lexpr [ XOR TIMES SLASH RIGHTPAR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . SLASH lexpr [ XOR TIMES SLASH RIGHTPAR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . PERCENT lexpr [ XOR TIMES SLASH RIGHTPAR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . POW lexpr [ XOR TIMES SLASH RIGHTPAR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . POWDOT lexpr [ XOR TIMES SLASH RIGHTPAR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . AND lexpr [ XOR TIMES SLASH RIGHTPAR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . OR lexpr [ XOR TIMES SLASH RIGHTPAR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . XOR lexpr [ XOR TIMES SLASH RIGHTPAR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . LRARROW lexpr [ XOR TIMES SLASH RIGHTPAR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . RIGHTARROW lexpr [ XOR TIMES SLASH RIGHTPAR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . LT lexpr [ XOR TIMES SLASH RIGHTPAR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . LE lexpr [ XOR TIMES SLASH RIGHTPAR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . GT lexpr [ XOR TIMES SLASH RIGHTPAR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . GE lexpr [ XOR TIMES SLASH RIGHTPAR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . EQUAL lexpr [ XOR TIMES SLASH RIGHTPAR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . NOTEQ lexpr [ XOR TIMES SLASH RIGHTPAR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . HAT LEFTBR INTEGER COMMA INTEGER RIGHTBR [ XOR TIMES SLASH RIGHTPAR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . AT lexpr [ XOR TIMES SLASH RIGHTPAR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## list2_lexpr_sep_comma -> lexpr . COMMA lexpr [ RIGHTPAR ]
+## list2_lexpr_sep_comma -> lexpr COMMA lexpr . [ RIGHTPAR ]
+## list2_lexpr_sep_comma -> lexpr . COMMA list2_lexpr_sep_comma [ RIGHTPAR ]
+##
+## The known suffix of the stack is as follows:
+## lexpr COMMA lexpr
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 123, spurious reduction of production lexpr -> simple_expr 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON DISTINCT LEFTPAR VOID COMMA XOR
+##
+## Ends in an error in state: 201.
+##
+## list2_lexpr_sep_comma -> lexpr COMMA . lexpr [ RIGHTPAR ]
+## list2_lexpr_sep_comma -> lexpr COMMA . list2_lexpr_sep_comma [ RIGHTPAR ]
+##
+## The known suffix of the stack is as follows:
+## lexpr COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON DISTINCT LEFTPAR VOID WITH
+##
+## Ends in an error in state: 200.
+##
+## lexpr -> lexpr . PLUS lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . MINUS lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . TIMES lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . SLASH lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . PERCENT lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . POW lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . POWDOT lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . AND lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . OR lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . XOR lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . LRARROW lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . RIGHTARROW lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . LT lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . LE lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . GT lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . GE lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . EQUAL lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . NOTEQ lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . HAT LEFTBR INTEGER COMMA INTEGER RIGHTBR [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . AT lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## list2_lexpr_sep_comma -> lexpr . COMMA lexpr [ RIGHTPAR ]
+## list2_lexpr_sep_comma -> lexpr . COMMA list2_lexpr_sep_comma [ RIGHTPAR ]
+##
+## The known suffix of the stack is as follows:
+## lexpr
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 123, spurious reduction of production lexpr -> simple_expr 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON DISTINCT LEFTPAR XOR
+##
+## Ends in an error in state: 120.
+##
+## lexpr -> DISTINCT LEFTPAR . list2_lexpr_sep_comma RIGHTPAR [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## DISTINCT LEFTPAR
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON DISTINCT XOR
+##
+## Ends in an error in state: 119.
+##
+## lexpr -> DISTINCT . LEFTPAR list2_lexpr_sep_comma RIGHTPAR [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## DISTINCT
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON EXISTS ID COLON BOOL DOT LEFTSQ BAR INTEGER BAR RIGHTSQ VOID
+##
+## Ends in an error in state: 208.
+##
+## lexpr -> lexpr . PLUS lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . MINUS lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . TIMES lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . SLASH lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . PERCENT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . POW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . POWDOT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . AND lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . OR lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . XOR lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LRARROW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . RIGHTARROW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LE lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . GT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . GE lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . EQUAL lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . NOTEQ lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . HAT LEFTBR INTEGER COMMA INTEGER RIGHTBR [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . AT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> EXISTS separated_nonempty_list(COMMA,multi_logic_binder) triggers filters DOT lexpr . [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## EXISTS separated_nonempty_list(COMMA,multi_logic_binder) triggers filters DOT lexpr
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON EXISTS ID COLON BOOL DOT XOR
+##
+## Ends in an error in state: 207.
+##
+## lexpr -> EXISTS separated_nonempty_list(COMMA,multi_logic_binder) triggers filters DOT . lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## EXISTS separated_nonempty_list(COMMA,multi_logic_binder) triggers filters DOT
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON EXISTS ID COLON BOOL LEFTBR VOID RIGHTBR DISTINCT
+##
+## Ends in an error in state: 206.
+##
+## lexpr -> EXISTS separated_nonempty_list(COMMA,multi_logic_binder) triggers filters . DOT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## EXISTS separated_nonempty_list(COMMA,multi_logic_binder) triggers filters
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON EXISTS ID COLON BOOL LEFTSQ DECIMAL RIGHTSQ DISTINCT
+##
+## Ends in an error in state: 117.
+##
+## lexpr -> EXISTS separated_nonempty_list(COMMA,multi_logic_binder) triggers . filters DOT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## EXISTS separated_nonempty_list(COMMA,multi_logic_binder) triggers
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON EXISTS XOR
+##
+## Ends in an error in state: 115.
+##
+## lexpr -> EXISTS . separated_nonempty_list(COMMA,multi_logic_binder) triggers filters DOT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## EXISTS
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON FORALL ID COLON BOOL COMMA XOR
+##
+## Ends in an error in state: 214.
+##
+## separated_nonempty_list(COMMA,multi_logic_binder) -> multi_logic_binder COMMA . separated_nonempty_list(COMMA,multi_logic_binder) [ LEFTSQ LEFTBR DOT ]
+##
+## The known suffix of the stack is as follows:
+## multi_logic_binder COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON FORALL ID COLON BOOL DOT LEFTSQ BAR INTEGER BAR RIGHTSQ VOID
+##
+## Ends in an error in state: 250.
+##
+## lexpr -> lexpr . PLUS lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . MINUS lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . TIMES lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . SLASH lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . PERCENT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . POW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . POWDOT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . AND lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . OR lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . XOR lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LRARROW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . RIGHTARROW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LE lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . GT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . GE lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . EQUAL lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . NOTEQ lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . HAT LEFTBR INTEGER COMMA INTEGER RIGHTBR [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . AT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> FORALL separated_nonempty_list(COMMA,multi_logic_binder) triggers filters DOT lexpr . [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## FORALL separated_nonempty_list(COMMA,multi_logic_binder) triggers filters DOT lexpr
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON FORALL ID COLON BOOL DOT XOR
+##
+## Ends in an error in state: 249.
+##
+## lexpr -> FORALL separated_nonempty_list(COMMA,multi_logic_binder) triggers filters DOT . lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## FORALL separated_nonempty_list(COMMA,multi_logic_binder) triggers filters DOT
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON FORALL ID COLON BOOL LEFTBR DECIMAL RIGHTBR DISTINCT
+##
+## Ends in an error in state: 248.
+##
+## lexpr -> FORALL separated_nonempty_list(COMMA,multi_logic_binder) triggers filters . DOT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## FORALL separated_nonempty_list(COMMA,multi_logic_binder) triggers filters
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON FORALL ID COLON BOOL LEFTBR VOID RIGHTPAR
+##
+## Ends in an error in state: 204.
+##
+## filters -> LEFTBR separated_nonempty_list(COMMA,lexpr) . RIGHTBR [ DOT ]
+##
+## The known suffix of the stack is as follows:
+## LEFTBR separated_nonempty_list(COMMA,lexpr)
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 123, spurious reduction of production lexpr -> simple_expr 
+## In state 148, spurious reduction of production separated_nonempty_list(COMMA,lexpr) -> lexpr 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON FORALL ID COLON BOOL LEFTBR XOR
+##
+## Ends in an error in state: 118.
+##
+## filters -> LEFTBR . separated_nonempty_list(COMMA,lexpr) RIGHTBR [ DOT ]
+##
+## The known suffix of the stack is as follows:
+## LEFTBR
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON FORALL ID COLON BOOL LEFTSQ ID MAPS_TO VOID WITH
+##
+## Ends in an error in state: 222.
+##
+## lexpr -> lexpr . PLUS lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA BAR AT AND ]
+## lexpr -> lexpr . MINUS lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA BAR AT AND ]
+## lexpr -> lexpr . TIMES lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA BAR AT AND ]
+## lexpr -> lexpr . SLASH lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA BAR AT AND ]
+## lexpr -> lexpr . PERCENT lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA BAR AT AND ]
+## lexpr -> lexpr . POW lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA BAR AT AND ]
+## lexpr -> lexpr . POWDOT lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA BAR AT AND ]
+## lexpr -> lexpr . AND lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA BAR AT AND ]
+## lexpr -> lexpr . OR lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA BAR AT AND ]
+## lexpr -> lexpr . XOR lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA BAR AT AND ]
+## lexpr -> lexpr . LRARROW lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA BAR AT AND ]
+## lexpr -> lexpr . RIGHTARROW lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA BAR AT AND ]
+## lexpr -> lexpr . LT lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA BAR AT AND ]
+## lexpr -> lexpr . LE lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA BAR AT AND ]
+## lexpr -> lexpr . GT lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA BAR AT AND ]
+## lexpr -> lexpr . GE lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA BAR AT AND ]
+## lexpr -> lexpr . EQUAL lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA BAR AT AND ]
+## lexpr -> lexpr . NOTEQ lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA BAR AT AND ]
+## lexpr -> lexpr . HAT LEFTBR INTEGER COMMA INTEGER RIGHTBR [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA BAR AT AND ]
+## lexpr -> lexpr . AT lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA BAR AT AND ]
+## lexpr_or_dom -> raw_ident MAPS_TO lexpr . [ RIGHTSQ COMMA BAR ]
+##
+## The known suffix of the stack is as follows:
+## raw_ident MAPS_TO lexpr
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 123, spurious reduction of production lexpr -> simple_expr 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON FORALL ID COLON BOOL LEFTSQ ID MAPS_TO XOR
+##
+## Ends in an error in state: 221.
+##
+## lexpr_or_dom -> raw_ident MAPS_TO . lexpr [ RIGHTSQ COMMA BAR ]
+##
+## The known suffix of the stack is as follows:
+## raw_ident MAPS_TO
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON FORALL ID COLON BOOL LEFTSQ ID WITH
+##
+## Ends in an error in state: 220.
+##
+## ident -> raw_ident . [ XOR TIMES SLASH SHARP RIGHTSQ RIGHTARROW QM_ID QM POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LEFTSQ LEFTPAR LE IN HAT GT GE EQUAL DOT COMMA COLON BAR AT AND ]
+## lexpr_or_dom -> raw_ident . MAPS_TO lexpr [ RIGHTSQ COMMA BAR ]
+##
+## The known suffix of the stack is as follows:
+## raw_ident
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON FORALL ID COLON BOOL LEFTSQ VOID BAR XOR
+##
+## Ends in an error in state: 217.
+##
+## separated_nonempty_list(BAR,trigger) -> trigger BAR . separated_nonempty_list(BAR,trigger) [ RIGHTSQ ]
+##
+## The known suffix of the stack is as follows:
+## trigger BAR
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON FORALL ID COLON BOOL LEFTSQ VOID COMMA XOR
+##
+## Ends in an error in state: 224.
+##
+## separated_nonempty_list(COMMA,lexpr_or_dom) -> lexpr_or_dom COMMA . separated_nonempty_list(COMMA,lexpr_or_dom) [ RIGHTSQ BAR ]
+##
+## The known suffix of the stack is as follows:
+## lexpr_or_dom COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON FORALL ID COLON BOOL LEFTSQ VOID IN LEFTSQ QM_ID COMMA DECIMAL RIGHTSQ XOR
+##
+## Ends in an error in state: 223.
+##
+## separated_nonempty_list(COMMA,lexpr_or_dom) -> lexpr_or_dom . [ RIGHTSQ BAR ]
+## separated_nonempty_list(COMMA,lexpr_or_dom) -> lexpr_or_dom . COMMA separated_nonempty_list(COMMA,lexpr_or_dom) [ RIGHTSQ BAR ]
+##
+## The known suffix of the stack is as follows:
+## lexpr_or_dom
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON FORALL ID COLON BOOL LEFTSQ VOID IN RIGHTSQ MINUS XOR
+##
+## Ends in an error in state: 233.
+##
+## bound -> MINUS . INTEGER [ RIGHTSQ LEFTSQ COMMA ]
+## bound -> MINUS . DECIMAL [ RIGHTSQ LEFTSQ COMMA ]
+## bound -> MINUS . HEXADECIMAL [ RIGHTSQ LEFTSQ COMMA ]
+##
+## The known suffix of the stack is as follows:
+## MINUS
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON FORALL ID COLON BOOL LEFTSQ VOID IN RIGHTSQ QM_ID COMMA QM_ID XOR
+##
+## Ends in an error in state: 243.
+##
+## lexpr_or_dom -> lexpr IN sq bound COMMA bound . sq [ RIGHTSQ COMMA BAR ]
+##
+## The known suffix of the stack is as follows:
+## lexpr IN sq bound COMMA bound
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON FORALL ID COLON BOOL LEFTSQ VOID IN RIGHTSQ QM_ID COMMA XOR
+##
+## Ends in an error in state: 242.
+##
+## lexpr_or_dom -> lexpr IN sq bound COMMA . bound sq [ RIGHTSQ COMMA BAR ]
+##
+## The known suffix of the stack is as follows:
+## lexpr IN sq bound COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON FORALL ID COLON BOOL LEFTSQ VOID IN RIGHTSQ QM_ID XOR
+##
+## Ends in an error in state: 241.
+##
+## lexpr_or_dom -> lexpr IN sq bound . COMMA bound sq [ RIGHTSQ COMMA BAR ]
+##
+## The known suffix of the stack is as follows:
+## lexpr IN sq bound
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON FORALL ID COLON BOOL LEFTSQ VOID IN RIGHTSQ XOR
+##
+## Ends in an error in state: 230.
+##
+## lexpr_or_dom -> lexpr IN sq . bound COMMA bound sq [ RIGHTSQ COMMA BAR ]
+##
+## The known suffix of the stack is as follows:
+## lexpr IN sq
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON FORALL ID COLON BOOL LEFTSQ VOID IN XOR
+##
+## Ends in an error in state: 227.
+##
+## lexpr_or_dom -> lexpr IN . sq bound COMMA bound sq [ RIGHTSQ COMMA BAR ]
+##
+## The known suffix of the stack is as follows:
+## lexpr IN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON FORALL ID COLON BOOL LEFTSQ VOID RIGHTSQ DISTINCT
+##
+## Ends in an error in state: 247.
+##
+## lexpr -> FORALL separated_nonempty_list(COMMA,multi_logic_binder) triggers . filters DOT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## FORALL separated_nonempty_list(COMMA,multi_logic_binder) triggers
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON FORALL ID COLON BOOL LEFTSQ VOID WITH
+##
+## Ends in an error in state: 226.
+##
+## lexpr -> lexpr . PLUS lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE IN HAT GT GE EQUAL COMMA BAR AT AND ]
+## lexpr -> lexpr . MINUS lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE IN HAT GT GE EQUAL COMMA BAR AT AND ]
+## lexpr -> lexpr . TIMES lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE IN HAT GT GE EQUAL COMMA BAR AT AND ]
+## lexpr -> lexpr . SLASH lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE IN HAT GT GE EQUAL COMMA BAR AT AND ]
+## lexpr -> lexpr . PERCENT lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE IN HAT GT GE EQUAL COMMA BAR AT AND ]
+## lexpr -> lexpr . POW lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE IN HAT GT GE EQUAL COMMA BAR AT AND ]
+## lexpr -> lexpr . POWDOT lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE IN HAT GT GE EQUAL COMMA BAR AT AND ]
+## lexpr -> lexpr . AND lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE IN HAT GT GE EQUAL COMMA BAR AT AND ]
+## lexpr -> lexpr . OR lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE IN HAT GT GE EQUAL COMMA BAR AT AND ]
+## lexpr -> lexpr . XOR lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE IN HAT GT GE EQUAL COMMA BAR AT AND ]
+## lexpr -> lexpr . LRARROW lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE IN HAT GT GE EQUAL COMMA BAR AT AND ]
+## lexpr -> lexpr . RIGHTARROW lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE IN HAT GT GE EQUAL COMMA BAR AT AND ]
+## lexpr -> lexpr . LT lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE IN HAT GT GE EQUAL COMMA BAR AT AND ]
+## lexpr -> lexpr . LE lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE IN HAT GT GE EQUAL COMMA BAR AT AND ]
+## lexpr -> lexpr . GT lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE IN HAT GT GE EQUAL COMMA BAR AT AND ]
+## lexpr -> lexpr . GE lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE IN HAT GT GE EQUAL COMMA BAR AT AND ]
+## lexpr -> lexpr . EQUAL lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE IN HAT GT GE EQUAL COMMA BAR AT AND ]
+## lexpr -> lexpr . NOTEQ lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE IN HAT GT GE EQUAL COMMA BAR AT AND ]
+## lexpr -> lexpr . HAT LEFTBR INTEGER COMMA INTEGER RIGHTBR [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE IN HAT GT GE EQUAL COMMA BAR AT AND ]
+## lexpr -> lexpr . AT lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE IN HAT GT GE EQUAL COMMA BAR AT AND ]
+## lexpr_or_dom -> lexpr . [ RIGHTSQ COMMA BAR ]
+## lexpr_or_dom -> lexpr . IN sq bound COMMA bound sq [ RIGHTSQ COMMA BAR ]
+##
+## The known suffix of the stack is as follows:
+## lexpr
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 123, spurious reduction of production lexpr -> simple_expr 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON FORALL ID COLON BOOL LEFTSQ XOR
+##
+## Ends in an error in state: 114.
+##
+## triggers -> LEFTSQ . separated_nonempty_list(BAR,trigger) RIGHTSQ [ LEFTBR DOT ]
+##
+## The known suffix of the stack is as follows:
+## LEFTSQ
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON FORALL ID COLON UNIT XOR
+##
+## Ends in an error in state: 112.
+##
+## multi_logic_binder -> separated_nonempty_list(COMMA,named_ident) COLON primitive_type . [ LEFTSQ LEFTBR DOT COMMA ]
+## primitive_type -> primitive_type . ident [ LEFTSQ LEFTBR ID DOT COMMA ]
+##
+## The known suffix of the stack is as follows:
+## separated_nonempty_list(COMMA,named_ident) COLON primitive_type
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON FORALL ID COLON XOR
+##
+## Ends in an error in state: 111.
+##
+## multi_logic_binder -> separated_nonempty_list(COMMA,named_ident) COLON . primitive_type [ LEFTSQ LEFTBR DOT COMMA ]
+##
+## The known suffix of the stack is as follows:
+## separated_nonempty_list(COMMA,named_ident) COLON
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON FORALL ID COMMA XOR
+##
+## Ends in an error in state: 211.
+##
+## separated_nonempty_list(COMMA,named_ident) -> named_ident COMMA . separated_nonempty_list(COMMA,named_ident) [ COLON ]
+##
+## The known suffix of the stack is as follows:
+## named_ident COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON FORALL ID LEFTPAR
+##
+## Ends in an error in state: 210.
+##
+## separated_nonempty_list(COMMA,named_ident) -> named_ident . [ COLON ]
+## separated_nonempty_list(COMMA,named_ident) -> named_ident . COMMA separated_nonempty_list(COMMA,named_ident) [ COLON ]
+##
+## The known suffix of the stack is as follows:
+## named_ident
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 108, spurious reduction of production raw_named_ident -> ID 
+## In state 209, spurious reduction of production named_ident -> raw_named_ident 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON FORALL XOR
+##
+## Ends in an error in state: 107.
+##
+## lexpr -> FORALL . separated_nonempty_list(COMMA,multi_logic_binder) triggers filters DOT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## FORALL
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON ID LEFTPAR VOID COMMA XOR
+##
+## Ends in an error in state: 183.
+##
+## separated_nonempty_list(COMMA,lexpr) -> lexpr COMMA . separated_nonempty_list(COMMA,lexpr) [ RIGHTPAR RIGHTBR ]
+##
+## The known suffix of the stack is as follows:
+## lexpr COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON ID LEFTPAR VOID RIGHTBR
+##
+## Ends in an error in state: 146.
+##
+## simple_expr -> ident LEFTPAR loption(separated_nonempty_list(COMMA,lexpr)) . RIGHTPAR [ XOR WITH TYPE TIMES THEORY THEN SLASH SHARP RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING QM_ID QM PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTSQ LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE DOT COMMA COLON CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## ident LEFTPAR loption(separated_nonempty_list(COMMA,lexpr))
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 123, spurious reduction of production lexpr -> simple_expr 
+## In state 148, spurious reduction of production separated_nonempty_list(COMMA,lexpr) -> lexpr 
+## In state 145, spurious reduction of production loption(separated_nonempty_list(COMMA,lexpr)) -> separated_nonempty_list(COMMA,lexpr) 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON ID LEFTPAR VOID WITH
+##
+## Ends in an error in state: 148.
+##
+## lexpr -> lexpr . PLUS lexpr [ XOR TIMES SLASH RIGHTPAR RIGHTBR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . MINUS lexpr [ XOR TIMES SLASH RIGHTPAR RIGHTBR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . TIMES lexpr [ XOR TIMES SLASH RIGHTPAR RIGHTBR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . SLASH lexpr [ XOR TIMES SLASH RIGHTPAR RIGHTBR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . PERCENT lexpr [ XOR TIMES SLASH RIGHTPAR RIGHTBR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . POW lexpr [ XOR TIMES SLASH RIGHTPAR RIGHTBR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . POWDOT lexpr [ XOR TIMES SLASH RIGHTPAR RIGHTBR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . AND lexpr [ XOR TIMES SLASH RIGHTPAR RIGHTBR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . OR lexpr [ XOR TIMES SLASH RIGHTPAR RIGHTBR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . XOR lexpr [ XOR TIMES SLASH RIGHTPAR RIGHTBR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . LRARROW lexpr [ XOR TIMES SLASH RIGHTPAR RIGHTBR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . RIGHTARROW lexpr [ XOR TIMES SLASH RIGHTPAR RIGHTBR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . LT lexpr [ XOR TIMES SLASH RIGHTPAR RIGHTBR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . LE lexpr [ XOR TIMES SLASH RIGHTPAR RIGHTBR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . GT lexpr [ XOR TIMES SLASH RIGHTPAR RIGHTBR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . GE lexpr [ XOR TIMES SLASH RIGHTPAR RIGHTBR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . EQUAL lexpr [ XOR TIMES SLASH RIGHTPAR RIGHTBR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . NOTEQ lexpr [ XOR TIMES SLASH RIGHTPAR RIGHTBR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . HAT LEFTBR INTEGER COMMA INTEGER RIGHTBR [ XOR TIMES SLASH RIGHTPAR RIGHTBR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . AT lexpr [ XOR TIMES SLASH RIGHTPAR RIGHTBR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## separated_nonempty_list(COMMA,lexpr) -> lexpr . [ RIGHTPAR RIGHTBR ]
+## separated_nonempty_list(COMMA,lexpr) -> lexpr . COMMA separated_nonempty_list(COMMA,lexpr) [ RIGHTPAR RIGHTBR ]
+##
+## The known suffix of the stack is as follows:
+## lexpr
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 123, spurious reduction of production lexpr -> simple_expr 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON ID LEFTPAR XOR
+##
+## Ends in an error in state: 144.
+##
+## simple_expr -> ident LEFTPAR . loption(separated_nonempty_list(COMMA,lexpr)) RIGHTPAR [ XOR WITH TYPE TIMES THEORY THEN SLASH SHARP RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING QM_ID QM PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTSQ LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE DOT COMMA COLON CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## ident LEFTPAR
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON ID VOID
+##
+## Ends in an error in state: 143.
+##
+## simple_expr -> ident . [ XOR WITH TYPE TIMES THEORY THEN SLASH SHARP RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING QM_ID QM PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTSQ LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE DOT COMMA COLON CASESPLIT BAR AXIOM AT AND ]
+## simple_expr -> ident . LEFTPAR loption(separated_nonempty_list(COMMA,lexpr)) RIGHTPAR [ XOR WITH TYPE TIMES THEORY THEN SLASH SHARP RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING QM_ID QM PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTSQ LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE DOT COMMA COLON CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## ident
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON IF VOID THEN VOID ELSE LEFTSQ BAR INTEGER BAR RIGHTSQ VOID
+##
+## Ends in an error in state: 255.
+##
+## lexpr -> lexpr . PLUS lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . MINUS lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . TIMES lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . SLASH lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . PERCENT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . POW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . POWDOT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . AND lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . OR lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . XOR lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LRARROW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . RIGHTARROW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LE lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . GT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . GE lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . EQUAL lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . NOTEQ lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . HAT LEFTBR INTEGER COMMA INTEGER RIGHTBR [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . AT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> IF lexpr THEN lexpr ELSE lexpr . [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## IF lexpr THEN lexpr ELSE lexpr
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON IF VOID THEN VOID ELSE XOR
+##
+## Ends in an error in state: 254.
+##
+## lexpr -> IF lexpr THEN lexpr ELSE . lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## IF lexpr THEN lexpr ELSE
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON IF VOID THEN VOID WITH
+##
+## Ends in an error in state: 253.
+##
+## lexpr -> lexpr . PLUS lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL ELSE AT AND ]
+## lexpr -> lexpr . MINUS lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL ELSE AT AND ]
+## lexpr -> lexpr . TIMES lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL ELSE AT AND ]
+## lexpr -> lexpr . SLASH lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL ELSE AT AND ]
+## lexpr -> lexpr . PERCENT lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL ELSE AT AND ]
+## lexpr -> lexpr . POW lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL ELSE AT AND ]
+## lexpr -> lexpr . POWDOT lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL ELSE AT AND ]
+## lexpr -> lexpr . AND lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL ELSE AT AND ]
+## lexpr -> lexpr . OR lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL ELSE AT AND ]
+## lexpr -> lexpr . XOR lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL ELSE AT AND ]
+## lexpr -> lexpr . LRARROW lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL ELSE AT AND ]
+## lexpr -> lexpr . RIGHTARROW lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL ELSE AT AND ]
+## lexpr -> lexpr . LT lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL ELSE AT AND ]
+## lexpr -> lexpr . LE lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL ELSE AT AND ]
+## lexpr -> lexpr . GT lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL ELSE AT AND ]
+## lexpr -> lexpr . GE lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL ELSE AT AND ]
+## lexpr -> lexpr . EQUAL lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL ELSE AT AND ]
+## lexpr -> lexpr . NOTEQ lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL ELSE AT AND ]
+## lexpr -> lexpr . HAT LEFTBR INTEGER COMMA INTEGER RIGHTBR [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL ELSE AT AND ]
+## lexpr -> lexpr . AT lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL ELSE AT AND ]
+## lexpr -> IF lexpr THEN lexpr . ELSE lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## IF lexpr THEN lexpr
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 123, spurious reduction of production lexpr -> simple_expr 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON IF VOID THEN XOR
+##
+## Ends in an error in state: 252.
+##
+## lexpr -> IF lexpr THEN . lexpr ELSE lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## IF lexpr THEN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON IF VOID WITH
+##
+## Ends in an error in state: 251.
+##
+## lexpr -> lexpr . PLUS lexpr [ XOR TIMES THEN SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . MINUS lexpr [ XOR TIMES THEN SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . TIMES lexpr [ XOR TIMES THEN SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . SLASH lexpr [ XOR TIMES THEN SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . PERCENT lexpr [ XOR TIMES THEN SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . POW lexpr [ XOR TIMES THEN SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . POWDOT lexpr [ XOR TIMES THEN SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . AND lexpr [ XOR TIMES THEN SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . OR lexpr [ XOR TIMES THEN SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . XOR lexpr [ XOR TIMES THEN SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . LRARROW lexpr [ XOR TIMES THEN SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . RIGHTARROW lexpr [ XOR TIMES THEN SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . LT lexpr [ XOR TIMES THEN SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . LE lexpr [ XOR TIMES THEN SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . GT lexpr [ XOR TIMES THEN SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . GE lexpr [ XOR TIMES THEN SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . EQUAL lexpr [ XOR TIMES THEN SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . NOTEQ lexpr [ XOR TIMES THEN SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . HAT LEFTBR INTEGER COMMA INTEGER RIGHTBR [ XOR TIMES THEN SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . AT lexpr [ XOR TIMES THEN SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> IF lexpr . THEN lexpr ELSE lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## IF lexpr
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 123, spurious reduction of production lexpr -> simple_expr 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON IF XOR
+##
+## Ends in an error in state: 106.
+##
+## lexpr -> IF . lexpr THEN lexpr ELSE lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## IF
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON LEFTBR ID EQUAL DECIMAL PV XOR
+##
+## Ends in an error in state: 102.
+##
+## separated_nonempty_list(PV,label_expr) -> label_expr PV . separated_nonempty_list(PV,label_expr) [ RIGHTBR ]
+##
+## The known suffix of the stack is as follows:
+## label_expr PV
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON LEFTBR ID EQUAL VOID WITH
+##
+## Ends in an error in state: 256.
+##
+## label_expr -> ident EQUAL lexpr . [ RIGHTBR PV ]
+## lexpr -> lexpr . PLUS lexpr [ XOR TIMES SLASH RIGHTBR RIGHTARROW PV POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . MINUS lexpr [ XOR TIMES SLASH RIGHTBR RIGHTARROW PV POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . TIMES lexpr [ XOR TIMES SLASH RIGHTBR RIGHTARROW PV POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . SLASH lexpr [ XOR TIMES SLASH RIGHTBR RIGHTARROW PV POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . PERCENT lexpr [ XOR TIMES SLASH RIGHTBR RIGHTARROW PV POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . POW lexpr [ XOR TIMES SLASH RIGHTBR RIGHTARROW PV POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . POWDOT lexpr [ XOR TIMES SLASH RIGHTBR RIGHTARROW PV POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . AND lexpr [ XOR TIMES SLASH RIGHTBR RIGHTARROW PV POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . OR lexpr [ XOR TIMES SLASH RIGHTBR RIGHTARROW PV POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . XOR lexpr [ XOR TIMES SLASH RIGHTBR RIGHTARROW PV POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . LRARROW lexpr [ XOR TIMES SLASH RIGHTBR RIGHTARROW PV POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . RIGHTARROW lexpr [ XOR TIMES SLASH RIGHTBR RIGHTARROW PV POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . LT lexpr [ XOR TIMES SLASH RIGHTBR RIGHTARROW PV POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . LE lexpr [ XOR TIMES SLASH RIGHTBR RIGHTARROW PV POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . GT lexpr [ XOR TIMES SLASH RIGHTBR RIGHTARROW PV POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . GE lexpr [ XOR TIMES SLASH RIGHTBR RIGHTARROW PV POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . EQUAL lexpr [ XOR TIMES SLASH RIGHTBR RIGHTARROW PV POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . NOTEQ lexpr [ XOR TIMES SLASH RIGHTBR RIGHTARROW PV POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . HAT LEFTBR INTEGER COMMA INTEGER RIGHTBR [ XOR TIMES SLASH RIGHTBR RIGHTARROW PV POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . AT lexpr [ XOR TIMES SLASH RIGHTBR RIGHTARROW PV POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+##
+## The known suffix of the stack is as follows:
+## ident EQUAL lexpr
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 123, spurious reduction of production lexpr -> simple_expr 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON LEFTBR ID EQUAL XOR
+##
+## Ends in an error in state: 105.
+##
+## label_expr -> ident EQUAL . lexpr [ RIGHTBR PV ]
+##
+## The known suffix of the stack is as follows:
+## ident EQUAL
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON LEFTBR ID XOR
+##
+## Ends in an error in state: 259.
+##
+## label_expr -> ident . EQUAL lexpr [ RIGHTBR PV ]
+## simple_expr -> ident . [ WITH SHARP QM_ID QM LEFTSQ DOT COLON ]
+## simple_expr -> ident . LEFTPAR loption(separated_nonempty_list(COMMA,lexpr)) RIGHTPAR [ WITH SHARP QM_ID QM LEFTSQ DOT COLON ]
+##
+## The known suffix of the stack is as follows:
+## ident
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON LEFTBR VOID WITH ID XOR
+##
+## Ends in an error in state: 104.
+##
+## label_expr -> ident . EQUAL lexpr [ RIGHTBR PV ]
+##
+## The known suffix of the stack is as follows:
+## ident
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON LEFTBR VOID WITH XOR
+##
+## Ends in an error in state: 98.
+##
+## simple_expr -> LEFTBR simple_expr WITH . separated_nonempty_list(PV,label_expr) RIGHTBR [ XOR WITH TYPE TIMES THEORY THEN SLASH SHARP RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING QM_ID QM PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTSQ LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE DOT COMMA COLON CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## LEFTBR simple_expr WITH
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON LEFTBR VOID XOR
+##
+## Ends in an error in state: 97.
+##
+## simple_expr -> LEFTBR simple_expr . WITH separated_nonempty_list(PV,label_expr) RIGHTBR [ XOR WITH TYPE TIMES THEORY THEN SLASH SHARP RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING QM_ID QM PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTSQ LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE DOT COMMA COLON CASESPLIT BAR AXIOM AT AND ]
+## simple_expr -> simple_expr . DOT raw_ident [ WITH SHARP QM_ID QM LEFTSQ DOT COLON ]
+## simple_expr -> simple_expr . LEFTSQ lexpr RIGHTSQ [ WITH SHARP QM_ID QM LEFTSQ DOT COLON ]
+## simple_expr -> simple_expr . LEFTSQ separated_nonempty_list(COMMA,array_assignment) RIGHTSQ [ WITH SHARP QM_ID QM LEFTSQ DOT COLON ]
+## simple_expr -> simple_expr . COLON primitive_type [ WITH SHARP QM_ID QM LEFTSQ DOT COLON ]
+## simple_expr -> simple_expr . QM raw_ident [ WITH SHARP QM_ID QM LEFTSQ DOT COLON ]
+## simple_expr -> simple_expr . QM_ID [ WITH SHARP QM_ID QM LEFTSQ DOT COLON ]
+## simple_expr -> simple_expr . SHARP raw_ident [ WITH SHARP QM_ID QM LEFTSQ DOT COLON ]
+##
+## The known suffix of the stack is as follows:
+## LEFTBR simple_expr
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON LEFTBR XOR
+##
+## Ends in an error in state: 92.
+##
+## simple_expr -> LEFTBR . separated_nonempty_list(PV,label_expr) RIGHTBR [ XOR WITH TYPE TIMES THEORY THEN SLASH SHARP RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING QM_ID QM PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTSQ LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE DOT COMMA COLON CASESPLIT BAR AXIOM AT AND ]
+## simple_expr -> LEFTBR . simple_expr WITH separated_nonempty_list(PV,label_expr) RIGHTBR [ XOR WITH TYPE TIMES THEORY THEN SLASH SHARP RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING QM_ID QM PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTSQ LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE DOT COMMA COLON CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## LEFTBR
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON LEFTPAR VOID WITH
+##
+## Ends in an error in state: 260.
+##
+## lexpr -> lexpr . PLUS lexpr [ XOR TIMES SLASH RIGHTPAR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . MINUS lexpr [ XOR TIMES SLASH RIGHTPAR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . TIMES lexpr [ XOR TIMES SLASH RIGHTPAR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . SLASH lexpr [ XOR TIMES SLASH RIGHTPAR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . PERCENT lexpr [ XOR TIMES SLASH RIGHTPAR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . POW lexpr [ XOR TIMES SLASH RIGHTPAR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . POWDOT lexpr [ XOR TIMES SLASH RIGHTPAR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . AND lexpr [ XOR TIMES SLASH RIGHTPAR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . OR lexpr [ XOR TIMES SLASH RIGHTPAR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . XOR lexpr [ XOR TIMES SLASH RIGHTPAR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . LRARROW lexpr [ XOR TIMES SLASH RIGHTPAR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . RIGHTARROW lexpr [ XOR TIMES SLASH RIGHTPAR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . LT lexpr [ XOR TIMES SLASH RIGHTPAR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . LE lexpr [ XOR TIMES SLASH RIGHTPAR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . GT lexpr [ XOR TIMES SLASH RIGHTPAR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . GE lexpr [ XOR TIMES SLASH RIGHTPAR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . EQUAL lexpr [ XOR TIMES SLASH RIGHTPAR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . NOTEQ lexpr [ XOR TIMES SLASH RIGHTPAR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . HAT LEFTBR INTEGER COMMA INTEGER RIGHTBR [ XOR TIMES SLASH RIGHTPAR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . AT lexpr [ XOR TIMES SLASH RIGHTPAR RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## simple_expr -> LEFTPAR lexpr . RIGHTPAR [ XOR WITH TYPE TIMES THEORY THEN SLASH SHARP RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING QM_ID QM PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTSQ LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE DOT COMMA COLON CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## LEFTPAR lexpr
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 123, spurious reduction of production lexpr -> simple_expr 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON LEFTPAR XOR
+##
+## Ends in an error in state: 91.
+##
+## simple_expr -> LEFTPAR . lexpr RIGHTPAR [ XOR WITH TYPE TIMES THEORY THEN SLASH SHARP RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING QM_ID QM PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTSQ LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE DOT COMMA COLON CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## LEFTPAR
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON LEFTSQ BAR INTEGER BAR XOR
+##
+## Ends in an error in state: 89.
+##
+## lexpr -> LEFTSQ BAR INTEGER BAR . RIGHTSQ [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## LEFTSQ BAR INTEGER BAR
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON LEFTSQ BAR INTEGER XOR
+##
+## Ends in an error in state: 88.
+##
+## lexpr -> LEFTSQ BAR INTEGER . BAR RIGHTSQ [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## LEFTSQ BAR INTEGER
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON LEFTSQ BAR XOR
+##
+## Ends in an error in state: 87.
+##
+## lexpr -> LEFTSQ BAR . INTEGER BAR RIGHTSQ [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## LEFTSQ BAR
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON LEFTSQ XOR
+##
+## Ends in an error in state: 86.
+##
+## lexpr -> LEFTSQ . BAR INTEGER BAR RIGHTSQ [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## LEFTSQ
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON LET ID EQUAL DECIMAL COMMA XOR
+##
+## Ends in an error in state: 264.
+##
+## separated_nonempty_list(COMMA,let_binder) -> let_binder COMMA . separated_nonempty_list(COMMA,let_binder) [ IN ]
+##
+## The known suffix of the stack is as follows:
+## let_binder COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON LET ID EQUAL DECIMAL IN LEFTSQ BAR INTEGER BAR RIGHTSQ VOID
+##
+## Ends in an error in state: 262.
+##
+## lexpr -> lexpr . PLUS lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . MINUS lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . TIMES lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . SLASH lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . PERCENT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . POW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . POWDOT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . AND lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . OR lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . XOR lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LRARROW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . RIGHTARROW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LE lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . GT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . GE lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . EQUAL lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . NOTEQ lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . HAT LEFTBR INTEGER COMMA INTEGER RIGHTBR [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . AT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> LET separated_nonempty_list(COMMA,let_binder) IN lexpr . [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## LET separated_nonempty_list(COMMA,let_binder) IN lexpr
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON LET ID EQUAL DECIMAL IN XOR
+##
+## Ends in an error in state: 85.
+##
+## lexpr -> LET separated_nonempty_list(COMMA,let_binder) IN . lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## LET separated_nonempty_list(COMMA,let_binder) IN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON LET ID EQUAL VOID WITH
+##
+## Ends in an error in state: 268.
+##
+## let_binder -> ident EQUAL lexpr . [ IN COMMA ]
+## lexpr -> lexpr . PLUS lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE IN HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . MINUS lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE IN HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . TIMES lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE IN HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . SLASH lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE IN HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . PERCENT lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE IN HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . POW lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE IN HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . POWDOT lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE IN HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . AND lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE IN HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . OR lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE IN HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . XOR lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE IN HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . LRARROW lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE IN HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . RIGHTARROW lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE IN HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . LT lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE IN HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . LE lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE IN HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . GT lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE IN HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . GE lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE IN HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . EQUAL lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE IN HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . NOTEQ lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE IN HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . HAT LEFTBR INTEGER COMMA INTEGER RIGHTBR [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE IN HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . AT lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE IN HAT GT GE EQUAL COMMA AT AND ]
+##
+## The known suffix of the stack is as follows:
+## ident EQUAL lexpr
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 123, spurious reduction of production lexpr -> simple_expr 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON LET ID EQUAL XOR
+##
+## Ends in an error in state: 267.
+##
+## let_binder -> ident EQUAL . lexpr [ IN COMMA ]
+##
+## The known suffix of the stack is as follows:
+## ident EQUAL
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON LET ID XOR
+##
+## Ends in an error in state: 266.
+##
+## let_binder -> ident . EQUAL lexpr [ IN COMMA ]
+##
+## The known suffix of the stack is as follows:
+## ident
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON LET XOR
+##
+## Ends in an error in state: 83.
+##
+## lexpr -> LET . separated_nonempty_list(COMMA,let_binder) IN lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## LET
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON MATCH VOID TYPE
+##
+## Ends in an error in state: 269.
+##
+## lexpr -> lexpr . PLUS lexpr [ XOR WITH TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . MINUS lexpr [ XOR WITH TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . TIMES lexpr [ XOR WITH TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . SLASH lexpr [ XOR WITH TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . PERCENT lexpr [ XOR WITH TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . POW lexpr [ XOR WITH TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . POWDOT lexpr [ XOR WITH TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . AND lexpr [ XOR WITH TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . OR lexpr [ XOR WITH TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . XOR lexpr [ XOR WITH TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . LRARROW lexpr [ XOR WITH TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . RIGHTARROW lexpr [ XOR WITH TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . LT lexpr [ XOR WITH TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . LE lexpr [ XOR WITH TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . GT lexpr [ XOR WITH TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . GE lexpr [ XOR WITH TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . EQUAL lexpr [ XOR WITH TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . NOTEQ lexpr [ XOR WITH TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . HAT LEFTBR INTEGER COMMA INTEGER RIGHTBR [ XOR WITH TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . AT lexpr [ XOR WITH TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> MATCH lexpr . WITH match_cases END [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## MATCH lexpr
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 123, spurious reduction of production lexpr -> simple_expr 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON MATCH VOID WITH BAR XOR
+##
+## Ends in an error in state: 271.
+##
+## match_cases -> BAR . match_case [ END BAR ]
+##
+## The known suffix of the stack is as follows:
+## BAR
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON MATCH VOID WITH ID LEFTPAR ID COMMA XOR
+##
+## Ends in an error in state: 281.
+##
+## separated_nonempty_list(COMMA,ident) -> ident COMMA . separated_nonempty_list(COMMA,ident) [ RIGHTPAR ]
+##
+## The known suffix of the stack is as follows:
+## ident COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON MATCH VOID WITH ID LEFTPAR ID RIGHTPAR XOR
+##
+## Ends in an error in state: 272.
+##
+## match_case -> simple_pattern . RIGHTARROW lexpr [ END BAR ]
+##
+## The known suffix of the stack is as follows:
+## simple_pattern
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON MATCH VOID WITH ID LEFTPAR ID XOR
+##
+## Ends in an error in state: 280.
+##
+## separated_nonempty_list(COMMA,ident) -> ident . [ RIGHTPAR ]
+## separated_nonempty_list(COMMA,ident) -> ident . COMMA separated_nonempty_list(COMMA,ident) [ RIGHTPAR ]
+##
+## The known suffix of the stack is as follows:
+## ident
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON MATCH VOID WITH ID LEFTPAR XOR
+##
+## Ends in an error in state: 277.
+##
+## simple_pattern -> ident LEFTPAR . separated_nonempty_list(COMMA,ident) RIGHTPAR [ RIGHTARROW ]
+##
+## The known suffix of the stack is as follows:
+## ident LEFTPAR
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON MATCH VOID WITH ID RIGHTARROW DECIMAL BAR XOR
+##
+## Ends in an error in state: 285.
+##
+## match_cases -> match_cases BAR . match_case [ END BAR ]
+##
+## The known suffix of the stack is as follows:
+## match_cases BAR
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON MATCH VOID WITH ID RIGHTARROW VOID WITH
+##
+## Ends in an error in state: 274.
+##
+## lexpr -> lexpr . PLUS lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END BAR AT AND ]
+## lexpr -> lexpr . MINUS lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END BAR AT AND ]
+## lexpr -> lexpr . TIMES lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END BAR AT AND ]
+## lexpr -> lexpr . SLASH lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END BAR AT AND ]
+## lexpr -> lexpr . PERCENT lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END BAR AT AND ]
+## lexpr -> lexpr . POW lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END BAR AT AND ]
+## lexpr -> lexpr . POWDOT lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END BAR AT AND ]
+## lexpr -> lexpr . AND lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END BAR AT AND ]
+## lexpr -> lexpr . OR lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END BAR AT AND ]
+## lexpr -> lexpr . XOR lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END BAR AT AND ]
+## lexpr -> lexpr . LRARROW lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END BAR AT AND ]
+## lexpr -> lexpr . RIGHTARROW lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END BAR AT AND ]
+## lexpr -> lexpr . LT lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END BAR AT AND ]
+## lexpr -> lexpr . LE lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END BAR AT AND ]
+## lexpr -> lexpr . GT lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END BAR AT AND ]
+## lexpr -> lexpr . GE lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END BAR AT AND ]
+## lexpr -> lexpr . EQUAL lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END BAR AT AND ]
+## lexpr -> lexpr . NOTEQ lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END BAR AT AND ]
+## lexpr -> lexpr . HAT LEFTBR INTEGER COMMA INTEGER RIGHTBR [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END BAR AT AND ]
+## lexpr -> lexpr . AT lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END BAR AT AND ]
+## match_case -> simple_pattern RIGHTARROW lexpr . [ END BAR ]
+##
+## The known suffix of the stack is as follows:
+## simple_pattern RIGHTARROW lexpr
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 123, spurious reduction of production lexpr -> simple_expr 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON MATCH VOID WITH ID RIGHTARROW XOR
+##
+## Ends in an error in state: 273.
+##
+## match_case -> simple_pattern RIGHTARROW . lexpr [ END BAR ]
+##
+## The known suffix of the stack is as follows:
+## simple_pattern RIGHTARROW
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON MATCH VOID WITH ID XOR
+##
+## Ends in an error in state: 276.
+##
+## simple_pattern -> ident . [ RIGHTARROW ]
+## simple_pattern -> ident . LEFTPAR separated_nonempty_list(COMMA,ident) RIGHTPAR [ RIGHTARROW ]
+##
+## The known suffix of the stack is as follows:
+## ident
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON MATCH VOID WITH XOR
+##
+## Ends in an error in state: 270.
+##
+## lexpr -> MATCH lexpr WITH . match_cases END [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## MATCH lexpr WITH
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON MATCH XOR
+##
+## Ends in an error in state: 82.
+##
+## lexpr -> MATCH . lexpr WITH match_cases END [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## MATCH
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON MINUS XOR
+##
+## Ends in an error in state: 81.
+##
+## lexpr -> MINUS . lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## MINUS
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON NOT XOR
+##
+## Ends in an error in state: 80.
+##
+## lexpr -> NOT . lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## NOT
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON STRING COLON XOR
+##
+## Ends in an error in state: 79.
+##
+## lexpr -> STRING COLON . lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## STRING COLON
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON STRING XOR
+##
+## Ends in an error in state: 78.
+##
+## lexpr -> STRING . COLON lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## STRING
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON VOID AND LEFTSQ BAR INTEGER BAR RIGHTSQ VOID
+##
+## Ends in an error in state: 180.
+##
+## lexpr -> lexpr . PLUS lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . MINUS lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . TIMES lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . SLASH lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . PERCENT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . POW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . POWDOT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . AND lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr AND lexpr . [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . OR lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . XOR lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LRARROW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . RIGHTARROW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LE lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . GT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . GE lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . EQUAL lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . NOTEQ lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . HAT LEFTBR INTEGER COMMA INTEGER RIGHTBR [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . AT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## lexpr AND lexpr
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON VOID AND XOR
+##
+## Ends in an error in state: 179.
+##
+## lexpr -> lexpr AND . lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## lexpr AND
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON VOID AT LEFTSQ BAR INTEGER BAR RIGHTSQ VOID
+##
+## Ends in an error in state: 162.
+##
+## lexpr -> lexpr . PLUS lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . MINUS lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . TIMES lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . SLASH lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . PERCENT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . POW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . POWDOT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . AND lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . OR lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . XOR lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LRARROW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . RIGHTARROW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LE lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . GT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . GE lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . EQUAL lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . NOTEQ lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . HAT LEFTBR INTEGER COMMA INTEGER RIGHTBR [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . AT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr AT lexpr . [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## lexpr AT lexpr
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON VOID AT XOR
+##
+## Ends in an error in state: 161.
+##
+## lexpr -> lexpr AT . lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## lexpr AT
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON VOID COLON UNIT VOID
+##
+## Ends in an error in state: 195.
+##
+## primitive_type -> primitive_type . ident [ XOR WITH TYPE TIMES THEORY THEN SLASH SHARP RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING QM_ID QM PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTSQ LEFTARROW LE IN ID HAT GT GOAL GE FUNC EQUAL EOF END ELSE DOT COMMA COLON CASESPLIT BAR AXIOM AT AND ]
+## simple_expr -> simple_expr COLON primitive_type . [ XOR WITH TYPE TIMES THEORY THEN SLASH SHARP RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING QM_ID QM PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTSQ LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE DOT COMMA COLON CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## simple_expr COLON primitive_type
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON VOID COLON XOR
+##
+## Ends in an error in state: 194.
+##
+## simple_expr -> simple_expr COLON . primitive_type [ XOR WITH TYPE TIMES THEORY THEN SLASH SHARP RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING QM_ID QM PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTSQ LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE DOT COMMA COLON CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## simple_expr COLON
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON VOID DOT XOR
+##
+## Ends in an error in state: 192.
+##
+## simple_expr -> simple_expr DOT . raw_ident [ XOR WITH TYPE TIMES THEORY THEN SLASH SHARP RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING QM_ID QM PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTSQ LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE DOT COMMA COLON CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## simple_expr DOT
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON VOID EQUAL LEFTSQ BAR INTEGER BAR RIGHTSQ VOID
+##
+## Ends in an error in state: 178.
+##
+## lexpr -> lexpr . PLUS lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . MINUS lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . TIMES lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . SLASH lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . PERCENT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . POW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . POWDOT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . AND lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . OR lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . XOR lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LRARROW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . RIGHTARROW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LE lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . GT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . GE lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . EQUAL lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr EQUAL lexpr . [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . NOTEQ lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . HAT LEFTBR INTEGER COMMA INTEGER RIGHTBR [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . AT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## lexpr EQUAL lexpr
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON VOID EQUAL XOR
+##
+## Ends in an error in state: 177.
+##
+## lexpr -> lexpr EQUAL . lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## lexpr EQUAL
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON VOID GE LEFTSQ BAR INTEGER BAR RIGHTSQ VOID
+##
+## Ends in an error in state: 176.
+##
+## lexpr -> lexpr . PLUS lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . MINUS lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . TIMES lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . SLASH lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . PERCENT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . POW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . POWDOT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . AND lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . OR lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . XOR lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LRARROW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . RIGHTARROW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LE lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . GT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . GE lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr GE lexpr . [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . EQUAL lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . NOTEQ lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . HAT LEFTBR INTEGER COMMA INTEGER RIGHTBR [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . AT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## lexpr GE lexpr
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON VOID GE XOR
+##
+## Ends in an error in state: 175.
+##
+## lexpr -> lexpr GE . lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## lexpr GE
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON VOID GT LEFTSQ BAR INTEGER BAR RIGHTSQ VOID
+##
+## Ends in an error in state: 174.
+##
+## lexpr -> lexpr . PLUS lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . MINUS lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . TIMES lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . SLASH lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . PERCENT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . POW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . POWDOT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . AND lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . OR lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . XOR lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LRARROW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . RIGHTARROW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LE lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . GT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr GT lexpr . [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . GE lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . EQUAL lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . NOTEQ lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . HAT LEFTBR INTEGER COMMA INTEGER RIGHTBR [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . AT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## lexpr GT lexpr
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON VOID GT XOR
+##
+## Ends in an error in state: 173.
+##
+## lexpr -> lexpr GT . lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## lexpr GT
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON VOID HAT LEFTBR INTEGER COMMA INTEGER XOR
+##
+## Ends in an error in state: 141.
+##
+## lexpr -> lexpr HAT LEFTBR INTEGER COMMA INTEGER . RIGHTBR [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## lexpr HAT LEFTBR INTEGER COMMA INTEGER
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON VOID HAT LEFTBR INTEGER COMMA XOR
+##
+## Ends in an error in state: 140.
+##
+## lexpr -> lexpr HAT LEFTBR INTEGER COMMA . INTEGER RIGHTBR [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## lexpr HAT LEFTBR INTEGER COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON VOID HAT LEFTBR INTEGER XOR
+##
+## Ends in an error in state: 139.
+##
+## lexpr -> lexpr HAT LEFTBR INTEGER . COMMA INTEGER RIGHTBR [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## lexpr HAT LEFTBR INTEGER
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON VOID HAT LEFTBR XOR
+##
+## Ends in an error in state: 138.
+##
+## lexpr -> lexpr HAT LEFTBR . INTEGER COMMA INTEGER RIGHTBR [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## lexpr HAT LEFTBR
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON VOID HAT XOR
+##
+## Ends in an error in state: 137.
+##
+## lexpr -> lexpr HAT . LEFTBR INTEGER COMMA INTEGER RIGHTBR [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## lexpr HAT
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON VOID LE LEFTSQ BAR INTEGER BAR RIGHTSQ VOID
+##
+## Ends in an error in state: 172.
+##
+## lexpr -> lexpr . PLUS lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . MINUS lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . TIMES lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . SLASH lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . PERCENT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . POW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . POWDOT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . AND lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . OR lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . XOR lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LRARROW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . RIGHTARROW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LE lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr LE lexpr . [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . GT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . GE lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . EQUAL lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . NOTEQ lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . HAT LEFTBR INTEGER COMMA INTEGER RIGHTBR [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . AT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## lexpr LE lexpr
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON VOID LE XOR
+##
+## Ends in an error in state: 171.
+##
+## lexpr -> lexpr LE . lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## lexpr LE
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON VOID LEFTSQ VOID LEFTARROW DECIMAL COMMA VOID WITH
+##
+## Ends in an error in state: 191.
+##
+## array_assignment -> lexpr . LEFTARROW lexpr [ RIGHTSQ COMMA ]
+## lexpr -> lexpr . PLUS lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LEFTARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . MINUS lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LEFTARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . TIMES lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LEFTARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . SLASH lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LEFTARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . PERCENT lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LEFTARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . POW lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LEFTARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . POWDOT lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LEFTARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . AND lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LEFTARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . OR lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LEFTARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . XOR lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LEFTARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . LRARROW lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LEFTARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . RIGHTARROW lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LEFTARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . LT lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LEFTARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . LE lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LEFTARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . GT lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LEFTARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . GE lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LEFTARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . EQUAL lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LEFTARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . NOTEQ lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LEFTARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . HAT LEFTBR INTEGER COMMA INTEGER RIGHTBR [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LEFTARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . AT lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LEFTARROW LE HAT GT GE EQUAL AT AND ]
+##
+## The known suffix of the stack is as follows:
+## lexpr
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 123, spurious reduction of production lexpr -> simple_expr 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON VOID LEFTSQ VOID LEFTARROW DECIMAL COMMA XOR
+##
+## Ends in an error in state: 189.
+##
+## separated_nonempty_list(COMMA,array_assignment) -> array_assignment COMMA . separated_nonempty_list(COMMA,array_assignment) [ RIGHTSQ ]
+##
+## The known suffix of the stack is as follows:
+## array_assignment COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON VOID LEFTSQ VOID LEFTARROW VOID WITH
+##
+## Ends in an error in state: 187.
+##
+## array_assignment -> lexpr LEFTARROW lexpr . [ RIGHTSQ COMMA ]
+## lexpr -> lexpr . PLUS lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . MINUS lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . TIMES lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . SLASH lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . PERCENT lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . POW lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . POWDOT lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . AND lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . OR lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . XOR lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . LRARROW lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . RIGHTARROW lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . LT lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . LE lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . GT lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . GE lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . EQUAL lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . NOTEQ lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . HAT LEFTBR INTEGER COMMA INTEGER RIGHTBR [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+## lexpr -> lexpr . AT lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL COMMA AT AND ]
+##
+## The known suffix of the stack is as follows:
+## lexpr LEFTARROW lexpr
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 123, spurious reduction of production lexpr -> simple_expr 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON VOID LEFTSQ VOID LEFTARROW XOR
+##
+## Ends in an error in state: 186.
+##
+## array_assignment -> lexpr LEFTARROW . lexpr [ RIGHTSQ COMMA ]
+##
+## The known suffix of the stack is as follows:
+## lexpr LEFTARROW
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON VOID LEFTSQ VOID WITH
+##
+## Ends in an error in state: 132.
+##
+## array_assignment -> lexpr . LEFTARROW lexpr [ RIGHTSQ COMMA ]
+## lexpr -> lexpr . PLUS lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LEFTARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . MINUS lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LEFTARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . TIMES lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LEFTARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . SLASH lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LEFTARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . PERCENT lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LEFTARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . POW lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LEFTARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . POWDOT lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LEFTARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . AND lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LEFTARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . OR lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LEFTARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . XOR lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LEFTARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . LRARROW lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LEFTARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . RIGHTARROW lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LEFTARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . LT lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LEFTARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . LE lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LEFTARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . GT lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LEFTARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . GE lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LEFTARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . EQUAL lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LEFTARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . NOTEQ lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LEFTARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . HAT LEFTBR INTEGER COMMA INTEGER RIGHTBR [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LEFTARROW LE HAT GT GE EQUAL AT AND ]
+## lexpr -> lexpr . AT lexpr [ XOR TIMES SLASH RIGHTSQ RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LEFTARROW LE HAT GT GE EQUAL AT AND ]
+## simple_expr -> simple_expr LEFTSQ lexpr . RIGHTSQ [ XOR WITH TYPE TIMES THEORY THEN SLASH SHARP RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING QM_ID QM PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTSQ LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE DOT COMMA COLON CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## simple_expr LEFTSQ lexpr
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 123, spurious reduction of production lexpr -> simple_expr 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON VOID LEFTSQ XOR
+##
+## Ends in an error in state: 129.
+##
+## simple_expr -> simple_expr LEFTSQ . lexpr RIGHTSQ [ XOR WITH TYPE TIMES THEORY THEN SLASH SHARP RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING QM_ID QM PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTSQ LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE DOT COMMA COLON CASESPLIT BAR AXIOM AT AND ]
+## simple_expr -> simple_expr LEFTSQ . separated_nonempty_list(COMMA,array_assignment) RIGHTSQ [ XOR WITH TYPE TIMES THEORY THEN SLASH SHARP RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING QM_ID QM PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTSQ LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE DOT COMMA COLON CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## simple_expr LEFTSQ
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON VOID LRARROW LEFTSQ BAR INTEGER BAR RIGHTSQ VOID
+##
+## Ends in an error in state: 182.
+##
+## lexpr -> lexpr . PLUS lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . MINUS lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . TIMES lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . SLASH lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . PERCENT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . POW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . POWDOT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . AND lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . OR lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . XOR lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LRARROW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr LRARROW lexpr . [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . RIGHTARROW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LE lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . GT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . GE lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . EQUAL lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . NOTEQ lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . HAT LEFTBR INTEGER COMMA INTEGER RIGHTBR [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . AT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## lexpr LRARROW lexpr
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON VOID LRARROW XOR
+##
+## Ends in an error in state: 181.
+##
+## lexpr -> lexpr LRARROW . lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## lexpr LRARROW
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON VOID LT LEFTSQ BAR INTEGER BAR RIGHTSQ VOID
+##
+## Ends in an error in state: 170.
+##
+## lexpr -> lexpr . PLUS lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . MINUS lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . TIMES lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . SLASH lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . PERCENT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . POW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . POWDOT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . AND lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . OR lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . XOR lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LRARROW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . RIGHTARROW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr LT lexpr . [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LE lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . GT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . GE lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . EQUAL lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . NOTEQ lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . HAT LEFTBR INTEGER COMMA INTEGER RIGHTBR [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . AT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## lexpr LT lexpr
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON VOID LT XOR
+##
+## Ends in an error in state: 169.
+##
+## lexpr -> lexpr LT . lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## lexpr LT
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON VOID MINUS LEFTSQ BAR INTEGER BAR RIGHTSQ VOID
+##
+## Ends in an error in state: 168.
+##
+## lexpr -> lexpr . PLUS lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . MINUS lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr MINUS lexpr . [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . TIMES lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . SLASH lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . PERCENT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . POW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . POWDOT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . AND lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . OR lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . XOR lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LRARROW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . RIGHTARROW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LE lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . GT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . GE lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . EQUAL lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . NOTEQ lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . HAT LEFTBR INTEGER COMMA INTEGER RIGHTBR [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . AT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## lexpr MINUS lexpr
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON VOID MINUS XOR
+##
+## Ends in an error in state: 167.
+##
+## lexpr -> lexpr MINUS . lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## lexpr MINUS
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON VOID NOTEQ LEFTSQ BAR INTEGER BAR RIGHTSQ VOID
+##
+## Ends in an error in state: 166.
+##
+## lexpr -> lexpr . PLUS lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . MINUS lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . TIMES lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . SLASH lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . PERCENT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . POW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . POWDOT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . AND lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . OR lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . XOR lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LRARROW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . RIGHTARROW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LE lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . GT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . GE lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . EQUAL lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . NOTEQ lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr NOTEQ lexpr . [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . HAT LEFTBR INTEGER COMMA INTEGER RIGHTBR [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . AT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## lexpr NOTEQ lexpr
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON VOID NOTEQ XOR
+##
+## Ends in an error in state: 165.
+##
+## lexpr -> lexpr NOTEQ . lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## lexpr NOTEQ
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON VOID OR LEFTSQ BAR INTEGER BAR RIGHTSQ VOID
+##
+## Ends in an error in state: 164.
+##
+## lexpr -> lexpr . PLUS lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . MINUS lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . TIMES lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . SLASH lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . PERCENT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . POW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . POWDOT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . AND lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . OR lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr OR lexpr . [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . XOR lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LRARROW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . RIGHTARROW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LE lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . GT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . GE lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . EQUAL lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . NOTEQ lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . HAT LEFTBR INTEGER COMMA INTEGER RIGHTBR [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . AT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## lexpr OR lexpr
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON VOID OR XOR
+##
+## Ends in an error in state: 163.
+##
+## lexpr -> lexpr OR . lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## lexpr OR
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON VOID PERCENT LEFTSQ BAR INTEGER BAR RIGHTSQ VOID
+##
+## Ends in an error in state: 160.
+##
+## lexpr -> lexpr . PLUS lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . MINUS lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . TIMES lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . SLASH lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . PERCENT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr PERCENT lexpr . [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . POW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . POWDOT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . AND lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . OR lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . XOR lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LRARROW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . RIGHTARROW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LE lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . GT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . GE lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . EQUAL lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . NOTEQ lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . HAT LEFTBR INTEGER COMMA INTEGER RIGHTBR [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . AT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## lexpr PERCENT lexpr
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON VOID PERCENT XOR
+##
+## Ends in an error in state: 159.
+##
+## lexpr -> lexpr PERCENT . lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## lexpr PERCENT
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON VOID PLUS LEFTSQ BAR INTEGER BAR RIGHTSQ VOID
+##
+## Ends in an error in state: 158.
+##
+## lexpr -> lexpr . PLUS lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr PLUS lexpr . [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . MINUS lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . TIMES lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . SLASH lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . PERCENT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . POW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . POWDOT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . AND lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . OR lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . XOR lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LRARROW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . RIGHTARROW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LE lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . GT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . GE lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . EQUAL lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . NOTEQ lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . HAT LEFTBR INTEGER COMMA INTEGER RIGHTBR [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . AT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## lexpr PLUS lexpr
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON VOID PLUS XOR
+##
+## Ends in an error in state: 157.
+##
+## lexpr -> lexpr PLUS . lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## lexpr PLUS
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON VOID POW LEFTSQ BAR INTEGER BAR RIGHTSQ VOID
+##
+## Ends in an error in state: 156.
+##
+## lexpr -> lexpr . PLUS lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . MINUS lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . TIMES lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . SLASH lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . PERCENT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . POW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr POW lexpr . [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . POWDOT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . AND lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . OR lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . XOR lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LRARROW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . RIGHTARROW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LE lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . GT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . GE lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . EQUAL lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . NOTEQ lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . HAT LEFTBR INTEGER COMMA INTEGER RIGHTBR [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . AT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## lexpr POW lexpr
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON VOID POW XOR
+##
+## Ends in an error in state: 155.
+##
+## lexpr -> lexpr POW . lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## lexpr POW
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON VOID POWDOT LEFTSQ BAR INTEGER BAR RIGHTSQ VOID
+##
+## Ends in an error in state: 154.
+##
+## lexpr -> lexpr . PLUS lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . MINUS lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . TIMES lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . SLASH lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . PERCENT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . POW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . POWDOT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr POWDOT lexpr . [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . AND lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . OR lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . XOR lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LRARROW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . RIGHTARROW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LE lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . GT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . GE lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . EQUAL lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . NOTEQ lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . HAT LEFTBR INTEGER COMMA INTEGER RIGHTBR [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . AT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## lexpr POWDOT lexpr
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON VOID POWDOT XOR
+##
+## Ends in an error in state: 153.
+##
+## lexpr -> lexpr POWDOT . lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## lexpr POWDOT
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON VOID PV XOR
+##
+## Ends in an error in state: 305.
+##
+## rewriting_list -> lexpr PV . [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM ]
+## rewriting_list -> lexpr PV . rewriting_list [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM ]
+##
+## The known suffix of the stack is as follows:
+## lexpr PV
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON VOID QM XOR
+##
+## Ends in an error in state: 127.
+##
+## simple_expr -> simple_expr QM . raw_ident [ XOR WITH TYPE TIMES THEORY THEN SLASH SHARP RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING QM_ID QM PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTSQ LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE DOT COMMA COLON CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## simple_expr QM
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON VOID RIGHTARROW LEFTSQ BAR INTEGER BAR RIGHTSQ VOID
+##
+## Ends in an error in state: 152.
+##
+## lexpr -> lexpr . PLUS lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . MINUS lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . TIMES lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . SLASH lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . PERCENT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . POW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . POWDOT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . AND lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . OR lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . XOR lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LRARROW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . RIGHTARROW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr RIGHTARROW lexpr . [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LE lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . GT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . GE lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . EQUAL lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . NOTEQ lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . HAT LEFTBR INTEGER COMMA INTEGER RIGHTBR [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . AT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## lexpr RIGHTARROW lexpr
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON VOID RIGHTARROW XOR
+##
+## Ends in an error in state: 151.
+##
+## lexpr -> lexpr RIGHTARROW . lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## lexpr RIGHTARROW
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON VOID SHARP XOR
+##
+## Ends in an error in state: 124.
+##
+## simple_expr -> simple_expr SHARP . raw_ident [ XOR WITH TYPE TIMES THEORY THEN SLASH SHARP RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING QM_ID QM PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTSQ LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE DOT COMMA COLON CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## simple_expr SHARP
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON VOID SLASH LEFTSQ BAR INTEGER BAR RIGHTSQ VOID
+##
+## Ends in an error in state: 150.
+##
+## lexpr -> lexpr . PLUS lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . MINUS lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . TIMES lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . SLASH lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr SLASH lexpr . [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . PERCENT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . POW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . POWDOT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . AND lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . OR lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . XOR lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LRARROW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . RIGHTARROW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LE lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . GT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . GE lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . EQUAL lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . NOTEQ lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . HAT LEFTBR INTEGER COMMA INTEGER RIGHTBR [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . AT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## lexpr SLASH lexpr
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON VOID SLASH XOR
+##
+## Ends in an error in state: 149.
+##
+## lexpr -> lexpr SLASH . lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## lexpr SLASH
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON VOID TIMES LEFTSQ BAR INTEGER BAR RIGHTSQ VOID
+##
+## Ends in an error in state: 136.
+##
+## lexpr -> lexpr . PLUS lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . MINUS lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . TIMES lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr TIMES lexpr . [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . SLASH lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . PERCENT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . POW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . POWDOT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . AND lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . OR lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . XOR lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LRARROW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . RIGHTARROW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LE lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . GT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . GE lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . EQUAL lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . NOTEQ lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . HAT LEFTBR INTEGER COMMA INTEGER RIGHTBR [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . AT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## lexpr TIMES lexpr
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON VOID TIMES XOR
+##
+## Ends in an error in state: 135.
+##
+## lexpr -> lexpr TIMES . lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## lexpr TIMES
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON VOID VOID
+##
+## Ends in an error in state: 123.
+##
+## lexpr -> simple_expr . [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## simple_expr -> simple_expr . DOT raw_ident [ XOR WITH TYPE TIMES THEORY THEN SLASH SHARP RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING QM_ID QM PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTSQ LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE DOT COMMA COLON CASESPLIT BAR AXIOM AT AND ]
+## simple_expr -> simple_expr . LEFTSQ lexpr RIGHTSQ [ XOR WITH TYPE TIMES THEORY THEN SLASH SHARP RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING QM_ID QM PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTSQ LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE DOT COMMA COLON CASESPLIT BAR AXIOM AT AND ]
+## simple_expr -> simple_expr . LEFTSQ separated_nonempty_list(COMMA,array_assignment) RIGHTSQ [ XOR WITH TYPE TIMES THEORY THEN SLASH SHARP RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING QM_ID QM PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTSQ LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE DOT COMMA COLON CASESPLIT BAR AXIOM AT AND ]
+## simple_expr -> simple_expr . COLON primitive_type [ XOR WITH TYPE TIMES THEORY THEN SLASH SHARP RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING QM_ID QM PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTSQ LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE DOT COMMA COLON CASESPLIT BAR AXIOM AT AND ]
+## simple_expr -> simple_expr . QM raw_ident [ XOR WITH TYPE TIMES THEORY THEN SLASH SHARP RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING QM_ID QM PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTSQ LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE DOT COMMA COLON CASESPLIT BAR AXIOM AT AND ]
+## simple_expr -> simple_expr . QM_ID [ XOR WITH TYPE TIMES THEORY THEN SLASH SHARP RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING QM_ID QM PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTSQ LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE DOT COMMA COLON CASESPLIT BAR AXIOM AT AND ]
+## simple_expr -> simple_expr . SHARP raw_ident [ XOR WITH TYPE TIMES THEORY THEN SLASH SHARP RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING QM_ID QM PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTSQ LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE DOT COMMA COLON CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## simple_expr
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON VOID WITH
+##
+## Ends in an error in state: 304.
+##
+## lexpr -> lexpr . PLUS lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . MINUS lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . TIMES lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . SLASH lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . PERCENT lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . POW lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . POWDOT lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . AND lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . OR lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . XOR lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . LRARROW lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . RIGHTARROW lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . LT lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . LE lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . GT lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . GE lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . EQUAL lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . NOTEQ lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . HAT LEFTBR INTEGER COMMA INTEGER RIGHTBR [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## lexpr -> lexpr . AT lexpr [ XOR TYPE TIMES THEORY SLASH RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LE HAT GT GOAL GE FUNC EQUAL EOF AXIOM AT AND ]
+## rewriting_list -> lexpr . [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM ]
+## rewriting_list -> lexpr . PV [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM ]
+## rewriting_list -> lexpr . PV rewriting_list [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM ]
+##
+## The known suffix of the stack is as follows:
+## lexpr
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 123, spurious reduction of production lexpr -> simple_expr 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON VOID XOR LEFTSQ BAR INTEGER BAR RIGHTSQ VOID
+##
+## Ends in an error in state: 134.
+##
+## lexpr -> lexpr . PLUS lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . MINUS lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . TIMES lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . SLASH lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . PERCENT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . POW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . POWDOT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . AND lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . OR lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . XOR lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr XOR lexpr . [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LRARROW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . RIGHTARROW lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . LE lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . GT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . GE lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . EQUAL lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . NOTEQ lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . HAT LEFTBR INTEGER COMMA INTEGER RIGHTBR [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+## lexpr -> lexpr . AT lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## lexpr XOR lexpr
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON VOID XOR XOR
+##
+## Ends in an error in state: 133.
+##
+## lexpr -> lexpr XOR . lexpr [ XOR WITH TYPE TIMES THEORY THEN SLASH RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTARROW LE IN HAT GT GOAL GE FUNC EQUAL EOF END ELSE COMMA CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## lexpr XOR
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID COLON XOR
+##
+## Ends in an error in state: 302.
+##
+## decl -> REWRITING decl_ident COLON . rewriting_list [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM ]
+##
+## The known suffix of the stack is as follows:
+## REWRITING decl_ident COLON
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING ID XOR
+##
+## Ends in an error in state: 301.
+##
+## decl -> REWRITING decl_ident . COLON rewriting_list [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM ]
+##
+## The known suffix of the stack is as follows:
+## REWRITING decl_ident
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITING XOR
+##
+## Ends in an error in state: 300.
+##
+## decl -> REWRITING . decl_ident COLON rewriting_list [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM ]
+##
+## The known suffix of the stack is as follows:
+## REWRITING
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THEORY ID EXTENDS ID EQUAL AXIOM ID COLON VOID WITH
+##
+## Ends in an error in state: 295.
+##
+## lexpr -> lexpr . PLUS lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END CASESPLIT AXIOM AT AND ]
+## lexpr -> lexpr . MINUS lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END CASESPLIT AXIOM AT AND ]
+## lexpr -> lexpr . TIMES lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END CASESPLIT AXIOM AT AND ]
+## lexpr -> lexpr . SLASH lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END CASESPLIT AXIOM AT AND ]
+## lexpr -> lexpr . PERCENT lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END CASESPLIT AXIOM AT AND ]
+## lexpr -> lexpr . POW lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END CASESPLIT AXIOM AT AND ]
+## lexpr -> lexpr . POWDOT lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END CASESPLIT AXIOM AT AND ]
+## lexpr -> lexpr . AND lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END CASESPLIT AXIOM AT AND ]
+## lexpr -> lexpr . OR lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END CASESPLIT AXIOM AT AND ]
+## lexpr -> lexpr . XOR lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END CASESPLIT AXIOM AT AND ]
+## lexpr -> lexpr . LRARROW lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END CASESPLIT AXIOM AT AND ]
+## lexpr -> lexpr . RIGHTARROW lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END CASESPLIT AXIOM AT AND ]
+## lexpr -> lexpr . LT lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END CASESPLIT AXIOM AT AND ]
+## lexpr -> lexpr . LE lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END CASESPLIT AXIOM AT AND ]
+## lexpr -> lexpr . GT lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END CASESPLIT AXIOM AT AND ]
+## lexpr -> lexpr . GE lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END CASESPLIT AXIOM AT AND ]
+## lexpr -> lexpr . EQUAL lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END CASESPLIT AXIOM AT AND ]
+## lexpr -> lexpr . NOTEQ lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END CASESPLIT AXIOM AT AND ]
+## lexpr -> lexpr . HAT LEFTBR INTEGER COMMA INTEGER RIGHTBR [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END CASESPLIT AXIOM AT AND ]
+## lexpr -> lexpr . AT lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END CASESPLIT AXIOM AT AND ]
+## theory_elt -> AXIOM decl_ident COLON lexpr . [ END CASESPLIT AXIOM ]
+##
+## The known suffix of the stack is as follows:
+## AXIOM decl_ident COLON lexpr
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 123, spurious reduction of production lexpr -> simple_expr 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THEORY ID EXTENDS ID EQUAL AXIOM ID COLON XOR
+##
+## Ends in an error in state: 294.
+##
+## theory_elt -> AXIOM decl_ident COLON . lexpr [ END CASESPLIT AXIOM ]
+##
+## The known suffix of the stack is as follows:
+## AXIOM decl_ident COLON
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THEORY ID EXTENDS ID EQUAL AXIOM ID XOR
+##
+## Ends in an error in state: 293.
+##
+## theory_elt -> AXIOM decl_ident . COLON lexpr [ END CASESPLIT AXIOM ]
+##
+## The known suffix of the stack is as follows:
+## AXIOM decl_ident
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THEORY ID EXTENDS ID EQUAL AXIOM XOR
+##
+## Ends in an error in state: 292.
+##
+## theory_elt -> AXIOM . decl_ident COLON lexpr [ END CASESPLIT AXIOM ]
+##
+## The known suffix of the stack is as follows:
+## AXIOM
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THEORY ID EXTENDS ID EQUAL CASESPLIT ID COLON VOID WITH
+##
+## Ends in an error in state: 291.
+##
+## lexpr -> lexpr . PLUS lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END CASESPLIT AXIOM AT AND ]
+## lexpr -> lexpr . MINUS lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END CASESPLIT AXIOM AT AND ]
+## lexpr -> lexpr . TIMES lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END CASESPLIT AXIOM AT AND ]
+## lexpr -> lexpr . SLASH lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END CASESPLIT AXIOM AT AND ]
+## lexpr -> lexpr . PERCENT lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END CASESPLIT AXIOM AT AND ]
+## lexpr -> lexpr . POW lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END CASESPLIT AXIOM AT AND ]
+## lexpr -> lexpr . POWDOT lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END CASESPLIT AXIOM AT AND ]
+## lexpr -> lexpr . AND lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END CASESPLIT AXIOM AT AND ]
+## lexpr -> lexpr . OR lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END CASESPLIT AXIOM AT AND ]
+## lexpr -> lexpr . XOR lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END CASESPLIT AXIOM AT AND ]
+## lexpr -> lexpr . LRARROW lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END CASESPLIT AXIOM AT AND ]
+## lexpr -> lexpr . RIGHTARROW lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END CASESPLIT AXIOM AT AND ]
+## lexpr -> lexpr . LT lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END CASESPLIT AXIOM AT AND ]
+## lexpr -> lexpr . LE lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END CASESPLIT AXIOM AT AND ]
+## lexpr -> lexpr . GT lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END CASESPLIT AXIOM AT AND ]
+## lexpr -> lexpr . GE lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END CASESPLIT AXIOM AT AND ]
+## lexpr -> lexpr . EQUAL lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END CASESPLIT AXIOM AT AND ]
+## lexpr -> lexpr . NOTEQ lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END CASESPLIT AXIOM AT AND ]
+## lexpr -> lexpr . HAT LEFTBR INTEGER COMMA INTEGER RIGHTBR [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END CASESPLIT AXIOM AT AND ]
+## lexpr -> lexpr . AT lexpr [ XOR TIMES SLASH RIGHTARROW POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LE HAT GT GE EQUAL END CASESPLIT AXIOM AT AND ]
+## theory_elt -> CASESPLIT decl_ident COLON lexpr . [ END CASESPLIT AXIOM ]
+##
+## The known suffix of the stack is as follows:
+## CASESPLIT decl_ident COLON lexpr
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 123, spurious reduction of production lexpr -> simple_expr 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THEORY ID EXTENDS ID EQUAL CASESPLIT ID COLON XOR
+##
+## Ends in an error in state: 75.
+##
+## theory_elt -> CASESPLIT decl_ident COLON . lexpr [ END CASESPLIT AXIOM ]
+##
+## The known suffix of the stack is as follows:
+## CASESPLIT decl_ident COLON
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THEORY ID EXTENDS ID EQUAL CASESPLIT ID XOR
+##
+## Ends in an error in state: 74.
+##
+## theory_elt -> CASESPLIT decl_ident . COLON lexpr [ END CASESPLIT AXIOM ]
+##
+## The known suffix of the stack is as follows:
+## CASESPLIT decl_ident
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THEORY ID EXTENDS ID EQUAL CASESPLIT XOR
+##
+## Ends in an error in state: 73.
+##
+## theory_elt -> CASESPLIT . decl_ident COLON lexpr [ END CASESPLIT AXIOM ]
+##
+## The known suffix of the stack is as follows:
+## CASESPLIT
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THEORY ID EXTENDS ID EQUAL XOR
+##
+## Ends in an error in state: 72.
+##
+## decl -> THEORY decl_ident EXTENDS decl_ident EQUAL . list(theory_elt) END [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM ]
+##
+## The known suffix of the stack is as follows:
+## THEORY decl_ident EXTENDS decl_ident EQUAL
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THEORY ID EXTENDS ID XOR
+##
+## Ends in an error in state: 71.
+##
+## decl -> THEORY decl_ident EXTENDS decl_ident . EQUAL list(theory_elt) END [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM ]
+##
+## The known suffix of the stack is as follows:
+## THEORY decl_ident EXTENDS decl_ident
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THEORY ID EXTENDS XOR
+##
+## Ends in an error in state: 70.
+##
+## decl -> THEORY decl_ident EXTENDS . decl_ident EQUAL list(theory_elt) END [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM ]
+##
+## The known suffix of the stack is as follows:
+## THEORY decl_ident EXTENDS
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THEORY ID XOR
+##
+## Ends in an error in state: 69.
+##
+## decl -> THEORY decl_ident . EXTENDS decl_ident EQUAL list(theory_elt) END [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM ]
+##
+## The known suffix of the stack is as follows:
+## THEORY decl_ident
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THEORY XOR
+##
+## Ends in an error in state: 67.
+##
+## decl -> THEORY . decl_ident EXTENDS decl_ident EQUAL list(theory_elt) END [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM ]
+##
+## The known suffix of the stack is as follows:
+## THEORY
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TYPE ID EQUAL ID AND ID EQUAL XOR
+##
+## Ends in an error in state: 65.
+##
+## algebraic_typedef -> type_vars raw_ident EQUAL . separated_nonempty_list(BAR,algebraic_constructor) [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM AND ]
+##
+## The known suffix of the stack is as follows:
+## type_vars raw_ident EQUAL
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TYPE ID EQUAL ID AND ID XOR
+##
+## Ends in an error in state: 64.
+##
+## algebraic_typedef -> type_vars raw_ident . EQUAL separated_nonempty_list(BAR,algebraic_constructor) [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM AND ]
+##
+## The known suffix of the stack is as follows:
+## type_vars raw_ident
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TYPE ID EQUAL ID AND QUOTE ID HEXADECIMAL
+##
+## Ends in an error in state: 63.
+##
+## algebraic_typedef -> type_vars . raw_ident EQUAL separated_nonempty_list(BAR,algebraic_constructor) [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM AND ]
+##
+## The known suffix of the stack is as follows:
+## type_vars
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TYPE ID EQUAL ID AND XOR
+##
+## Ends in an error in state: 62.
+##
+## separated_nonempty_list(AND,algebraic_typedef) -> algebraic_typedef AND . separated_nonempty_list(AND,algebraic_typedef) [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM ]
+##
+## The known suffix of the stack is as follows:
+## algebraic_typedef AND
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TYPE ID EQUAL ID BAR XOR
+##
+## Ends in an error in state: 57.
+##
+## separated_nonempty_list(BAR,algebraic_constructor) -> algebraic_constructor BAR . separated_nonempty_list(BAR,algebraic_constructor) [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM AND ]
+##
+## The known suffix of the stack is as follows:
+## algebraic_constructor BAR
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TYPE ID EQUAL ID OF LEFTBR ID COLON BOOL PV XOR
+##
+## Ends in an error in state: 53.
+##
+## separated_nonempty_list(PV,algebraic_label_with_type) -> algebraic_label_with_type PV . separated_nonempty_list(PV,algebraic_label_with_type) [ RIGHTBR ]
+##
+## The known suffix of the stack is as follows:
+## algebraic_label_with_type PV
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TYPE ID EQUAL ID OF LEFTBR ID COLON BOOL RIGHTBR XOR
+##
+## Ends in an error in state: 56.
+##
+## separated_nonempty_list(BAR,algebraic_constructor) -> algebraic_constructor . [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM AND ]
+## separated_nonempty_list(BAR,algebraic_constructor) -> algebraic_constructor . BAR separated_nonempty_list(BAR,algebraic_constructor) [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM AND ]
+##
+## The known suffix of the stack is as follows:
+## algebraic_constructor
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TYPE ID EQUAL ID OF LEFTBR ID COLON UNIT XOR
+##
+## Ends in an error in state: 51.
+##
+## algebraic_label_with_type -> ident COLON primitive_type . [ RIGHTBR PV ]
+## primitive_type -> primitive_type . ident [ RIGHTBR PV ID ]
+##
+## The known suffix of the stack is as follows:
+## ident COLON primitive_type
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TYPE ID EQUAL ID OF LEFTBR ID COLON XOR
+##
+## Ends in an error in state: 50.
+##
+## algebraic_label_with_type -> ident COLON . primitive_type [ RIGHTBR PV ]
+##
+## The known suffix of the stack is as follows:
+## ident COLON
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TYPE ID EQUAL ID OF LEFTBR ID XOR
+##
+## Ends in an error in state: 49.
+##
+## algebraic_label_with_type -> ident . COLON primitive_type [ RIGHTBR PV ]
+##
+## The known suffix of the stack is as follows:
+## ident
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TYPE ID EQUAL ID OF LEFTBR XOR
+##
+## Ends in an error in state: 46.
+##
+## algebraic_args -> OF LEFTBR . separated_nonempty_list(PV,algebraic_label_with_type) RIGHTBR [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF BAR AXIOM AND ]
+##
+## The known suffix of the stack is as follows:
+## OF LEFTBR
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TYPE ID EQUAL ID OF XOR
+##
+## Ends in an error in state: 45.
+##
+## algebraic_args -> OF . LEFTBR separated_nonempty_list(PV,algebraic_label_with_type) RIGHTBR [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF BAR AXIOM AND ]
+##
+## The known suffix of the stack is as follows:
+## OF
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TYPE ID EQUAL ID XOR
+##
+## Ends in an error in state: 44.
+##
+## algebraic_constructor -> raw_ident . algebraic_args [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF BAR AXIOM AND ]
+##
+## The known suffix of the stack is as follows:
+## raw_ident
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TYPE ID EQUAL LEFTBR ID COLON BOOL PV XOR
+##
+## Ends in an error in state: 18.
+##
+## separated_nonempty_list(PV,record_label_with_type) -> record_label_with_type PV . separated_nonempty_list(PV,record_label_with_type) [ RIGHTBR ]
+##
+## The known suffix of the stack is as follows:
+## record_label_with_type PV
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TYPE ID EQUAL LEFTBR ID COLON UNIT XOR
+##
+## Ends in an error in state: 41.
+##
+## primitive_type -> primitive_type . ident [ RIGHTBR PV ID ]
+## record_label_with_type -> raw_ident COLON primitive_type . [ RIGHTBR PV ]
+##
+## The known suffix of the stack is as follows:
+## raw_ident COLON primitive_type
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TYPE ID EQUAL LEFTBR ID COLON XOR
+##
+## Ends in an error in state: 21.
+##
+## record_label_with_type -> raw_ident COLON . primitive_type [ RIGHTBR PV ]
+##
+## The known suffix of the stack is as follows:
+## raw_ident COLON
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TYPE ID EQUAL LEFTBR ID XOR
+##
+## Ends in an error in state: 20.
+##
+## record_label_with_type -> raw_ident . COLON primitive_type [ RIGHTBR PV ]
+##
+## The known suffix of the stack is as follows:
+## raw_ident
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TYPE ID EQUAL LEFTBR XOR
+##
+## Ends in an error in state: 14.
+##
+## record_type -> LEFTBR . separated_nonempty_list(PV,record_label_with_type) RIGHTBR [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM ]
+##
+## The known suffix of the stack is as follows:
+## LEFTBR
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TYPE ID EQUAL XOR
+##
+## Ends in an error in state: 13.
+##
+## algebraic_typedef -> type_vars raw_ident EQUAL . separated_nonempty_list(BAR,algebraic_constructor) [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM AND ]
+## decl -> TYPE type_vars raw_ident EQUAL . record_type [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM ]
+##
+## The known suffix of the stack is as follows:
+## TYPE type_vars raw_ident EQUAL
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TYPE ID XOR
+##
+## Ends in an error in state: 12.
+##
+## algebraic_typedef -> type_vars raw_ident . EQUAL separated_nonempty_list(BAR,algebraic_constructor) [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM AND ]
+## decl -> TYPE type_vars raw_ident . [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM ]
+## decl -> TYPE type_vars raw_ident . EQUAL record_type [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM ]
+##
+## The known suffix of the stack is as follows:
+## TYPE type_vars raw_ident
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TYPE LEFTPAR QUOTE ID COMMA XOR
+##
+## Ends in an error in state: 6.
+##
+## separated_nonempty_list(COMMA,type_var) -> type_var COMMA . separated_nonempty_list(COMMA,type_var) [ RIGHTPAR ]
+##
+## The known suffix of the stack is as follows:
+## type_var COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TYPE LEFTPAR QUOTE ID XOR
+##
+## Ends in an error in state: 5.
+##
+## separated_nonempty_list(COMMA,type_var) -> type_var . [ RIGHTPAR ]
+## separated_nonempty_list(COMMA,type_var) -> type_var . COMMA separated_nonempty_list(COMMA,type_var) [ RIGHTPAR ]
+##
+## The known suffix of the stack is as follows:
+## type_var
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TYPE LEFTPAR XOR
+##
+## Ends in an error in state: 4.
+##
+## type_vars -> LEFTPAR . separated_nonempty_list(COMMA,type_var) RIGHTPAR [ ID ]
+##
+## The known suffix of the stack is as follows:
+## LEFTPAR
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TYPE QUOTE ID HEXADECIMAL
+##
+## Ends in an error in state: 10.
+##
+## algebraic_typedef -> type_vars . raw_ident EQUAL separated_nonempty_list(BAR,algebraic_constructor) [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM AND ]
+## decl -> TYPE type_vars . raw_ident [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM ]
+## decl -> TYPE type_vars . raw_ident EQUAL record_type [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM ]
+##
+## The known suffix of the stack is as follows:
+## TYPE type_vars
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TYPE QUOTE XOR
+##
+## Ends in an error in state: 2.
+##
+## type_var -> QUOTE . ID [ XOR WITH TYPE TIMES THEORY THEN SLASH SHARP RIGHTSQ RIGHTPAR RIGHTBR RIGHTARROW REWRITING QM_ID QM PV PRED POWDOT POW PLUS PERCENT OR NOTEQ MINUS LT LRARROW LOGIC LEFTSQ LEFTBR LEFTARROW LE IN ID HAT GT GOAL GE FUNC EQUAL EOF END ELSE DOT COMMA COLON CASESPLIT BAR AXIOM AT AND ]
+##
+## The known suffix of the stack is as follows:
+## QUOTE
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TYPE XOR
+##
+## Ends in an error in state: 1.
+##
+## decl -> TYPE . type_vars raw_ident [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM ]
+## decl -> TYPE . separated_nonempty_list(AND,algebraic_typedef) [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM ]
+## decl -> TYPE . type_vars raw_ident EQUAL record_type [ TYPE THEORY REWRITING PRED LOGIC GOAL FUNC EOF AXIOM ]
+##
+## The known suffix of the stack is as follows:
+## TYPE
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: XOR
+##
+## Ends in an error in state: 0.
+##
+## file' -> . file [ # ]
+##
+## The known suffix of the stack is as follows:
+##
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/dimacs/dolmen_dimacs.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/dimacs/dolmen_dimacs.ml
index e57165546aba466d4eb33fdd94924bdabf53b82a..7be1c78511964942d96c4d613557e94b4643c5e1 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/dimacs/dolmen_dimacs.ml
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/dimacs/dolmen_dimacs.ml
@@ -13,6 +13,6 @@ module Make
     type statement = S.t
     let env = []
     let incremental = true
-    let error _ = ""
+    let error s = Syntax_messages.message s
   end)(LexDimacs)(ParseDimacs.Make(L)(T)(S))
 
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/dimacs/dune b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/dimacs/dune
index 94408b1dbee4a88d1eee40eed283969941eec6a3..8a99b90e96bf0a72ca6987fd49732b7e127356f2 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/dimacs/dune
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/dimacs/dune
@@ -12,9 +12,53 @@
  (merge_into parseDimacs)
 )
 
+(rule
+  (target syntax_messages.ml)
+  (deps   (:tokens tokens_dimacs.mly)
+          (:parser parseDimacs.mly)
+          (:msg syntax.messages))
+  (action (with-stdout-to %{target}
+          (run menhir --external-tokens Tokens_dimacs %{tokens}
+                      %{parser} --base %{parser} --compile-errors %{msg})))
+)
+
 (library
   (name           dolmen_dimacs)
   (public_name    dolmen.dimacs)
-  (libraries      dolmen_std menhirLib)
-  (modules        Tokens_dimacs LexDimacs ParseDimacs Ast_dimacs Dolmen_dimacs)
+  (libraries      dolmen_std dolmen_intf menhirLib)
+  (modules        Tokens_dimacs LexDimacs ParseDimacs Ast_dimacs Syntax_messages Dolmen_dimacs)
+)
+
+; Convenience rule to generate a fresh messages file,
+; and update an already existing one.
+(rule
+  (target new.messages)
+  (mode   promote-until-clean)
+  (deps   (:tokens tokens_dimacs.mly)
+          (:parser parseDimacs.mly))
+  (action (with-stdout-to %{target}
+          (run menhir --external-tokens Tokens_dimacs %{tokens}
+                      %{parser} --base %{parser} --list-errors)))
+)
+
+(rule
+  (target updated.messages)
+  (mode   promote-until-clean)
+  (deps   (:tokens tokens_dimacs.mly)
+          (:parser parseDimacs.mly)
+          (:msg syntax.messages))
+  (action (with-stdout-to %{target}
+          (run menhir --external-tokens Tokens_dimacs %{tokens}
+                      %{parser} --base %{parser} --update-errors %{msg})))
+)
+
+; Additional rule to add to runtest a check that the messages file is up-to-date
+(rule
+  (alias runtest)
+  (deps   (:tokens tokens_dimacs.mly)
+          (:parser parseDimacs.mly)
+          (:new new.messages)
+          (:msg syntax.messages))
+  (action (run menhir --external-tokens Tokens_dimacs %{tokens}
+                      %{parser} --base %{parser} --compare-errors %{new} --compare-errors %{msg}))
 )
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/dimacs/lexDimacs.mll b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/dimacs/lexDimacs.mll
index 645d5d12206b0836d3d4e48aff1abef20d10c381..ce9a3b289c15ea06c2f62bc03dedc7f4708089ca 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/dimacs/lexDimacs.mll
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/dimacs/lexDimacs.mll
@@ -2,9 +2,21 @@
 (* This file is free software, part of dolmen. See file "LICENSE" for more details. *)
 
 {
+  exception Error
+
+  module T = Dolmen_std.Tok
+
   open Tokens_dimacs
 
-  exception Error
+  let descr token : T.descr =
+    match (token : token) with
+    | EOF -> T.descr ~kind:"end of file token" ""
+    | P -> T.descr ~kind:"keyword" "p"
+    | CNF -> T.descr ~kind:"keyword" "cnf"
+    | NEWLINE -> T.descr ~kind:"newline character" ""
+    | ZERO -> T.descr ~kind:"integer" "0"
+    | INT i -> T.descr ~kind:"integer" (string_of_int i)
+
 }
 
 let zero_numeric = '0'
@@ -18,18 +30,18 @@ let number = positive_number | negative_number
 let printable_char = [^ '\n']
 let comment = ['c'] printable_char* ['\n']
 
-rule token = parse
-  | "c"             { comment lexbuf }
+rule token newline = parse
+  | "c"             { comment newline lexbuf }
   | "p"             { P }
   | "cnf"           { CNF }
   | eof             { EOF }
   | zero_numeric    { ZERO }
-  | [' ' '\t' '\r'] { token lexbuf }
+  | [' ' '\t' '\r'] { token newline lexbuf }
   | number          { INT (int_of_string @@ Lexing.lexeme lexbuf) }
-  | '\n'            { Lexing.new_line lexbuf; NEWLINE }
+  | '\n'            { newline lexbuf; NEWLINE }
   | _               { raise Error }
 
-and comment = parse
-  | '\n'  { Lexing.new_line lexbuf; token lexbuf }
-  | printable_char { comment lexbuf }
+and comment newline = parse
+  | '\n'  { newline lexbuf; token newline lexbuf }
+  | printable_char { comment newline lexbuf }
 
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/dimacs/parseDimacs.mly b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/dimacs/parseDimacs.mly
index deb3e0d37645b90175b4afa95b3b6ea6166c185b..99f0555ad56ff2961a21d7b03ec2c162fb042d9f 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/dimacs/parseDimacs.mly
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/dimacs/parseDimacs.mly
@@ -15,14 +15,12 @@
 %%
 
 input:
-  | NEWLINE i=input
-    { i }
-  | p=start
-    { Some p }
-  | c=clause
-    { Some c }
-  | EOF
+  | NEWLINE* EOF
     { None }
+  | NEWLINE* s=start
+    { Some s }
+  | NEWLINE* c=clause
+    { Some c }
 
 file:
   | NEWLINE* h=start l=cnf
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/dimacs/syntax.messages b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/dimacs/syntax.messages
new file mode 100644
index 0000000000000000000000000000000000000000..ad52c40858cfc62d3b07f0ceabd3442bc595532e
--- /dev/null
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/dimacs/syntax.messages
@@ -0,0 +1,295 @@
+#
+# Syntax Error Messages for dimacs
+#
+# Each error message *must* follow the following format:
+#
+# """
+# XXX
+# production parsed (on a single line)
+# what is expected at that point,
+# possibly on multiple lines
+# """
+#
+# The error numbers can be pretty much arbitrary, but for each
+# error number XXX, a corresponding test case file must exists as
+# tests/parsing/dimacs/errors/XXX_some_descr_of_the_error_Y.smt2
+# (Y is there to allow multiple example of the error test case to exist,
+# for instance with various different error tokens)
+#
+# Notes:
+# - some error messages are shared among more than one error case,
+#   in such cases, the error number is the same, so when modifying
+#   an error message, be sure to modify all occurrences of the same
+#   error number
+
+
+input: ZERO
+##
+## Ends in an error in state: 23.
+##
+## input' -> . input [ # ]
+##
+## The known suffix of the stack is as follows:
+##
+##
+
+001
+an input sentence
+a p-cnf header if there hasn't been one yet,
+or a clause starting with a non-zero integer
+
+file: NEWLINE INT
+##
+## Ends in an error in state: 3.
+##
+## file -> list(NEWLINE) . start cnf [ # ]
+##
+## The known suffix of the stack is as follows:
+## list(NEWLINE)
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 1, spurious reduction of production list(NEWLINE) -> 
+## In state 2, spurious reduction of production list(NEWLINE) -> NEWLINE list(NEWLINE) 
+##
+
+001
+an input sentence
+a p-cnf header if there hasn't been one yet,
+or a clause starting with a non-zero integer
+
+file: NEWLINE ZERO
+##
+## Ends in an error in state: 1.
+##
+## list(NEWLINE) -> NEWLINE . list(NEWLINE) [ P INT EOF ]
+##
+## The known suffix of the stack is as follows:
+## NEWLINE
+##
+
+001
+an input sentence
+a p-cnf header if there hasn't been one yet,
+or a clause starting with a non-zero integer
+
+file: P CNF INT INT NEWLINE INT ZERO NEWLINE ZERO
+##
+## Ends in an error in state: 17.
+##
+## cnf -> clause . cnf [ # ]
+##
+## The known suffix of the stack is as follows:
+## clause
+##
+
+001
+an input sentence
+a p-cnf header if there hasn't been one yet,
+or a clause starting with a non-zero integer
+
+file: P CNF INT INT NEWLINE NEWLINE ZERO
+##
+## Ends in an error in state: 10.
+##
+## cnf -> NEWLINE . cnf [ # ]
+##
+## The known suffix of the stack is as follows:
+## NEWLINE
+##
+
+001
+an input sentence
+a p-cnf header if there hasn't been one yet,
+or a clause starting with a non-zero integer
+
+file: P CNF INT INT NEWLINE ZERO
+##
+## Ends in an error in state: 9.
+##
+## file -> list(NEWLINE) start . cnf [ # ]
+##
+## The known suffix of the stack is as follows:
+## list(NEWLINE) start
+##
+
+001
+an input sentence
+a p-cnf header if there hasn't been one yet,
+or a clause starting with a non-zero integer
+
+file: ZERO
+##
+## Ends in an error in state: 0.
+##
+## file' -> . file [ # ]
+##
+## The known suffix of the stack is as follows:
+##
+##
+
+001
+an input sentence
+a p-cnf header if there hasn't been one yet,
+or a clause starting with a non-zero integer
+
+input: P ZERO
+##
+## Ends in an error in state: 25.
+##
+## start -> P . CNF INT INT NEWLINE [ # ]
+##
+## The known suffix of the stack is as follows:
+## P
+##
+
+002
+a p-cnf header
+the keyword "cnf"
+
+file: P ZERO
+##
+## Ends in an error in state: 4.
+##
+## start -> P . CNF INT INT NEWLINE [ NEWLINE INT EOF ]
+##
+## The known suffix of the stack is as follows:
+## P
+##
+
+002
+a p-cnf header
+the keyword "cnf"
+
+input: P CNF ZERO
+##
+## Ends in an error in state: 26.
+##
+## start -> P CNF . INT INT NEWLINE [ # ]
+##
+## The known suffix of the stack is as follows:
+## P CNF
+##
+
+003
+a p-cnf header
+a non-zero integer for the number of variables
+
+file: P CNF ZERO
+##
+## Ends in an error in state: 5.
+##
+## start -> P CNF . INT INT NEWLINE [ NEWLINE INT EOF ]
+##
+## The known suffix of the stack is as follows:
+## P CNF
+##
+
+003
+a p-cnf header
+a non-zero integer for the number of variables
+
+input: P CNF INT ZERO
+##
+## Ends in an error in state: 27.
+##
+## start -> P CNF INT . INT NEWLINE [ # ]
+##
+## The known suffix of the stack is as follows:
+## P CNF INT
+##
+
+004
+a p-cnf header
+a non-zero integer for the number of clauses
+
+file: P CNF INT ZERO
+##
+## Ends in an error in state: 6.
+##
+## start -> P CNF INT . INT NEWLINE [ NEWLINE INT EOF ]
+##
+## The known suffix of the stack is as follows:
+## P CNF INT
+##
+
+004
+a p-cnf header
+a non-zero integer for the number of clauses
+
+input: P CNF INT INT ZERO
+##
+## Ends in an error in state: 28.
+##
+## start -> P CNF INT INT . NEWLINE [ # ]
+##
+## The known suffix of the stack is as follows:
+## P CNF INT INT
+##
+
+005
+a p-cnf header
+a newline character to end the header
+
+file: P CNF INT INT ZERO
+##
+## Ends in an error in state: 7.
+##
+## start -> P CNF INT INT . NEWLINE [ NEWLINE INT EOF ]
+##
+## The known suffix of the stack is as follows:
+## P CNF INT INT
+##
+
+005
+a p-cnf header
+a newline character to end the header
+
+input: INT P
+##
+## Ends in an error in state: 19.
+##
+## nonempty_list(atom) -> atom . [ ZERO ]
+## nonempty_list(atom) -> atom . nonempty_list(atom) [ ZERO ]
+##
+## The known suffix of the stack is as follows:
+## atom
+##
+
+006
+a clause
+an integer, either zero to mark the end of the clause, or
+a non-zero integer to add to the clause
+
+input: INT ZERO ZERO
+##
+## Ends in an error in state: 33.
+##
+## clause -> nonempty_list(atom) ZERO . NEWLINE [ # ]
+##
+## The known suffix of the stack is as follows:
+## nonempty_list(atom) ZERO
+##
+
+008
+a clause
+a newline to properly finish the clause after the zero
+
+file: P CNF INT INT NEWLINE INT ZERO ZERO
+##
+## Ends in an error in state: 14.
+##
+## clause -> nonempty_list(atom) ZERO . NEWLINE [ NEWLINE INT EOF ]
+##
+## The known suffix of the stack is as follows:
+## nonempty_list(atom) ZERO
+##
+
+008
+a clause
+a newline to properly finish the clause after the zero
+
+
+
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/icnf/ast_iCNF.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/icnf/ast_iCNF.ml
index 279eba88ddadd1807babac5e3692e6cd1a1b8cdf..d4970bf4c8f266e5a4f072066cd876fdfc0c36e4 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/icnf/ast_iCNF.ml
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/icnf/ast_iCNF.ml
@@ -35,6 +35,9 @@ module type Statement = sig
   type location
   (** The type of locations. *)
 
+  val p_inccnf : ?loc:location -> unit -> t
+  (** header of an iCNF file. *)
+
   val clause : ?loc:location -> term list -> t
   (** Make a clause from a list of literals. *)
 
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/icnf/dolmen_icnf.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/icnf/dolmen_icnf.ml
index d76df1663a36e6fbe4000f0a13561760644dfe46..411b7ee1dca2b01fa37ed2e36eadd4ad58f7f73c 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/icnf/dolmen_icnf.ml
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/icnf/dolmen_icnf.ml
@@ -13,6 +13,6 @@ module Make
     type statement = S.t
     let env = []
     let incremental = true
-    let error _ = ""
+    let error s = Syntax_messages.message s
   end)(LexiCNF)(ParseiCNF.Make(L)(T)(S))
 
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/icnf/dune b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/icnf/dune
index 7f610cca34e01ddb3a48ee48566f82621b37f0f3..38020e6ed37798d945cda8b4357b15bf561072f8 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/icnf/dune
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/icnf/dune
@@ -12,10 +12,53 @@
  (merge_into parseiCNF)
 )
 
+(rule
+  (target syntax_messages.ml)
+  (deps   (:tokens tokens_iCNF.mly)
+          (:parser parseiCNF.mly)
+          (:msg syntax.messages))
+  (action (with-stdout-to %{target}
+          (run menhir --external-tokens Tokens_iCNF %{tokens}
+                      %{parser} --base %{parser} --compile-errors %{msg})))
+)
 
 (library
   (name           dolmen_icnf)
   (public_name    dolmen.icnf)
-  (libraries      dolmen_std menhirLib)
-  (modules        Tokens_iCNF LexiCNF ParseiCNF Ast_iCNF Dolmen_icnf)
+  (libraries      dolmen_std dolmen_intf menhirLib)
+  (modules        Tokens_iCNF LexiCNF ParseiCNF Ast_iCNF Syntax_messages Dolmen_icnf)
+)
+
+; Convenience rule to generate a fresh messages file,
+; and update an already existing one.
+(rule
+  (target new.messages)
+  (mode   promote-until-clean)
+  (deps   (:tokens tokens_iCNF.mly)
+          (:parser parseiCNF.mly))
+  (action (with-stdout-to %{target}
+          (run menhir --external-tokens Tokens_iCNF %{tokens}
+                      %{parser} --base %{parser} --list-errors)))
+)
+
+(rule
+  (target updated.messages)
+  (mode   promote-until-clean)
+  (deps   (:tokens tokens_iCNF.mly)
+          (:parser parseiCNF.mly)
+          (:msg syntax.messages))
+  (action (with-stdout-to %{target}
+          (run menhir --external-tokens Tokens_iCNF %{tokens}
+                      %{parser} --base %{parser} --update-errors %{msg})))
+)
+
+; Additional rule to add to runtest a check that the messages file is up-to-date
+(rule
+  (alias runtest)
+  (deps   (:tokens tokens_iCNF.mly)
+          (:parser parseiCNF.mly)
+          (:new new.messages)
+          (:msg syntax.messages))
+  (action (run menhir --external-tokens Tokens_iCNF %{tokens}
+                      %{parser} --base %{parser} --compare-errors %{new} --compare-errors %{msg}))
 )
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/icnf/lexiCNF.mll b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/icnf/lexiCNF.mll
index 0193b6460ef10190c0b83627ac5e85e4ab2ade53..6c66e115ea01c9e101fe52964f09ee33a9e002d3 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/icnf/lexiCNF.mll
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/icnf/lexiCNF.mll
@@ -2,9 +2,22 @@
 (* This file is free software, part of dolmen. See file "LICENSE" for more details. *)
 
 {
+  exception Error
+
+  module T = Dolmen_std.Tok
+
   open Tokens_iCNF
 
-  exception Error
+  let descr token : T.descr =
+    match (token : token) with
+    | EOF -> T.descr ~kind:"end of file token" ""
+    | NEWLINE -> T.descr ~kind:"newline character" ""
+    | A -> T.descr ~kind:"keyword" "a"
+    | P -> T.descr ~kind:"keyword" "p"
+    | INCCNF -> T.descr ~kind:"keyword" "inccnf"
+    | ZERO -> T.descr ~kind:"integer" "0"
+    | INT i -> T.descr ~kind:"integer" (string_of_int i)
+
 }
 
 let zero_numeric = '0'
@@ -18,19 +31,19 @@ let number = positive_number | negative_number
 let printable_char = [^ '\n']
 let comment = ['c'] printable_char* ['\n']
 
-rule token = parse
-  | "c"             { comment lexbuf }
+rule token newline = parse
+  | "c"             { comment newline lexbuf }
   | "p"             { P }
   | "a"             { A }
   | "inccnf"        { INCCNF }
   | eof             { EOF }
   | zero_numeric    { ZERO }
-  | [' ' '\t' '\r'] { token lexbuf }
+  | [' ' '\t' '\r'] { token newline lexbuf }
   | number          { INT (int_of_string @@ Lexing.lexeme lexbuf) }
-  | '\n'            { Lexing.new_line lexbuf; NEWLINE }
+  | '\n'            { newline lexbuf; NEWLINE }
   | _               { raise Error }
 
-and comment = parse
-  | '\n'  { Lexing.new_line lexbuf; token lexbuf }
-  | printable_char { comment lexbuf }
+and comment newline = parse
+  | '\n'  { newline lexbuf; token newline lexbuf }
+  | printable_char { comment newline lexbuf }
 
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/icnf/new.messages b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/icnf/new.messages
new file mode 100644
index 0000000000000000000000000000000000000000..7e0eb6805cbb60c5ce62b32a1302587335c59c2a
--- /dev/null
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/icnf/new.messages
@@ -0,0 +1,241 @@
+input: A INT P
+##
+## Ends in an error in state: 15.
+##
+## list(atom) -> atom . list(atom) [ ZERO ]
+##
+## The known suffix of the stack is as follows:
+## atom
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: A P
+##
+## Ends in an error in state: 35.
+##
+## assumption -> A . list(atom) ZERO NEWLINE [ # ]
+##
+## The known suffix of the stack is as follows:
+## A
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: A ZERO ZERO
+##
+## Ends in an error in state: 37.
+##
+## assumption -> A list(atom) ZERO . NEWLINE [ # ]
+##
+## The known suffix of the stack is as follows:
+## A list(atom) ZERO
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: INT P
+##
+## Ends in an error in state: 23.
+##
+## nonempty_list(atom) -> atom . [ ZERO ]
+## nonempty_list(atom) -> atom . nonempty_list(atom) [ ZERO ]
+##
+## The known suffix of the stack is as follows:
+## atom
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: INT ZERO ZERO
+##
+## Ends in an error in state: 41.
+##
+## clause -> nonempty_list(atom) ZERO . NEWLINE [ # ]
+##
+## The known suffix of the stack is as follows:
+## nonempty_list(atom) ZERO
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: NEWLINE ZERO
+##
+## Ends in an error in state: 33.
+##
+## input -> NEWLINE . input [ # ]
+##
+## The known suffix of the stack is as follows:
+## NEWLINE
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: P INCCNF ZERO
+##
+## Ends in an error in state: 31.
+##
+## start -> P INCCNF . NEWLINE [ # ]
+##
+## The known suffix of the stack is as follows:
+## P INCCNF
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: P ZERO
+##
+## Ends in an error in state: 30.
+##
+## start -> P . INCCNF NEWLINE [ # ]
+##
+## The known suffix of the stack is as follows:
+## P
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: ZERO
+##
+## Ends in an error in state: 29.
+##
+## input' -> . input [ # ]
+##
+## The known suffix of the stack is as follows:
+##
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: NEWLINE ZERO
+##
+## Ends in an error in state: 1.
+##
+## list(NEWLINE) -> NEWLINE . list(NEWLINE) [ P ]
+##
+## The known suffix of the stack is as follows:
+## NEWLINE
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: P INCCNF NEWLINE A P
+##
+## Ends in an error in state: 11.
+##
+## assumption -> A . list(atom) ZERO NEWLINE [ NEWLINE INT EOF A ]
+##
+## The known suffix of the stack is as follows:
+## A
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: P INCCNF NEWLINE A ZERO NEWLINE ZERO
+##
+## Ends in an error in state: 25.
+##
+## problem -> assumption . problem [ # ]
+##
+## The known suffix of the stack is as follows:
+## assumption
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: P INCCNF NEWLINE A ZERO ZERO
+##
+## Ends in an error in state: 13.
+##
+## assumption -> A list(atom) ZERO . NEWLINE [ NEWLINE INT EOF A ]
+##
+## The known suffix of the stack is as follows:
+## A list(atom) ZERO
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: P INCCNF NEWLINE INT ZERO NEWLINE ZERO
+##
+## Ends in an error in state: 21.
+##
+## problem -> clause . problem [ # ]
+##
+## The known suffix of the stack is as follows:
+## clause
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: P INCCNF NEWLINE INT ZERO ZERO
+##
+## Ends in an error in state: 19.
+##
+## clause -> nonempty_list(atom) ZERO . NEWLINE [ NEWLINE INT EOF A ]
+##
+## The known suffix of the stack is as follows:
+## nonempty_list(atom) ZERO
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: P INCCNF NEWLINE NEWLINE ZERO
+##
+## Ends in an error in state: 8.
+##
+## problem -> NEWLINE . problem [ # ]
+##
+## The known suffix of the stack is as follows:
+## NEWLINE
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: P INCCNF NEWLINE ZERO
+##
+## Ends in an error in state: 7.
+##
+## file -> list(NEWLINE) start . problem [ # ]
+##
+## The known suffix of the stack is as follows:
+## list(NEWLINE) start
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: P INCCNF ZERO
+##
+## Ends in an error in state: 5.
+##
+## start -> P INCCNF . NEWLINE [ NEWLINE INT EOF A ]
+##
+## The known suffix of the stack is as follows:
+## P INCCNF
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: P ZERO
+##
+## Ends in an error in state: 4.
+##
+## start -> P . INCCNF NEWLINE [ NEWLINE INT EOF A ]
+##
+## The known suffix of the stack is as follows:
+## P
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: ZERO
+##
+## Ends in an error in state: 0.
+##
+## file' -> . file [ # ]
+##
+## The known suffix of the stack is as follows:
+##
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/icnf/old.messages b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/icnf/old.messages
new file mode 100644
index 0000000000000000000000000000000000000000..85010ae54af40ebc28c80b493d5b1ab7f252f079
--- /dev/null
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/icnf/old.messages
@@ -0,0 +1,285 @@
+#
+# Syntax Error Messages for iCNF
+#
+# Each error message *must* follow the following format:
+#
+# """
+# XXX
+# production parsed (on a single line)
+# what is expected at that point,
+# possibly on multiple lines
+# """
+#
+# The error numbers can be pretty much arbitrary, but for each
+# error number XXX, a corresponding test case file must exists as
+# tests/parsing/icnf/errors/XXX_some_descr_of_the_error_Y.smt2
+# (Y is there to allow multiple example of the error test case to exist,
+# for instance with various different error tokens)
+#
+# Notes:
+# - some error messages are shared among more than one error case,
+#   in such cases, the error number is the same, so when modifying
+#   an error message, be sure to modify all occurrences of the same
+#   error number
+
+input: A INT P
+##
+## Ends in an error in state: 15.
+##
+## list(atom) -> atom . list(atom) [ ZERO ]
+##
+## The known suffix of the stack is as follows:
+## atom
+##
+
+001
+an assumption
+either another atom (i.e. non-zero integer), or the integer
+zero to close the assumption
+
+input: A P
+##
+## Ends in an error in state: 32.
+##
+## assumption -> A . list(atom) ZERO NEWLINE [ # ]
+##
+## The known suffix of the stack is as follows:
+## A
+##
+
+002
+an assumption
+an atom, i.e. a non-zero integer
+
+input: A ZERO ZERO
+##
+## Ends in an error in state: 34.
+##
+## assumption -> A list(atom) ZERO . NEWLINE [ # ]
+##
+## The known suffix of the stack is as follows:
+## A list(atom) ZERO
+##
+
+003
+an assumption
+a newline character
+
+input: INT P
+##
+## Ends in an error in state: 23.
+##
+## nonempty_list(atom) -> atom . [ ZERO ]
+## nonempty_list(atom) -> atom . nonempty_list(atom) [ ZERO ]
+##
+## The known suffix of the stack is as follows:
+## atom
+##
+
+004
+a clause
+either another atom (i.e. non-zero integer), or the integer
+zero to close the clause
+
+input: INT ZERO ZERO
+##
+## Ends in an error in state: 38.
+##
+## clause -> nonempty_list(atom) ZERO . NEWLINE [ # ]
+##
+## The known suffix of the stack is as follows:
+## nonempty_list(atom) ZERO
+##
+
+005
+a clause
+a newline character
+
+input: NEWLINE ZERO
+##
+## Ends in an error in state: 30.
+##
+## input -> NEWLINE . input [ # ]
+##
+## The known suffix of the stack is as follows:
+## NEWLINE
+##
+
+006
+an input
+either a non-zero integer to start a clause, the keyword
+'a' to start an assumption, or the keyword 'p' to start
+a header
+
+input: P INCCNF NEWLINE ZERO
+##
+## Ends in an error in state: 36.
+##
+## input -> start . input [ # ]
+##
+## The known suffix of the stack is as follows:
+## start
+##
+
+006
+an input
+either a non-zero integer to start a clause, the keyword
+'a' to start an assumption, or the keyword 'p' to start
+a header
+
+input: P INCCNF ZERO
+##
+## Ends in an error in state: 5.
+##
+## start -> P INCCNF . NEWLINE [ P NEWLINE INT EOF A ]
+##
+## The known suffix of the stack is as follows:
+## P INCCNF
+##
+
+007
+an p-inccnf header
+a newline character to end the p-inccnf header
+
+input: P ZERO
+##
+## Ends in an error in state: 4.
+##
+## start -> P . INCCNF NEWLINE [ P NEWLINE INT EOF A ]
+##
+## The known suffix of the stack is as follows:
+## P
+##
+
+008
+a p-inccnf header
+the 'inccnf' header'
+
+input: ZERO
+##
+## Ends in an error in state: 29.
+##
+## input' -> . input [ # ]
+##
+## The known suffix of the stack is as follows:
+##
+##
+
+006
+an input
+either a non-zero integer to start a clause, the keyword
+'a' to start an assumption, or the keyword 'p' to start
+a header
+
+file: NEWLINE ZERO
+##
+## Ends in an error in state: 1.
+##
+## list(NEWLINE) -> NEWLINE . list(NEWLINE) [ P ]
+##
+## The known suffix of the stack is as follows:
+## NEWLINE
+##
+
+006
+an input
+either a non-zero integer to start a clause, the keyword
+'a' to start an assumption, or the keyword 'p' to start
+a header
+
+file: P INCCNF NEWLINE A P
+##
+## Ends in an error in state: 11.
+##
+## assumption -> A . list(atom) ZERO NEWLINE [ NEWLINE INT EOF A ]
+##
+## The known suffix of the stack is as follows:
+## A
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: P INCCNF NEWLINE A ZERO NEWLINE ZERO
+##
+## Ends in an error in state: 25.
+##
+## problem -> assumption . problem [ # ]
+##
+## The known suffix of the stack is as follows:
+## assumption
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: P INCCNF NEWLINE A ZERO ZERO
+##
+## Ends in an error in state: 13.
+##
+## assumption -> A list(atom) ZERO . NEWLINE [ NEWLINE INT EOF A ]
+##
+## The known suffix of the stack is as follows:
+## A list(atom) ZERO
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: P INCCNF NEWLINE INT ZERO NEWLINE ZERO
+##
+## Ends in an error in state: 21.
+##
+## problem -> clause . problem [ # ]
+##
+## The known suffix of the stack is as follows:
+## clause
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: P INCCNF NEWLINE INT ZERO ZERO
+##
+## Ends in an error in state: 19.
+##
+## clause -> nonempty_list(atom) ZERO . NEWLINE [ NEWLINE INT EOF A ]
+##
+## The known suffix of the stack is as follows:
+## nonempty_list(atom) ZERO
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: P INCCNF NEWLINE NEWLINE ZERO
+##
+## Ends in an error in state: 8.
+##
+## problem -> NEWLINE . problem [ # ]
+##
+## The known suffix of the stack is as follows:
+## NEWLINE
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: P INCCNF NEWLINE ZERO
+##
+## Ends in an error in state: 7.
+##
+## file -> list(NEWLINE) start . problem [ # ]
+##
+## The known suffix of the stack is as follows:
+## list(NEWLINE) start
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: ZERO
+##
+## Ends in an error in state: 0.
+##
+## file' -> . file [ # ]
+##
+## The known suffix of the stack is as follows:
+##
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/icnf/parseiCNF.mly b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/icnf/parseiCNF.mly
index c624fa45794797a8e4853a642be50ea7165f1dda..0557269d8a8ce7c09bcb1ed147a3dfa4532d33c5 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/icnf/parseiCNF.mly
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/icnf/parseiCNF.mly
@@ -16,8 +16,9 @@
 
 input:
   | NEWLINE i=input
-  | start i=input
     { i }
+  | s=start
+    { Some s }
   | c=clause
     { Some c }
   | a=assumption
@@ -31,7 +32,7 @@ file:
 
 start:
   | P INCCNF NEWLINE
-    { () }
+    { let loc = L.mk_pos $startpos $endpos in S.p_inccnf ~loc () }
 
 problem:
   | EOF
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/icnf/syntax.messages b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/icnf/syntax.messages
new file mode 100644
index 0000000000000000000000000000000000000000..057d7771cfa56539e3c2bfad8066b451462eb8b0
--- /dev/null
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/icnf/syntax.messages
@@ -0,0 +1,323 @@
+#
+# Syntax Error Messages for iCNF
+#
+# Each error message *must* follow the following format:
+#
+# """
+# XXX
+# production parsed (on a single line)
+# what is expected at that point,
+# possibly on multiple lines
+# """
+#
+# The error numbers can be pretty much arbitrary, but for each
+# error number XXX, a corresponding test case file must exists as
+# tests/parsing/icnf/errors/XXX_some_descr_of_the_error_Y.smt2
+# (Y is there to allow multiple example of the error test case to exist,
+# for instance with various different error tokens)
+#
+# Notes:
+# - some error messages are shared among more than one error case,
+#   in such cases, the error number is the same, so when modifying
+#   an error message, be sure to modify all occurrences of the same
+#   error number
+
+input: A INT P
+##
+## Ends in an error in state: 15.
+##
+## list(atom) -> atom . list(atom) [ ZERO ]
+##
+## The known suffix of the stack is as follows:
+## atom
+##
+
+001
+an assumption
+either another atom (i.e. non-zero integer), or the integer
+zero to close the assumption
+
+input: A P
+##
+## Ends in an error in state: 35.
+##
+## assumption -> A . list(atom) ZERO NEWLINE [ # ]
+##
+## The known suffix of the stack is as follows:
+## A
+##
+
+002
+an assumption
+an atom, i.e. a non-zero integer
+
+input: A ZERO ZERO
+##
+## Ends in an error in state: 37.
+##
+## assumption -> A list(atom) ZERO . NEWLINE [ # ]
+##
+## The known suffix of the stack is as follows:
+## A list(atom) ZERO
+##
+
+003
+an assumption
+the newline character
+
+input: INT P
+##
+## Ends in an error in state: 23.
+##
+## nonempty_list(atom) -> atom . [ ZERO ]
+## nonempty_list(atom) -> atom . nonempty_list(atom) [ ZERO ]
+##
+## The known suffix of the stack is as follows:
+## atom
+##
+
+004
+a clause
+either another atom (i.e. non-zero integer), or the integer
+zero to close the clause
+
+input: INT ZERO ZERO
+##
+## Ends in an error in state: 41.
+##
+## clause -> nonempty_list(atom) ZERO . NEWLINE [ # ]
+##
+## The known suffix of the stack is as follows:
+## nonempty_list(atom) ZERO
+##
+
+005
+a clause
+a newline character
+
+input: NEWLINE ZERO
+##
+## Ends in an error in state: 33.
+##
+## input -> NEWLINE . input [ # ]
+##
+## The known suffix of the stack is as follows:
+## NEWLINE
+##
+
+006
+an input sentence
+either a non-zero integer to start a clause, the keyword
+'a' to start an assumption, or the keyword 'p' to start
+a header
+
+input: P INCCNF ZERO
+##
+## Ends in an error in state: 31.
+##
+## start -> P INCCNF . NEWLINE [ # ]
+##
+## The known suffix of the stack is as follows:
+## P INCCNF
+##
+
+007
+an p-inccnf header
+a newline character to end the p-inccnf header
+
+input: P ZERO
+##
+## Ends in an error in state: 30.
+##
+## start -> P . INCCNF NEWLINE [ # ]
+##
+## The known suffix of the stack is as follows:
+## P
+##
+
+008
+a p-inccnf header
+the 'inccnf' header'
+
+input: ZERO
+##
+## Ends in an error in state: 29.
+##
+## input' -> . input [ # ]
+##
+## The known suffix of the stack is as follows:
+##
+##
+
+006
+an input sentence
+either a non-zero integer to start a clause, the keyword
+'a' to start an assumption, or the keyword 'p' to start
+a header
+
+file: NEWLINE ZERO
+##
+## Ends in an error in state: 1.
+##
+## list(NEWLINE) -> NEWLINE . list(NEWLINE) [ P ]
+##
+## The known suffix of the stack is as follows:
+## NEWLINE
+##
+
+006
+an input sentence
+either a non-zero integer to start a clause, the keyword
+'a' to start an assumption, or the keyword 'p' to start
+a header
+
+file: P INCCNF NEWLINE A P
+##
+## Ends in an error in state: 11.
+##
+## assumption -> A . list(atom) ZERO NEWLINE [ NEWLINE INT EOF A ]
+##
+## The known suffix of the stack is as follows:
+## A
+##
+
+002
+an assumption
+an atom, i.e. a non-zero integer
+
+file: P INCCNF NEWLINE A ZERO NEWLINE ZERO
+##
+## Ends in an error in state: 25.
+##
+## problem -> assumption . problem [ # ]
+##
+## The known suffix of the stack is as follows:
+## assumption
+##
+
+006
+an input sentence
+either a non-zero integer to start a clause, the keyword
+'a' to start an assumption, or the keyword 'p' to start
+a header
+
+file: P INCCNF NEWLINE A ZERO ZERO
+##
+## Ends in an error in state: 13.
+##
+## assumption -> A list(atom) ZERO . NEWLINE [ NEWLINE INT EOF A ]
+##
+## The known suffix of the stack is as follows:
+## A list(atom) ZERO
+##
+
+003
+an assumption
+the newline character
+
+file: P INCCNF NEWLINE INT ZERO NEWLINE ZERO
+##
+## Ends in an error in state: 21.
+##
+## problem -> clause . problem [ # ]
+##
+## The known suffix of the stack is as follows:
+## clause
+##
+
+006
+an input sentence
+either a non-zero integer to start a clause, the keyword
+'a' to start an assumption, or the keyword 'p' to start
+a header
+
+file: P INCCNF NEWLINE INT ZERO ZERO
+##
+## Ends in an error in state: 19.
+##
+## clause -> nonempty_list(atom) ZERO . NEWLINE [ NEWLINE INT EOF A ]
+##
+## The known suffix of the stack is as follows:
+## nonempty_list(atom) ZERO
+##
+
+005
+a clause
+a newline character
+
+file: P INCCNF NEWLINE NEWLINE ZERO
+##
+## Ends in an error in state: 8.
+##
+## problem -> NEWLINE . problem [ # ]
+##
+## The known suffix of the stack is as follows:
+## NEWLINE
+##
+
+006
+an input sentence
+either a non-zero integer to start a clause, the keyword
+'a' to start an assumption, or the keyword 'p' to start
+a header
+
+file: P INCCNF NEWLINE ZERO
+##
+## Ends in an error in state: 7.
+##
+## file -> list(NEWLINE) start . problem [ # ]
+##
+## The known suffix of the stack is as follows:
+## list(NEWLINE) start
+##
+
+006
+an input sentence
+either a non-zero integer to start a clause, the keyword
+'a' to start an assumption, or the keyword 'p' to start
+a header
+
+file: P INCCNF ZERO
+##
+## Ends in an error in state: 5.
+##
+## start -> P INCCNF . NEWLINE [ NEWLINE INT EOF A ]
+##
+## The known suffix of the stack is as follows:
+## P INCCNF
+##
+
+007
+an p-inccnf header
+a newline character to end the p-inccnf header
+
+file: P ZERO
+##
+## Ends in an error in state: 4.
+##
+## start -> P . INCCNF NEWLINE [ NEWLINE INT EOF A ]
+##
+## The known suffix of the stack is as follows:
+## P
+##
+
+008
+a p-inccnf header
+the 'inccnf' header'
+
+file: ZERO
+##
+## Ends in an error in state: 0.
+##
+## file' -> . file [ # ]
+##
+## The known suffix of the stack is as follows:
+##
+##
+
+006
+an input sentence
+either a non-zero integer to start a clause, the keyword
+'a' to start an assumption, or the keyword 'p' to start
+a header
+
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/line/dolmen_line.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/line/dolmen_line.ml
index bcb7a432d6888777b2e4599176623899e6d5b515..6bc39c98d5009ac8790bbdd6f3eb3830fceb30a7 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/line/dolmen_line.ml
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/line/dolmen_line.ml
@@ -3,6 +3,7 @@
 
 let rec consume lexbuf =
   match LexLine.token lexbuf with
+  | LexLine.EOF -> ()
   | LexLine.CHAR '\n' -> Lexing.new_line lexbuf
   | _ -> consume lexbuf
 
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/smtlib2/v2.6/ast_smtlib.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/smtlib2/v2.6/ast_smtlib.ml
index efd5fde39a1a537995f958861fe961c47e9bb39d..2c0db3d3b2a7ab7516e4d0445de7fa4b60df2c48 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/smtlib2/v2.6/ast_smtlib.ml
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/smtlib2/v2.6/ast_smtlib.ml
@@ -46,6 +46,10 @@ module type Term = sig
   (** Constants, i.e non predefined symbols. This includes both constants
       defined by theories, defined locally in a problem, and also quantified variables. *)
 
+  val str     : ?loc:location -> string -> t
+  (** Quoted strings. According to the smtlib manual, these can be interpreted as
+      either string literals (when the String theory is used), or simply constants *)
+
   val int     : ?loc:location -> string -> t
   val real    : ?loc:location -> string -> t
   val hexa    : ?loc:location -> string -> t
@@ -69,6 +73,9 @@ module type Term = sig
   val exists  : ?loc:location -> t list -> t -> t
   (** Existencial quantification. *)
 
+  val pi     : ?loc:location -> t list -> t -> t
+  (** Type quantification. *)
+
   val match_ : ?loc:location -> t -> (t * t) list -> t
   (** Pattern matching. The first term is the term to match,
       and each tuple in the list is a match case, which is a pair
@@ -82,6 +89,18 @@ module type Term = sig
       in the smtlib manual, "Term attributes have no logical meaning --
       semantically, [attr t l] is equivalent to [t]" *)
 
+  val tType     : ?loc:location -> unit -> t
+  (** The type of types, defined as specific token by the Zipperposition format;
+      in other languages, will be represented as a constant (the "$tType" constant
+      in tptp for instance). Used to define new types, or quantify type variables
+      in languages that support polymorphism. *)
+
+  val trigger : ?loc:location -> t list -> t
+  (** Create a (multi) trigger. *)
+
+  val triggers : ?loc:location -> t -> t list -> t
+  (** Annotate a term (generally a quantified formula), with a list of triggers. *)
+
 end
 (** Implementation requirements for Smtlib terms. *)
 
@@ -140,17 +159,17 @@ module type Statement = sig
   val datatypes : ?loc:location -> (id * term list * (id * term list) list) list -> t
   (** Inductive type definitions. *)
 
-  val fun_decl  : ?loc:location -> id -> term list -> term -> t
-  (** Declares a new term symbol, and its type. [fun_decl f args ret]
+  val fun_decl  : ?loc:location -> id -> term list -> term list -> term -> t
+  (** Declares a new term symbol, and its type. [fun_decl f ty_args args ret]
       declares [f] as a new function symbol which takes arguments of types
       described in [args], and with return type [ret]. *)
 
-  val fun_def   : ?loc:location -> id -> term list -> term -> term -> t
-  (** Defines a new function. [fun_def f args ret body] is such that
+  val fun_def   : ?loc:location -> id -> term list -> term list -> term -> term -> t
+  (** Defines a new function. [fun_def f ty_args args ret body] is such that
       applications of [f] are equal to [body] (module substitution of the arguments),
       which should be of type [ret]. *)
 
-  val funs_def_rec : ?loc:location -> (id * term list * term * term) list -> t
+  val funs_def_rec : ?loc:location -> (id * term list * term list * term * term) list -> t
   (** Declare a list of mutually recursive functions. *)
 
 
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/smtlib2/v2.6/dune b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/smtlib2/v2.6/dune
index 4099fa66b01169d9dd37b32b60c9c41395a7bf1f..cda13e0b43ffb2d852f9e3ca0598d95b40b0afe8 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/smtlib2/v2.6/dune
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/smtlib2/v2.6/dune
@@ -26,7 +26,7 @@
 (library
   (name           dolmen_smtlib2_v6)
   (public_name    dolmen.smtlib2.v6)
-  (libraries      dolmen_std menhirLib)
+  (libraries      dolmen_std dolmen_intf menhirLib)
   (modules        Tokens_smtlib LexSmtlib ParseSmtlib Ast_smtlib Syntax_messages Dolmen_smtlib2_v6)
 )
 
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/smtlib2/v2.6/lexSmtlib.mll b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/smtlib2/v2.6/lexSmtlib.mll
index 338f3f27adde02b605c6cacff7ea99a809bfa0e8..a4b39e6691cefecc7eece3c804d3e58d7108dded 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/smtlib2/v2.6/lexSmtlib.mll
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/smtlib2/v2.6/lexSmtlib.mll
@@ -4,12 +4,74 @@
 (** {1 Smtlib Lexer} *)
 
 {
-  open Tokens_smtlib
-
   exception Error
 
+  module T = Dolmen_std.Tok
   module M = Map.Make(String)
 
+  open Tokens_smtlib
+
+  (* Token printing *)
+
+  let keyword_descr s =
+    T.descr s ~kind:"keyword"
+
+  let reserved_descr s =
+    T.descr s ~kind:"reserved word"
+
+  let descr token : T.descr =
+    match (token : token) with
+    | EOF -> T.descr ~kind:"end of file token" ""
+    | OPEN -> T.descr ~article:"an" ~kind:"opening partenthesis" ""
+    | CLOSE -> T.descr ~article:"a" ~kind:"closing parenthesise" ""
+    | NUM s -> T.descr ~kind:"integer" s
+    | DEC s -> T.descr ~kind:"decimal" s
+    | HEX s -> T.descr ~kind:"hexadecimal" s
+    | BIN s -> T.descr ~kind:"binary" s
+    | STR s -> T.descr ~kind:"string" s
+    | SYMBOL s -> T.descr ~kind:"symbol" s
+    | KEYWORD s -> keyword_descr s
+    | UNDERSCORE -> reserved_descr "_"
+    | ATTRIBUTE -> reserved_descr "!"
+    | AS -> reserved_descr "as"
+    | LET -> reserved_descr "let"
+    | EXISTS -> reserved_descr "exists"
+    | FORALL -> reserved_descr "forall"
+    | MATCH -> reserved_descr "match"
+    | PAR -> reserved_descr "par"
+    | ASSERT -> reserved_descr "assert"
+    | CHECK_SAT -> reserved_descr "check-sat"
+    | CHECK_SAT_ASSUMING -> reserved_descr "check-sat-assuming"
+    | DECLARE_CONST -> reserved_descr "declare-const"
+    | DECLARE_DATATYPE -> reserved_descr "declare-datatype"
+    | DECLARE_DATATYPES -> reserved_descr "declare-datatypes"
+    | DECLARE_FUN -> reserved_descr "declare-fun"
+    | DECLARE_SORT -> reserved_descr "declare-sort"
+    | DEFINE_FUN -> reserved_descr "define-fun"
+    | DEFINE_FUN_REC -> reserved_descr "define-fun-rec"
+    | DEFINE_FUNS_REC -> reserved_descr "define-funs-rec"
+    | DEFINE_SORT -> reserved_descr "define-sort"
+    | ECHO -> reserved_descr "echo"
+    | EXIT -> reserved_descr "exit"
+    | GET_ASSERTIONS -> reserved_descr "get-assertions"
+    | GET_ASSIGNMENT -> reserved_descr "gert-assignment"
+    | GET_INFO -> reserved_descr "get-info"
+    | GET_MODEL -> reserved_descr "get-model"
+    | GET_OPTION -> reserved_descr "get-option"
+    | GET_PROOF -> reserved_descr "get-proof"
+    | GET_UNSAT_ASSUMPTIONS -> reserved_descr "get-unsat-assumptions"
+    | GET_UNSAT_CORE -> reserved_descr "get-unsat-core"
+    | GET_VALUE -> reserved_descr "get-value"
+    | POP -> reserved_descr "pop"
+    | PUSH -> reserved_descr "push"
+    | RESET -> reserved_descr "reset"
+    | RESET_ASSERTIONS -> reserved_descr "reset-assertions"
+    | SET_INFO -> reserved_descr "set-info"
+    | SET_LOGIC -> reserved_descr "set-logic"
+    | SET_OPTION -> reserved_descr "set-option"
+
+  (* Token parsing *)
+
   let bind map (x, v) = M.add x v map
 
   let reserved_words =
@@ -43,7 +105,7 @@
     "declare-sort", DECLARE_SORT;
     "define-fun", DEFINE_FUN;
     "define-fun-rec", DEFINE_FUN_REC;
-    "define-funs-res", DEFINE_FUNS_REC;
+    "define-funs-rec", DEFINE_FUNS_REC;
     "define-sort", DEFINE_SORT;
     "echo", ECHO;
     "exit", EXIT;
@@ -65,9 +127,9 @@
     "set-option", SET_OPTION;
   ]
 
-  let symbol lexbuf s =
+  let symbol newline lexbuf s =
     (* register the newlines in quoted symbols to maintain correct locations.*)
-    String.iter (function '\n' -> Lexing.new_line lexbuf | _ -> ()) s;
+    String.iter (function '\n' -> newline lexbuf | _ -> ()) s;
     (* Check whetehr the symbol is a reserved word. *)
     try M.find s reserved_words
     with Not_found -> SYMBOL s
@@ -95,20 +157,20 @@ let ss_char = ss_first_char | digit
 let simple_symbol = ss_first_char ss_char*
 
 let quoted_symbol_char = (white_space_or_printable # ['|' '\\'])
-let quoted_symbol = ['|'] quoted_symbol_char+ ['|']
+let quoted_symbol = ['|'] quoted_symbol_char* ['|']
 
 let symbol = simple_symbol | quoted_symbol
 
 let keyword = ':' simple_symbol
 
-let comment = ';' (printable_char # ['\r' '\n'])*
+let comment = ';' (white_space_or_printable # ['\r' '\n'])*
 
-rule token = parse
+rule token newline = parse
   (* Whitespace, newlines and comments *)
   | eof                 { EOF }
-  | [' ' '\t' '\r']+    { token lexbuf }
-  | '\n'                { Lexing.new_line lexbuf; token lexbuf }
-  | comment             { token lexbuf }
+  | [' ' '\t' '\r']+    { token newline lexbuf }
+  | '\n'                { newline lexbuf; token newline lexbuf }
+  | comment             { token newline lexbuf }
 
   (* SMTLIB tokens *)
   | '('                 { OPEN }
@@ -117,14 +179,14 @@ rule token = parse
   | decimal as s        { DEC s }
   | hexadecimal as s    { HEX s }
   | binary as s         { BIN s }
-  | '"'                 { string (Buffer.create 42) lexbuf }
+  | '"'                 { string newline (Buffer.create 42) lexbuf }
   | keyword as s        { KEYWORD s }
-  | symbol as s         { symbol lexbuf s }
+  | symbol as s         { symbol newline lexbuf s }
 
-and string b = parse
-  | '"' '"'             { Buffer.add_char b '"'; string b lexbuf }
+and string newline b = parse
+  | '"' '"'             { Buffer.add_char b '"'; string newline b lexbuf }
   | '"'                 { STR (Buffer.contents b) }
   | (printable_char | white_space_char) as c
-    { if c = '\n' then Lexing.new_line lexbuf;
-      Buffer.add_char b c; string b lexbuf }
+    { if c = '\n' then newline lexbuf;
+      Buffer.add_char b c; string newline b lexbuf }
 
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/smtlib2/v2.6/parseSmtlib.mly b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/smtlib2/v2.6/parseSmtlib.mly
index 626a4fc350a92ff04eaf191975028bbb338193e0..f1fee81a44f142d3b026545b0cbe2b7dcbd630e3 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/smtlib2/v2.6/parseSmtlib.mly
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/smtlib2/v2.6/parseSmtlib.mly
@@ -14,20 +14,20 @@
 
 spec_constant:
   | s=NUM
-    { fun _ -> let loc = L.mk_pos $startpos $endpos in T.int ~loc s }
+    { let loc = L.mk_pos $startpos $endpos in T.int ~loc s }
   | s=DEC
-    { fun _ -> let loc = L.mk_pos $startpos $endpos in T.real ~loc s }
+    { let loc = L.mk_pos $startpos $endpos in T.real ~loc s }
   | s=HEX
-    { fun _ -> let loc = L.mk_pos $startpos $endpos in T.hexa ~loc s }
+    { let loc = L.mk_pos $startpos $endpos in T.hexa ~loc s }
   | s=BIN
-    { fun _ -> let loc = L.mk_pos $startpos $endpos in T.binary ~loc s }
+    { let loc = L.mk_pos $startpos $endpos in T.binary ~loc s }
   | s=STR
-    { fun ns -> let loc = L.mk_pos $startpos $endpos in T.const ~loc I.(mk ns s) }
+    { let loc = L.mk_pos $startpos $endpos in T.str ~loc s }
 ;
 
 s_expr:
   | c=spec_constant
-    { c I.attr }
+    { c }
   | s=SYMBOL
     { let loc = L.mk_pos $startpos $endpos in T.const ~loc I.(mk term s) }
   | s=KEYWORD
@@ -40,6 +40,9 @@ index:
   | s=NUM
   | s=SYMBOL
     { s }
+  /* Small language extension to support string char literals */
+  | s=HEX
+    { s }
 ;
 
 identifier:
@@ -62,7 +65,7 @@ sort:
 
 attribute_value:
   | v=spec_constant
-    { v I.attr }
+    { v }
   | v=SYMBOL
     { let loc = L.mk_pos $startpos $endpos in T.const ~loc I.(mk attr v) }
   | OPEN l=s_expr* CLOSE
@@ -80,23 +83,22 @@ attribute:
       | None -> t
       | Some t' ->
         let loc = L.mk_pos $startpos $endpos in
-        T.colon ~loc t t'
+        T.apply ~loc t [t']
     }
 ;
 
-term_identifier:
-  | s=identifier
-    { let loc = L.mk_pos $startpos $endpos in T.const ~loc I.(mk term s) }
-
+/*
+The [(as id ty)] doesn't specify the type of the function [id]
+but only its result type
+*/
 qual_identifier:
-  | s=term_identifier
-    { s }
-  | OPEN AS c=term_identifier ty=sort CLOSE
-    { let loc = L.mk_pos $startpos $endpos in T.colon ~loc c ty }
+  | s=identifier
+    { let loc = L.mk_pos $startpos $endpos in `NoAs (T.const ~loc I.(mk term s)) }
+  | OPEN AS s=identifier ty=sort CLOSE
+    { let loc = L.mk_pos $startpos $endpos in
+      `As (T.const ~loc I.(mk term s),ty) }
 ;
 
-
-
 var_binding:
   | OPEN s=SYMBOL t=term CLOSE
     { let c =
@@ -117,7 +119,7 @@ sorted_var:
 
 /* Additional rule for pattern symbols, useful for:
    1- locations in symbol lists in patterns,
-   2-menhir '+' syntax does'nt support raw tokens afaik */
+   2- menhir '+' syntax doesn't support raw tokens afaik */
 pattern_symbol:
   | s=SYMBOL
     { let loc = L.mk_pos $startpos $endpos in T.const ~loc I.(mk term s) }
@@ -137,11 +139,17 @@ match_case:
 
 term:
   | c=spec_constant
-    { c I.term }
-  | s=term_identifier
-    { let loc = L.mk_pos $startpos $endpos in T.apply ~loc s [] }
-  | OPEN f=qual_identifier args=term+ CLOSE
-    { let loc = L.mk_pos $startpos $endpos in T.apply ~loc f args }
+    { c }
+  | s=qual_identifier
+    { let loc = L.mk_pos $startpos $endpos in
+      match s with
+      | `NoAs f -> f
+      | `As (f,ty) -> T.colon ~loc f ty }
+  | OPEN s=qual_identifier args=term+ CLOSE
+    { let loc = L.mk_pos $startpos $endpos in
+      match s with
+      | `NoAs f -> T.apply ~loc f args
+      | `As (f,ty) -> T.colon (T.apply ~loc f args) ty }
   | OPEN LET OPEN l=var_binding+ CLOSE t=term CLOSE
     { let loc = L.mk_pos $startpos $endpos in T.letin ~loc l t }
   | OPEN FORALL OPEN l=sorted_var+ CLOSE t=term CLOSE
@@ -152,8 +160,6 @@ term:
     { let loc = L.mk_pos $startpos $endpos in T.match_ ~loc t l }
   | OPEN ATTRIBUTE f=term args=attribute+ CLOSE
     { let loc = L.mk_pos $startpos $endpos in T.annot ~loc f args }
-  | OPEN AS t=term sort=sort CLOSE
-    { let loc = L.mk_pos $startpos $endpos in T.colon ~loc t sort }
 ;
 
 info_flag:
@@ -216,7 +222,7 @@ selector_dec:
   | OPEN s=SYMBOL ty=sort CLOSE
     { let f =
       let loc = L.mk_pos $startpos $endpos in
-      T.const ~loc (I.mk I.sort s)
+      T.const ~loc (I.mk I.term s)
     in
     let loc = L.mk_pos $startpos $endpos in
     T.colon ~loc f ty }
@@ -242,11 +248,16 @@ datatype_dec:
 
 function_dec:
   | OPEN s=SYMBOL OPEN args=sorted_var* CLOSE ret=sort CLOSE
-    { I.(mk term s), args, ret }
+    { I.(mk term s), [], args, ret }
+  | OPEN s=SYMBOL PAR OPEN vars=datatype_symbol+ CLOSE OPEN args=sorted_var* CLOSE ret=sort CLOSE CLOSE
+    { I.(mk term s), vars, args, ret }
 
 function_def:
   | s=SYMBOL OPEN args=sorted_var* CLOSE ret=sort body=term
-    { I.(mk term s), args, ret, body }
+    { I.(mk term s), [], args, ret, body }
+  | s=SYMBOL OPEN PAR OPEN vars=datatype_symbol+ CLOSE OPEN args=sorted_var* CLOSE ret=sort body=term CLOSE
+    { I.(mk term s), vars, args, ret, body }
+
 
 /* Additional rule for prop_literals symbols, to have lighter
    semantic actions in prop_literal reductions. */
@@ -274,12 +285,16 @@ prop_literal:
 command:
   | OPEN ASSERT t=term CLOSE
     { let loc = L.mk_pos $startpos $endpos in S.assert_ ~loc t }
+  | OPEN ASSERT OPEN PAR OPEN vars=datatype_symbol+ CLOSE t=term CLOSE CLOSE
+    { let loc = L.mk_pos $startpos $endpos in
+      let vars = List.map (fun v -> T.colon v (T.tType ~loc ())) vars in
+      S.assert_ ~loc (T.forall ~loc vars t) }
   | OPEN CHECK_SAT CLOSE
     { let loc = L.mk_pos $startpos $endpos in S.check_sat ~loc [] }
   | OPEN CHECK_SAT_ASSUMING OPEN l=prop_literal* CLOSE CLOSE
     { let loc = L.mk_pos $startpos $endpos in S.check_sat ~loc l }
   | OPEN DECLARE_CONST s=SYMBOL ty=sort CLOSE
-    { let loc = L.mk_pos $startpos $endpos in S.fun_decl ~loc I.(mk term s) [] ty }
+    { let loc = L.mk_pos $startpos $endpos in S.fun_decl ~loc I.(mk term s) [] [] ty }
   | OPEN DECLARE_DATATYPE s=SYMBOL d=datatype_dec CLOSE
     { let vars, constructors = d in
       let loc = L.mk_pos $startpos $endpos in
@@ -296,24 +311,28 @@ command:
   | OPEN DECLARE_FUN s=SYMBOL OPEN args=sort* CLOSE ty=sort CLOSE
     { let id = I.(mk term s) in
       let loc = L.mk_pos $startpos $endpos in
-      S.fun_decl ~loc id args ty }
+      S.fun_decl ~loc id [] args ty }
+  | OPEN DECLARE_FUN s=SYMBOL OPEN PAR OPEN vars=datatype_symbol+ CLOSE OPEN args=sort* CLOSE ty=sort CLOSE CLOSE
+    { let id = I.(mk term s) in
+      let loc = L.mk_pos $startpos $endpos in
+      S.fun_decl ~loc id vars args ty }
   | OPEN DECLARE_SORT s=SYMBOL n=NUM CLOSE
     { let id = I.(mk sort s) in
       let loc = L.mk_pos $startpos $endpos in
       S.type_decl ~loc id (int_of_string n) }
   | OPEN DEFINE_FUN f=function_def CLOSE
-    { let id, args, ret, body = f in
+    { let id, vars, args, ret, body = f in
       let loc = L.mk_pos $startpos $endpos in
-      S.fun_def ~loc id args ret body }
+      S.fun_def ~loc id vars args ret body }
   | OPEN DEFINE_FUN_REC f=function_def CLOSE
-    { let id, args, ret, body = f in
+    { let id, vars, args, ret, body = f in
       let loc = L.mk_pos $startpos $endpos in
-      S.funs_def_rec ~loc [id, args, ret, body] }
+      S.funs_def_rec ~loc [id, vars, args, ret, body] }
   /* The syntax technically defines this reduction as having l and l' be the same length,
       but that isn't easily expressible in menhir, so the check is delayed */
   | OPEN DEFINE_FUNS_REC OPEN l1=function_dec+ CLOSE OPEN l2=term+ CLOSE OPEN
     { let res =
-        try List.map2 (fun (id, args, ret) body -> id, args, ret, body) l1 l2
+        try List.map2 (fun (id, vars, args, ret) body -> id, vars, args, ret, body) l1 l2
         with Invalid_argument _ -> assert false
       in
       let loc = L.mk_pos $startpos $endpos in
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/smtlib2/v2.6/syntax.messages b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/smtlib2/v2.6/syntax.messages
index d3357158952e2312e934aba82f9c60574277692b..a8dcd49e7756f7f1e21cad97606ba0be9829512f 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/smtlib2/v2.6/syntax.messages
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/smtlib2/v2.6/syntax.messages
@@ -1,6 +1,45 @@
+#
+# Syntax Error Messages for smtlib v2.6
+#
+# Each error message *must* follow the following format:
+#
+# """
+# XXX
+# production parsed (on a single line)
+# what is expected at that point,
+# possibly on multiple lines
+# """
+#
+# The error numbers can be pretty much arbitrary, but for each
+# error number XXX, a corresponding test case file must exists as
+# tests/parsing/smtlib/v2.6/errors/XXX_some_descr_of_the_error_Y.smt2
+# (Y is there to allow multiple example of the error test case to exist,
+# for instance with various different error tokens)
+#
+# Notes:
+# - some error messages are shared among more than one error case,
+#   in such cases, the error number is the same, so when modifying
+#   an error message, be sure to modify all occurrences of the same
+#   error number
+
+term: OPEN AS OPEN SYMBOL
+##
+## Ends in an error in state: 58.
+##
+## identifier -> OPEN . UNDERSCORE SYMBOL nonempty_list(index) CLOSE [ SYMBOL OPEN ]
+##
+## The known suffix of the stack is as follows:
+## OPEN
+##
+
+001
+an identifier
+an underscore: identifiers starting with an opening parenthesis must be
+indexed identifiers, of the form "(_ symbol index+)"
+
 term: OPEN AS SYMBOL SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 434.
+## Ends in an error in state: 435.
 ##
 ## qual_identifier -> OPEN AS identifier sort . CLOSE [ # ]
 ##
@@ -8,11 +47,13 @@ term: OPEN AS SYMBOL SYMBOL UNDERSCORE
 ## OPEN AS identifier sort
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+002
+a qualified identifier
+a closing parenthesis
 
 term: OPEN AS SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 433.
+## Ends in an error in state: 434.
 ##
 ## qual_identifier -> OPEN AS identifier . sort CLOSE [ # ]
 ##
@@ -20,11 +61,15 @@ term: OPEN AS SYMBOL UNDERSCORE
 ## OPEN AS identifier
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+003
+a qualified identifier
+a sort, i.e. either an identifier, or a sort constructor application;
+note that keywords and reserved words (such as '_', 'as', ...) are not
+identifiers, and thus are not allowed here
 
 term: OPEN AS UNDERSCORE
 ##
-## Ends in an error in state: 432.
+## Ends in an error in state: 433.
 ##
 ## qual_identifier -> OPEN AS . identifier sort CLOSE [ # ]
 ##
@@ -32,11 +77,15 @@ term: OPEN AS UNDERSCORE
 ## OPEN AS
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+004
+a qualified identifier
+an identifier;
+note that keywords and reserved words (such as '_', 'as', ...) are not
+identifiers, and thus are not allowed here
 
 term: OPEN ATTRIBUTE SYMBOL KEYWORD BIN UNDERSCORE
 ##
-## Ends in an error in state: 125.
+## Ends in an error in state: 126.
 ##
 ## nonempty_list(attribute) -> attribute . [ CLOSE ]
 ## nonempty_list(attribute) -> attribute . nonempty_list(attribute) [ CLOSE ]
@@ -45,11 +94,14 @@ term: OPEN ATTRIBUTE SYMBOL KEYWORD BIN UNDERSCORE
 ## attribute
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+005
+an attribute list
+either a closing parenthesis, or another attribute of the form
+"keyword value"
 
 term: OPEN ATTRIBUTE SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 429.
+## Ends in an error in state: 430.
 ##
 ## term -> OPEN ATTRIBUTE term . nonempty_list(attribute) CLOSE [ # ]
 ##
@@ -57,11 +109,13 @@ term: OPEN ATTRIBUTE SYMBOL UNDERSCORE
 ## OPEN ATTRIBUTE term
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+006
+a term
+an attribute of the form "keyword value"
 
 term: OPEN ATTRIBUTE UNDERSCORE
 ##
-## Ends in an error in state: 428.
+## Ends in an error in state: 429.
 ##
 ## term -> OPEN ATTRIBUTE . term nonempty_list(attribute) CLOSE [ # ]
 ##
@@ -69,11 +123,13 @@ term: OPEN ATTRIBUTE UNDERSCORE
 ## OPEN ATTRIBUTE
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+007
+a term with attribute
+a term
 
 term: OPEN EXISTS OPEN OPEN SYMBOL SYMBOL CLOSE CLOSE SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 426.
+## Ends in an error in state: 427.
 ##
 ## term -> OPEN EXISTS OPEN nonempty_list(sorted_var) CLOSE term . CLOSE [ # ]
 ##
@@ -81,11 +137,13 @@ term: OPEN EXISTS OPEN OPEN SYMBOL SYMBOL CLOSE CLOSE SYMBOL UNDERSCORE
 ## OPEN EXISTS OPEN nonempty_list(sorted_var) CLOSE term
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+008
+a term
+a closing parenthesis to end the existencially quantified formula
 
 term: OPEN EXISTS OPEN OPEN SYMBOL SYMBOL CLOSE CLOSE UNDERSCORE
 ##
-## Ends in an error in state: 425.
+## Ends in an error in state: 426.
 ##
 ## term -> OPEN EXISTS OPEN nonempty_list(sorted_var) CLOSE . term CLOSE [ # ]
 ##
@@ -93,11 +151,13 @@ term: OPEN EXISTS OPEN OPEN SYMBOL SYMBOL CLOSE CLOSE UNDERSCORE
 ## OPEN EXISTS OPEN nonempty_list(sorted_var) CLOSE
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+009
+a term
+a term (body for the existencial quantification)
 
 term: OPEN EXISTS OPEN UNDERSCORE
 ##
-## Ends in an error in state: 423.
+## Ends in an error in state: 424.
 ##
 ## term -> OPEN EXISTS OPEN . nonempty_list(sorted_var) CLOSE term CLOSE [ # ]
 ##
@@ -105,11 +165,13 @@ term: OPEN EXISTS OPEN UNDERSCORE
 ## OPEN EXISTS OPEN
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+010
+a term
+a sorted variable of the form "(var sort)"
 
 term: OPEN EXISTS UNDERSCORE
 ##
-## Ends in an error in state: 422.
+## Ends in an error in state: 423.
 ##
 ## term -> OPEN EXISTS . OPEN nonempty_list(sorted_var) CLOSE term CLOSE [ # ]
 ##
@@ -117,11 +179,13 @@ term: OPEN EXISTS UNDERSCORE
 ## OPEN EXISTS
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+011
+a term
+a list of sorted variables, starting with an opening parenthesis
 
 term: OPEN FORALL OPEN OPEN SYMBOL SYMBOL CLOSE CLOSE SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 420.
+## Ends in an error in state: 421.
 ##
 ## term -> OPEN FORALL OPEN nonempty_list(sorted_var) CLOSE term . CLOSE [ # ]
 ##
@@ -129,11 +193,13 @@ term: OPEN FORALL OPEN OPEN SYMBOL SYMBOL CLOSE CLOSE SYMBOL UNDERSCORE
 ## OPEN FORALL OPEN nonempty_list(sorted_var) CLOSE term
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+012
+a term
+a closing parenthesis to end the universally quantified formula
 
 term: OPEN FORALL OPEN OPEN SYMBOL SYMBOL CLOSE CLOSE UNDERSCORE
 ##
-## Ends in an error in state: 419.
+## Ends in an error in state: 420.
 ##
 ## term -> OPEN FORALL OPEN nonempty_list(sorted_var) CLOSE . term CLOSE [ # ]
 ##
@@ -141,11 +207,13 @@ term: OPEN FORALL OPEN OPEN SYMBOL SYMBOL CLOSE CLOSE UNDERSCORE
 ## OPEN FORALL OPEN nonempty_list(sorted_var) CLOSE
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+013
+a term
+a term (body for the universal quantification)
 
 term: OPEN FORALL OPEN OPEN SYMBOL SYMBOL CLOSE UNDERSCORE
 ##
-## Ends in an error in state: 109.
+## Ends in an error in state: 110.
 ##
 ## nonempty_list(sorted_var) -> sorted_var . [ CLOSE ]
 ## nonempty_list(sorted_var) -> sorted_var . nonempty_list(sorted_var) [ CLOSE ]
@@ -154,11 +222,13 @@ term: OPEN FORALL OPEN OPEN SYMBOL SYMBOL CLOSE UNDERSCORE
 ## sorted_var
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+014
+a list of sorted variables
+either a closing parentheis, or a sorted var of the form "(var sort)"
 
 term: OPEN FORALL OPEN OPEN SYMBOL SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 107.
+## Ends in an error in state: 108.
 ##
 ## sorted_var -> OPEN SYMBOL sort . CLOSE [ OPEN CLOSE ]
 ##
@@ -166,11 +236,13 @@ term: OPEN FORALL OPEN OPEN SYMBOL SYMBOL UNDERSCORE
 ## OPEN SYMBOL sort
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+015
+a sorted variable
+a closing parenthesis
 
 term: OPEN FORALL OPEN OPEN SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 106.
+## Ends in an error in state: 107.
 ##
 ## sorted_var -> OPEN SYMBOL . sort CLOSE [ OPEN CLOSE ]
 ##
@@ -178,11 +250,15 @@ term: OPEN FORALL OPEN OPEN SYMBOL UNDERSCORE
 ## OPEN SYMBOL
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+016
+a sorted variable
+a sort, i.e. either an identifier, or a sort constructor application;
+note that keywords and reserved words (such as '_', 'as', ...) are not
+identifiers, and thus are not allowed here
 
 term: OPEN FORALL OPEN OPEN UNDERSCORE
 ##
-## Ends in an error in state: 105.
+## Ends in an error in state: 106.
 ##
 ## sorted_var -> OPEN . SYMBOL sort CLOSE [ OPEN CLOSE ]
 ##
@@ -190,11 +266,13 @@ term: OPEN FORALL OPEN OPEN UNDERSCORE
 ## OPEN
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+017
+a sorted variable
+a symbol, i.e. a variable name
 
 term: OPEN FORALL OPEN UNDERSCORE
 ##
-## Ends in an error in state: 417.
+## Ends in an error in state: 418.
 ##
 ## term -> OPEN FORALL OPEN . nonempty_list(sorted_var) CLOSE term CLOSE [ # ]
 ##
@@ -202,11 +280,13 @@ term: OPEN FORALL OPEN UNDERSCORE
 ## OPEN FORALL OPEN
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+018
+a term
+a sorted variable of the form "(var sort)"
 
 term: OPEN FORALL UNDERSCORE
 ##
-## Ends in an error in state: 416.
+## Ends in an error in state: 417.
 ##
 ## term -> OPEN FORALL . OPEN nonempty_list(sorted_var) CLOSE term CLOSE [ # ]
 ##
@@ -214,11 +294,13 @@ term: OPEN FORALL UNDERSCORE
 ## OPEN FORALL
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+019
+a term
+a list of sorted variables, starting with an opening parenthesis
 
 term: OPEN LET OPEN OPEN SYMBOL BIN CLOSE CLOSE SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 414.
+## Ends in an error in state: 415.
 ##
 ## term -> OPEN LET OPEN nonempty_list(var_binding) CLOSE term . CLOSE [ # ]
 ##
@@ -226,11 +308,13 @@ term: OPEN LET OPEN OPEN SYMBOL BIN CLOSE CLOSE SYMBOL UNDERSCORE
 ## OPEN LET OPEN nonempty_list(var_binding) CLOSE term
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+020
+a term
+a closing parenthesis to end the let binding
 
 term: OPEN LET OPEN OPEN SYMBOL BIN CLOSE CLOSE UNDERSCORE
 ##
-## Ends in an error in state: 413.
+## Ends in an error in state: 414.
 ##
 ## term -> OPEN LET OPEN nonempty_list(var_binding) CLOSE . term CLOSE [ # ]
 ##
@@ -238,11 +322,13 @@ term: OPEN LET OPEN OPEN SYMBOL BIN CLOSE CLOSE UNDERSCORE
 ## OPEN LET OPEN nonempty_list(var_binding) CLOSE
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+021
+a term
+a term (body for the let binding)
 
 term: OPEN LET OPEN OPEN SYMBOL BIN CLOSE UNDERSCORE
 ##
-## Ends in an error in state: 97.
+## Ends in an error in state: 98.
 ##
 ## nonempty_list(var_binding) -> var_binding . [ CLOSE ]
 ## nonempty_list(var_binding) -> var_binding . nonempty_list(var_binding) [ CLOSE ]
@@ -251,11 +337,13 @@ term: OPEN LET OPEN OPEN SYMBOL BIN CLOSE UNDERSCORE
 ## var_binding
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+022
+a list of variable binding
+a closing parenthesis or a variable binding of the form "(var term)"
 
 term: OPEN LET OPEN OPEN SYMBOL SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 95.
+## Ends in an error in state: 96.
 ##
 ## var_binding -> OPEN SYMBOL term . CLOSE [ OPEN CLOSE ]
 ##
@@ -263,11 +351,13 @@ term: OPEN LET OPEN OPEN SYMBOL SYMBOL UNDERSCORE
 ## OPEN SYMBOL term
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+023
+a variable binding
+a closing parenthesis
 
 term: OPEN LET OPEN OPEN SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 94.
+## Ends in an error in state: 95.
 ##
 ## var_binding -> OPEN SYMBOL . term CLOSE [ OPEN CLOSE ]
 ##
@@ -275,11 +365,13 @@ term: OPEN LET OPEN OPEN SYMBOL UNDERSCORE
 ## OPEN SYMBOL
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+024
+a variable binding
+a term
 
 term: OPEN LET OPEN OPEN UNDERSCORE
 ##
-## Ends in an error in state: 93.
+## Ends in an error in state: 94.
 ##
 ## var_binding -> OPEN . SYMBOL term CLOSE [ OPEN CLOSE ]
 ##
@@ -287,11 +379,13 @@ term: OPEN LET OPEN OPEN UNDERSCORE
 ## OPEN
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+025
+a variable binding
+a symbol (i.e. variable name)
 
 term: OPEN LET OPEN UNDERSCORE
 ##
-## Ends in an error in state: 411.
+## Ends in an error in state: 412.
 ##
 ## term -> OPEN LET OPEN . nonempty_list(var_binding) CLOSE term CLOSE [ # ]
 ##
@@ -299,11 +393,13 @@ term: OPEN LET OPEN UNDERSCORE
 ## OPEN LET OPEN
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+026
+a term
+a variable binding of the form "(var term)"
 
 term: OPEN LET UNDERSCORE
 ##
-## Ends in an error in state: 410.
+## Ends in an error in state: 411.
 ##
 ## term -> OPEN LET . OPEN nonempty_list(var_binding) CLOSE term CLOSE [ # ]
 ##
@@ -311,11 +407,13 @@ term: OPEN LET UNDERSCORE
 ## OPEN LET
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+027
+a term
+a variable binding list, starting with an opening parenthesis
 
 term: OPEN MATCH SYMBOL OPEN OPEN OPEN SYMBOL SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 75.
+## Ends in an error in state: 76.
 ##
 ## nonempty_list(pattern_symbol) -> pattern_symbol . [ CLOSE ]
 ## nonempty_list(pattern_symbol) -> pattern_symbol . nonempty_list(pattern_symbol) [ CLOSE ]
@@ -324,11 +422,15 @@ term: OPEN MATCH SYMBOL OPEN OPEN OPEN SYMBOL SYMBOL UNDERSCORE
 ## pattern_symbol
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+028
+arguments of a constructor in a pattern
+a closing parenthesis, or a symbol to bind the argument;
+note that keywords and reserved words (such as '_', 'as', ...) are not
+symbols, and thus are not allowed here
 
 term: OPEN MATCH SYMBOL OPEN OPEN OPEN SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 74.
+## Ends in an error in state: 75.
 ##
 ## pattern -> OPEN pattern_symbol . nonempty_list(pattern_symbol) CLOSE [ SYMBOL STR OPEN NUM HEX DEC BIN ]
 ##
@@ -336,11 +438,15 @@ term: OPEN MATCH SYMBOL OPEN OPEN OPEN SYMBOL UNDERSCORE
 ## OPEN pattern_symbol
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+029
+arguments of a constructor in a pattern
+a symbol to bind the first constructor argument;
+note that keywords and reserved words (such as '_', 'as', ...) are not
+symbols, and thus are not allowed here
 
 term: OPEN MATCH SYMBOL OPEN OPEN OPEN UNDERSCORE
 ##
-## Ends in an error in state: 73.
+## Ends in an error in state: 74.
 ##
 ## pattern -> OPEN . pattern_symbol nonempty_list(pattern_symbol) CLOSE [ SYMBOL STR OPEN NUM HEX DEC BIN ]
 ##
@@ -348,11 +454,15 @@ term: OPEN MATCH SYMBOL OPEN OPEN OPEN UNDERSCORE
 ## OPEN
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+030
+a pattern
+a symbol (either a variable or a datatype constructor);
+note that keywords and reserved words (such as '_', 'as', ...) are not
+symbols, and thus are not allowed here
 
 term: OPEN MATCH SYMBOL OPEN OPEN SYMBOL SYMBOL CLOSE CLOSE UNDERSCORE
 ##
-## Ends in an error in state: 408.
+## Ends in an error in state: 409.
 ##
 ## term -> OPEN MATCH term OPEN nonempty_list(match_case) CLOSE . CLOSE [ # ]
 ##
@@ -360,11 +470,13 @@ term: OPEN MATCH SYMBOL OPEN OPEN SYMBOL SYMBOL CLOSE CLOSE UNDERSCORE
 ## OPEN MATCH term OPEN nonempty_list(match_case) CLOSE
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+031
+a match
+a closing parenthesis to close the match
 
 term: OPEN MATCH SYMBOL OPEN OPEN SYMBOL SYMBOL CLOSE UNDERSCORE
 ##
-## Ends in an error in state: 89.
+## Ends in an error in state: 90.
 ##
 ## nonempty_list(match_case) -> match_case . [ CLOSE ]
 ## nonempty_list(match_case) -> match_case . nonempty_list(match_case) [ CLOSE ]
@@ -373,11 +485,13 @@ term: OPEN MATCH SYMBOL OPEN OPEN SYMBOL SYMBOL CLOSE UNDERSCORE
 ## match_case
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+032
+a list of match cases
+a closing parenthesis or a match case of the form "(pattern body)"
 
 term: OPEN MATCH SYMBOL OPEN OPEN SYMBOL SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 81.
+## Ends in an error in state: 82.
 ##
 ## match_case -> OPEN pattern term . CLOSE [ OPEN CLOSE ]
 ##
@@ -385,11 +499,13 @@ term: OPEN MATCH SYMBOL OPEN OPEN SYMBOL SYMBOL UNDERSCORE
 ## OPEN pattern term
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+033
+a match case
+a closing parenthesis to close the match case
 
 term: OPEN MATCH SYMBOL OPEN OPEN SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 80.
+## Ends in an error in state: 81.
 ##
 ## match_case -> OPEN pattern . term CLOSE [ OPEN CLOSE ]
 ##
@@ -397,11 +513,13 @@ term: OPEN MATCH SYMBOL OPEN OPEN SYMBOL UNDERSCORE
 ## OPEN pattern
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+034
+a match case
+a term for the case body
 
 term: OPEN MATCH SYMBOL OPEN OPEN UNDERSCORE
 ##
-## Ends in an error in state: 71.
+## Ends in an error in state: 72.
 ##
 ## match_case -> OPEN . pattern term CLOSE [ OPEN CLOSE ]
 ##
@@ -409,11 +527,16 @@ term: OPEN MATCH SYMBOL OPEN OPEN UNDERSCORE
 ## OPEN
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+035
+a match case
+a pattern, i.e. either a symbol or a datatype pattern of
+the form "(symbol symbol+)";
+note that keywords and reserved words (such as '_', 'as', ...) are not
+symbols, and thus are not allowed here
 
 term: OPEN MATCH SYMBOL OPEN UNDERSCORE
 ##
-## Ends in an error in state: 406.
+## Ends in an error in state: 407.
 ##
 ## term -> OPEN MATCH term OPEN . nonempty_list(match_case) CLOSE CLOSE [ # ]
 ##
@@ -421,11 +544,13 @@ term: OPEN MATCH SYMBOL OPEN UNDERSCORE
 ## OPEN MATCH term OPEN
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+036
+a list of match cases
+a match case of the form "(pattern term)"
 
 term: OPEN MATCH SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 405.
+## Ends in an error in state: 406.
 ##
 ## term -> OPEN MATCH term . OPEN nonempty_list(match_case) CLOSE CLOSE [ # ]
 ##
@@ -433,11 +558,13 @@ term: OPEN MATCH SYMBOL UNDERSCORE
 ## OPEN MATCH term
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+037
+a match
+a match case list, starting with an opening parenthesis
 
 term: OPEN MATCH UNDERSCORE
 ##
-## Ends in an error in state: 404.
+## Ends in an error in state: 405.
 ##
 ## term -> OPEN MATCH . term OPEN nonempty_list(match_case) CLOSE CLOSE [ # ]
 ##
@@ -445,11 +572,13 @@ term: OPEN MATCH UNDERSCORE
 ## OPEN MATCH
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+038
+a match
+a term to match (i.e. the scrutinee of the match)
 
 term: OPEN OPEN AS SYMBOL SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 66.
+## Ends in an error in state: 67.
 ##
 ## qual_identifier -> OPEN AS identifier sort . CLOSE [ SYMBOL STR OPEN NUM KEYWORD HEX DEC CLOSE BIN ]
 ##
@@ -457,11 +586,13 @@ term: OPEN OPEN AS SYMBOL SYMBOL UNDERSCORE
 ## OPEN AS identifier sort
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+002
+a qualified identifier
+a closing parenthesis
 
 term: OPEN OPEN AS SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 58.
+## Ends in an error in state: 59.
 ##
 ## qual_identifier -> OPEN AS identifier . sort CLOSE [ SYMBOL STR OPEN NUM KEYWORD HEX DEC CLOSE BIN ]
 ##
@@ -469,11 +600,15 @@ term: OPEN OPEN AS SYMBOL UNDERSCORE
 ## OPEN AS identifier
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+003
+a qualified identifier
+a sort, i.e. either an identifier, or a sort constructor application;
+note that keywords (such as '_', 'as', ...) are none of these, and thus
+are not allowed here.
 
 term: OPEN OPEN AS UNDERSCORE
 ##
-## Ends in an error in state: 56.
+## Ends in an error in state: 57.
 ##
 ## qual_identifier -> OPEN AS . identifier sort CLOSE [ SYMBOL STR OPEN NUM KEYWORD HEX DEC CLOSE BIN ]
 ##
@@ -481,11 +616,15 @@ term: OPEN OPEN AS UNDERSCORE
 ## OPEN AS
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+004
+a qualified identifier
+an identifier.
+Note that keywords (such as '_', 'as', ...) are not identifiers,
+and thus are not allowed here.
 
 term: OPEN OPEN SYMBOL
 ##
-## Ends in an error in state: 55.
+## Ends in an error in state: 56.
 ##
 ## identifier -> OPEN . UNDERSCORE SYMBOL nonempty_list(index) CLOSE [ SYMBOL STR OPEN NUM HEX DEC BIN ]
 ## qual_identifier -> OPEN . AS identifier sort CLOSE [ SYMBOL STR OPEN NUM HEX DEC BIN ]
@@ -494,7 +633,11 @@ term: OPEN OPEN SYMBOL
 ## OPEN
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+039
+an identifier in parentheses
+either an indexed identifier (starting with an underscore)
+or an 'as' type ascription;
+note that this is because of the preceding opening parenthesis
 
 term: OPEN OPEN UNDERSCORE SYMBOL UNDERSCORE
 ##
@@ -506,7 +649,11 @@ term: OPEN OPEN UNDERSCORE SYMBOL UNDERSCORE
 ## OPEN UNDERSCORE SYMBOL
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+040
+an indexed identifier
+an index, i.e. either a numeral, a symbol, or a hexadecimal number;
+note that keywords and reserved words (such as '_', 'as', ...) are not
+symbols, and thus are not allowed here
 
 term: OPEN OPEN UNDERSCORE UNDERSCORE
 ##
@@ -518,11 +665,15 @@ term: OPEN OPEN UNDERSCORE UNDERSCORE
 ## OPEN UNDERSCORE
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+041
+an indexed identifier
+a symbol;
+note that keywords and reserved words (such as '_', 'as', ...) are not
+symbols, and thus are not allowed here
 
 term: OPEN STR
 ##
-## Ends in an error in state: 399.
+## Ends in an error in state: 400.
 ##
 ## identifier -> OPEN . UNDERSCORE SYMBOL nonempty_list(index) CLOSE [ # ]
 ## qual_identifier -> OPEN . AS identifier sort CLOSE [ # ]
@@ -537,11 +688,15 @@ term: OPEN STR
 ## OPEN
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+042
+a term
+a term construction (identifier, let binding, quantification, ...);
+note that this expectation if caused by the preceding opening parenthesis
+
 
 term: OPEN SYMBOL SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 128.
+## Ends in an error in state: 129.
 ##
 ## nonempty_list(term) -> term . [ CLOSE ]
 ## nonempty_list(term) -> term . nonempty_list(term) [ CLOSE ]
@@ -550,11 +705,15 @@ term: OPEN SYMBOL SYMBOL UNDERSCORE
 ## term
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+043
+a list of terms
+either a closing parenthesis, or another term;
+note that keywords and reserved words (such as '_', 'as', ...) are
+not terms, and thus are not allowed here
 
 term: OPEN SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 436.
+## Ends in an error in state: 437.
 ##
 ## term -> OPEN qual_identifier . nonempty_list(term) CLOSE [ # ]
 ##
@@ -562,11 +721,15 @@ term: OPEN SYMBOL UNDERSCORE
 ## OPEN qual_identifier
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+044
+a function application
+a term as argument;
+note that keywords and reserved words (such as '_', 'as', ...) are
+not terms, and thus are not allowed here
 
 term: OPEN UNDERSCORE SYMBOL SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 53.
+## Ends in an error in state: 54.
 ##
 ## nonempty_list(index) -> index . [ CLOSE ]
 ## nonempty_list(index) -> index . nonempty_list(index) [ CLOSE ]
@@ -575,11 +738,16 @@ term: OPEN UNDERSCORE SYMBOL SYMBOL UNDERSCORE
 ## index
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+045
+an index list
+either a closing parenthesis, or an index (i.e. a numeral, a symbol,
+or a hexadecimal);
+note that keywords and reserved words (such as '_', 'as', ...) are
+not symbols, and thus are not allowed here
 
 term: OPEN UNDERSCORE SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 401.
+## Ends in an error in state: 402.
 ##
 ## identifier -> OPEN UNDERSCORE SYMBOL . nonempty_list(index) CLOSE [ # ]
 ##
@@ -587,11 +755,15 @@ term: OPEN UNDERSCORE SYMBOL UNDERSCORE
 ## OPEN UNDERSCORE SYMBOL
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+040
+an indexed identifier
+an index, i.e. either a numeral, a symbol, or a hexadecimal number;
+note that keywords and reserved words (such as '_', 'as', ...) are not
+symbols, and thus are not allowed here
 
 term: OPEN UNDERSCORE UNDERSCORE
 ##
-## Ends in an error in state: 400.
+## Ends in an error in state: 401.
 ##
 ## identifier -> OPEN UNDERSCORE . SYMBOL nonempty_list(index) CLOSE [ # ]
 ##
@@ -599,11 +771,15 @@ term: OPEN UNDERSCORE UNDERSCORE
 ## OPEN UNDERSCORE
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+041
+an indexed identifier
+a symbol;
+note that keywords and reserved words (such as '_', 'as', ...) are not
+symbols, and thus are not allowed here
 
 term: UNDERSCORE
 ##
-## Ends in an error in state: 396.
+## Ends in an error in state: 397.
 ##
 ## term' -> . term [ # ]
 ##
@@ -611,11 +787,15 @@ term: UNDERSCORE
 ##
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+046
+a term
+a term construction (symbol, function application, match, let binding, ...);
+note that keywords and reserved words (such as '_', 'as', ...) are
+not symbols, and thus are not allowed here
 
 input: OPEN ASSERT SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 391.
+## Ends in an error in state: 392.
 ##
 ## command -> OPEN ASSERT term . CLOSE [ # ]
 ##
@@ -623,11 +803,13 @@ input: OPEN ASSERT SYMBOL UNDERSCORE
 ## OPEN ASSERT term
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+049
+an assertion
+a closing parenthesis
 
 input: OPEN ASSERT UNDERSCORE
 ##
-## Ends in an error in state: 390.
+## Ends in an error in state: 391.
 ##
 ## command -> OPEN ASSERT . term CLOSE [ # ]
 ##
@@ -635,11 +817,15 @@ input: OPEN ASSERT UNDERSCORE
 ## OPEN ASSERT
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+048
+a term
+a term construction (symbol, function application, match, let binding, ...);
+note that keywords and reserved words (such as '_', 'as', ...) are
+not symbols, and thus are not allowed here
 
 input: OPEN CHECK_SAT UNDERSCORE
 ##
-## Ends in an error in state: 388.
+## Ends in an error in state: 389.
 ##
 ## command -> OPEN CHECK_SAT . CLOSE [ # ]
 ##
@@ -647,11 +833,13 @@ input: OPEN CHECK_SAT UNDERSCORE
 ## OPEN CHECK_SAT
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+050
+a check-sat command
+a closing parenthesis
 
 input: OPEN CHECK_SAT_ASSUMING OPEN CLOSE UNDERSCORE
 ##
-## Ends in an error in state: 386.
+## Ends in an error in state: 387.
 ##
 ## command -> OPEN CHECK_SAT_ASSUMING OPEN list(prop_literal) CLOSE . CLOSE [ # ]
 ##
@@ -659,11 +847,13 @@ input: OPEN CHECK_SAT_ASSUMING OPEN CLOSE UNDERSCORE
 ## OPEN CHECK_SAT_ASSUMING OPEN list(prop_literal) CLOSE
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+051
+a check-sat-assuming command
+a closing parenthesis
 
 input: OPEN CHECK_SAT_ASSUMING OPEN UNDERSCORE
 ##
-## Ends in an error in state: 384.
+## Ends in an error in state: 385.
 ##
 ## command -> OPEN CHECK_SAT_ASSUMING OPEN . list(prop_literal) CLOSE CLOSE [ # ]
 ##
@@ -671,11 +861,13 @@ input: OPEN CHECK_SAT_ASSUMING OPEN UNDERSCORE
 ## OPEN CHECK_SAT_ASSUMING OPEN
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+052
+a list of propositional literals
+a propositional literal, i.e. either a symbol or the negation of a symbol
 
 input: OPEN CHECK_SAT_ASSUMING UNDERSCORE
 ##
-## Ends in an error in state: 383.
+## Ends in an error in state: 384.
 ##
 ## command -> OPEN CHECK_SAT_ASSUMING . OPEN list(prop_literal) CLOSE CLOSE [ # ]
 ##
@@ -683,11 +875,13 @@ input: OPEN CHECK_SAT_ASSUMING UNDERSCORE
 ## OPEN CHECK_SAT_ASSUMING
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+053
+a check-sat-assuming command
+a list of propositional literals, starting with an opening parenthesis
 
 input: OPEN DECLARE_CONST SYMBOL SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 381.
+## Ends in an error in state: 382.
 ##
 ## command -> OPEN DECLARE_CONST SYMBOL sort . CLOSE [ # ]
 ##
@@ -695,11 +889,13 @@ input: OPEN DECLARE_CONST SYMBOL SYMBOL UNDERSCORE
 ## OPEN DECLARE_CONST SYMBOL sort
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+054
+a constant declaration
+a closing parenthesis
 
 input: OPEN DECLARE_CONST SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 380.
+## Ends in an error in state: 381.
 ##
 ## command -> OPEN DECLARE_CONST SYMBOL . sort CLOSE [ # ]
 ##
@@ -707,11 +903,13 @@ input: OPEN DECLARE_CONST SYMBOL UNDERSCORE
 ## OPEN DECLARE_CONST SYMBOL
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+055
+a constant declaration
+a sort
 
 input: OPEN DECLARE_CONST UNDERSCORE
 ##
-## Ends in an error in state: 379.
+## Ends in an error in state: 380.
 ##
 ## command -> OPEN DECLARE_CONST . SYMBOL sort CLOSE [ # ]
 ##
@@ -719,11 +917,15 @@ input: OPEN DECLARE_CONST UNDERSCORE
 ## OPEN DECLARE_CONST
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+056
+a constant declaration
+a symbol;
+note that keywords and reserved words (such as '_', 'as', ...) are not
+symbols, and thus are not allowed here
 
 input: OPEN DECLARE_DATATYPE SYMBOL OPEN OPEN SYMBOL CLOSE CLOSE UNDERSCORE
 ##
-## Ends in an error in state: 377.
+## Ends in an error in state: 378.
 ##
 ## command -> OPEN DECLARE_DATATYPE SYMBOL datatype_dec . CLOSE [ # ]
 ##
@@ -731,11 +933,13 @@ input: OPEN DECLARE_DATATYPE SYMBOL OPEN OPEN SYMBOL CLOSE CLOSE UNDERSCORE
 ## OPEN DECLARE_DATATYPE SYMBOL datatype_dec
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+057
+a datatype declaration
+a closing parenthesis
 
 input: OPEN DECLARE_DATATYPE SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 376.
+## Ends in an error in state: 377.
 ##
 ## command -> OPEN DECLARE_DATATYPE SYMBOL . datatype_dec CLOSE [ # ]
 ##
@@ -743,11 +947,13 @@ input: OPEN DECLARE_DATATYPE SYMBOL UNDERSCORE
 ## OPEN DECLARE_DATATYPE SYMBOL
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+058
+a datatype declaration
+an opening parenthesis to start the datatype declaration
 
 input: OPEN DECLARE_DATATYPE UNDERSCORE
 ##
-## Ends in an error in state: 375.
+## Ends in an error in state: 376.
 ##
 ## command -> OPEN DECLARE_DATATYPE . SYMBOL datatype_dec CLOSE [ # ]
 ##
@@ -755,11 +961,13 @@ input: OPEN DECLARE_DATATYPE UNDERSCORE
 ## OPEN DECLARE_DATATYPE
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+059
+a datatype declaration
+a symbol
 
 input: OPEN DECLARE_DATATYPES OPEN OPEN SYMBOL NUM CLOSE CLOSE OPEN OPEN OPEN SYMBOL CLOSE CLOSE CLOSE UNDERSCORE
 ##
-## Ends in an error in state: 373.
+## Ends in an error in state: 374.
 ##
 ## command -> OPEN DECLARE_DATATYPES OPEN nonempty_list(sort_dec) CLOSE OPEN nonempty_list(datatype_dec) CLOSE . CLOSE [ # ]
 ##
@@ -767,11 +975,13 @@ input: OPEN DECLARE_DATATYPES OPEN OPEN SYMBOL NUM CLOSE CLOSE OPEN OPEN OPEN SY
 ## OPEN DECLARE_DATATYPES OPEN nonempty_list(sort_dec) CLOSE OPEN nonempty_list(datatype_dec) CLOSE
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+060
+a datatypes declaration
+a closing parenthesis
 
 input: OPEN DECLARE_DATATYPES OPEN OPEN SYMBOL NUM CLOSE CLOSE OPEN UNDERSCORE
 ##
-## Ends in an error in state: 371.
+## Ends in an error in state: 372.
 ##
 ## command -> OPEN DECLARE_DATATYPES OPEN nonempty_list(sort_dec) CLOSE OPEN . nonempty_list(datatype_dec) CLOSE CLOSE [ # ]
 ##
@@ -779,11 +989,13 @@ input: OPEN DECLARE_DATATYPES OPEN OPEN SYMBOL NUM CLOSE CLOSE OPEN UNDERSCORE
 ## OPEN DECLARE_DATATYPES OPEN nonempty_list(sort_dec) CLOSE OPEN
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+061
+a datatypes definition
+an opening parenthesis to start a list of constructors for the first defined datatype
 
 input: OPEN DECLARE_DATATYPES OPEN OPEN SYMBOL NUM CLOSE CLOSE UNDERSCORE
 ##
-## Ends in an error in state: 370.
+## Ends in an error in state: 371.
 ##
 ## command -> OPEN DECLARE_DATATYPES OPEN nonempty_list(sort_dec) CLOSE . OPEN nonempty_list(datatype_dec) CLOSE CLOSE [ # ]
 ##
@@ -791,11 +1003,14 @@ input: OPEN DECLARE_DATATYPES OPEN OPEN SYMBOL NUM CLOSE CLOSE UNDERSCORE
 ## OPEN DECLARE_DATATYPES OPEN nonempty_list(sort_dec) CLOSE
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+062
+a datatypes declaration
+an opening parenthesis to start a list of datatype definitions,
+one for each of the sorts being declared
 
 input: OPEN DECLARE_DATATYPES OPEN UNDERSCORE
 ##
-## Ends in an error in state: 368.
+## Ends in an error in state: 369.
 ##
 ## command -> OPEN DECLARE_DATATYPES OPEN . nonempty_list(sort_dec) CLOSE OPEN nonempty_list(datatype_dec) CLOSE CLOSE [ # ]
 ##
@@ -803,11 +1018,13 @@ input: OPEN DECLARE_DATATYPES OPEN UNDERSCORE
 ## OPEN DECLARE_DATATYPES OPEN
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+063
+a datatypes declaration
+a parametric sort declaration of the form "(symbol num)"
 
 input: OPEN DECLARE_DATATYPES UNDERSCORE
 ##
-## Ends in an error in state: 367.
+## Ends in an error in state: 368.
 ##
 ## command -> OPEN DECLARE_DATATYPES . OPEN nonempty_list(sort_dec) CLOSE OPEN nonempty_list(datatype_dec) CLOSE CLOSE [ # ]
 ##
@@ -815,11 +1032,13 @@ input: OPEN DECLARE_DATATYPES UNDERSCORE
 ## OPEN DECLARE_DATATYPES
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+064
+a datatypes declaration
+a list of sort declaration, starting with an opening parenthesis
 
 input: OPEN DECLARE_FUN SYMBOL OPEN CLOSE SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 365.
+## Ends in an error in state: 366.
 ##
 ## command -> OPEN DECLARE_FUN SYMBOL OPEN list(sort) CLOSE sort . CLOSE [ # ]
 ##
@@ -827,11 +1046,13 @@ input: OPEN DECLARE_FUN SYMBOL OPEN CLOSE SYMBOL UNDERSCORE
 ## OPEN DECLARE_FUN SYMBOL OPEN list(sort) CLOSE sort
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+065
+a function declaration
+a closing parenthesis
 
 input: OPEN DECLARE_FUN SYMBOL OPEN CLOSE UNDERSCORE
 ##
-## Ends in an error in state: 364.
+## Ends in an error in state: 365.
 ##
 ## command -> OPEN DECLARE_FUN SYMBOL OPEN list(sort) CLOSE . sort CLOSE [ # ]
 ##
@@ -839,11 +1060,13 @@ input: OPEN DECLARE_FUN SYMBOL OPEN CLOSE UNDERSCORE
 ## OPEN DECLARE_FUN SYMBOL OPEN list(sort) CLOSE
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+066
+a function declaration
+a sort for the return type of the function
 
 input: OPEN DECLARE_FUN SYMBOL OPEN UNDERSCORE
 ##
-## Ends in an error in state: 362.
+## Ends in an error in state: 363.
 ##
 ## command -> OPEN DECLARE_FUN SYMBOL OPEN . list(sort) CLOSE sort CLOSE [ # ]
 ##
@@ -851,11 +1074,13 @@ input: OPEN DECLARE_FUN SYMBOL OPEN UNDERSCORE
 ## OPEN DECLARE_FUN SYMBOL OPEN
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+067
+a function declaration
+a closing parenthesis, or a list of sorts for the arguments of the function
 
 input: OPEN DECLARE_FUN SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 361.
+## Ends in an error in state: 362.
 ##
 ## command -> OPEN DECLARE_FUN SYMBOL . OPEN list(sort) CLOSE sort CLOSE [ # ]
 ##
@@ -863,11 +1088,13 @@ input: OPEN DECLARE_FUN SYMBOL UNDERSCORE
 ## OPEN DECLARE_FUN SYMBOL
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+068
+a function declaration
+an opening parenthesis to start the list of sorts for the function's arguments
 
 input: OPEN DECLARE_FUN UNDERSCORE
 ##
-## Ends in an error in state: 360.
+## Ends in an error in state: 361.
 ##
 ## command -> OPEN DECLARE_FUN . SYMBOL OPEN list(sort) CLOSE sort CLOSE [ # ]
 ##
@@ -875,11 +1102,13 @@ input: OPEN DECLARE_FUN UNDERSCORE
 ## OPEN DECLARE_FUN
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+069
+a function declaration
+a symbol for the function's name
 
 input: OPEN DECLARE_SORT SYMBOL NUM UNDERSCORE
 ##
-## Ends in an error in state: 358.
+## Ends in an error in state: 359.
 ##
 ## command -> OPEN DECLARE_SORT SYMBOL NUM . CLOSE [ # ]
 ##
@@ -887,11 +1116,13 @@ input: OPEN DECLARE_SORT SYMBOL NUM UNDERSCORE
 ## OPEN DECLARE_SORT SYMBOL NUM
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+070
+a sort declaration
+a closing parenthesis
 
 input: OPEN DECLARE_SORT SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 357.
+## Ends in an error in state: 358.
 ##
 ## command -> OPEN DECLARE_SORT SYMBOL . NUM CLOSE [ # ]
 ##
@@ -899,11 +1130,13 @@ input: OPEN DECLARE_SORT SYMBOL UNDERSCORE
 ## OPEN DECLARE_SORT SYMBOL
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+071
+a sort declaration
+a numeral for the arity of the sort being declared
 
 input: OPEN DECLARE_SORT UNDERSCORE
 ##
-## Ends in an error in state: 356.
+## Ends in an error in state: 357.
 ##
 ## command -> OPEN DECLARE_SORT . SYMBOL NUM CLOSE [ # ]
 ##
@@ -911,11 +1144,13 @@ input: OPEN DECLARE_SORT UNDERSCORE
 ## OPEN DECLARE_SORT
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+072
+a sort declaration
+a symbol for the sort name
 
 input: OPEN DEFINE_FUN SYMBOL OPEN CLOSE SYMBOL SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 354.
+## Ends in an error in state: 355.
 ##
 ## command -> OPEN DEFINE_FUN function_def . CLOSE [ # ]
 ##
@@ -923,11 +1158,13 @@ input: OPEN DEFINE_FUN SYMBOL OPEN CLOSE SYMBOL SYMBOL UNDERSCORE
 ## OPEN DEFINE_FUN function_def
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+073
+a function definition
+a closing parenthesis
 
 input: OPEN DEFINE_FUN UNDERSCORE
 ##
-## Ends in an error in state: 353.
+## Ends in an error in state: 354.
 ##
 ## command -> OPEN DEFINE_FUN . function_def CLOSE [ # ]
 ##
@@ -935,11 +1172,13 @@ input: OPEN DEFINE_FUN UNDERSCORE
 ## OPEN DEFINE_FUN
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+074
+a function definition
+a symbol for the function's name
 
 input: OPEN DEFINE_FUNS_REC OPEN OPEN SYMBOL OPEN CLOSE SYMBOL CLOSE CLOSE OPEN SYMBOL CLOSE UNDERSCORE
 ##
-## Ends in an error in state: 351.
+## Ends in an error in state: 352.
 ##
 ## command -> OPEN DEFINE_FUNS_REC OPEN nonempty_list(function_dec) CLOSE OPEN nonempty_list(term) CLOSE . OPEN [ # ]
 ##
@@ -947,11 +1186,13 @@ input: OPEN DEFINE_FUNS_REC OPEN OPEN SYMBOL OPEN CLOSE SYMBOL CLOSE CLOSE OPEN
 ## OPEN DEFINE_FUNS_REC OPEN nonempty_list(function_dec) CLOSE OPEN nonempty_list(term) CLOSE
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+075
+a recursive functions definition
+a closing parenthesis
 
 input: OPEN DEFINE_FUNS_REC OPEN OPEN SYMBOL OPEN CLOSE SYMBOL CLOSE CLOSE OPEN UNDERSCORE
 ##
-## Ends in an error in state: 349.
+## Ends in an error in state: 350.
 ##
 ## command -> OPEN DEFINE_FUNS_REC OPEN nonempty_list(function_dec) CLOSE OPEN . nonempty_list(term) CLOSE OPEN [ # ]
 ##
@@ -959,11 +1200,13 @@ input: OPEN DEFINE_FUNS_REC OPEN OPEN SYMBOL OPEN CLOSE SYMBOL CLOSE CLOSE OPEN
 ## OPEN DEFINE_FUNS_REC OPEN nonempty_list(function_dec) CLOSE OPEN
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+076
+a recursive functions definition
+a term for the first function's body
 
 input: OPEN DEFINE_FUNS_REC OPEN OPEN SYMBOL OPEN CLOSE SYMBOL CLOSE CLOSE UNDERSCORE
 ##
-## Ends in an error in state: 348.
+## Ends in an error in state: 349.
 ##
 ## command -> OPEN DEFINE_FUNS_REC OPEN nonempty_list(function_dec) CLOSE . OPEN nonempty_list(term) CLOSE OPEN [ # ]
 ##
@@ -971,11 +1214,13 @@ input: OPEN DEFINE_FUNS_REC OPEN OPEN SYMBOL OPEN CLOSE SYMBOL CLOSE CLOSE UNDER
 ## OPEN DEFINE_FUNS_REC OPEN nonempty_list(function_dec) CLOSE
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+077
+a recursive functions definition
+an opening parenthesis to start a list the function's bodies
 
 input: OPEN DEFINE_FUNS_REC OPEN UNDERSCORE
 ##
-## Ends in an error in state: 346.
+## Ends in an error in state: 347.
 ##
 ## command -> OPEN DEFINE_FUNS_REC OPEN . nonempty_list(function_dec) CLOSE OPEN nonempty_list(term) CLOSE OPEN [ # ]
 ##
@@ -983,11 +1228,13 @@ input: OPEN DEFINE_FUNS_REC OPEN UNDERSCORE
 ## OPEN DEFINE_FUNS_REC OPEN
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+078
+a recursive functions definition
+a function declaration of the form "(name (sort*) sort)"
 
 input: OPEN DEFINE_FUNS_REC UNDERSCORE
 ##
-## Ends in an error in state: 345.
+## Ends in an error in state: 346.
 ##
 ## command -> OPEN DEFINE_FUNS_REC . OPEN nonempty_list(function_dec) CLOSE OPEN nonempty_list(term) CLOSE OPEN [ # ]
 ##
@@ -995,11 +1242,13 @@ input: OPEN DEFINE_FUNS_REC UNDERSCORE
 ## OPEN DEFINE_FUNS_REC
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+079
+a recursive functions declaration
+an opening parenthesis to start a list of function declaration
 
 input: OPEN DEFINE_FUN_REC SYMBOL OPEN CLOSE SYMBOL SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 343.
+## Ends in an error in state: 344.
 ##
 ## command -> OPEN DEFINE_FUN_REC function_def . CLOSE [ # ]
 ##
@@ -1007,11 +1256,13 @@ input: OPEN DEFINE_FUN_REC SYMBOL OPEN CLOSE SYMBOL SYMBOL UNDERSCORE
 ## OPEN DEFINE_FUN_REC function_def
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+080
+a recursive function definition
+a closing parenthesis
 
 input: OPEN DEFINE_FUN_REC UNDERSCORE
 ##
-## Ends in an error in state: 342.
+## Ends in an error in state: 343.
 ##
 ## command -> OPEN DEFINE_FUN_REC . function_def CLOSE [ # ]
 ##
@@ -1019,11 +1270,13 @@ input: OPEN DEFINE_FUN_REC UNDERSCORE
 ## OPEN DEFINE_FUN_REC
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+081
+a recursive function definition
+a symbol for the function's name
 
 input: OPEN DEFINE_SORT SYMBOL OPEN CLOSE SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 340.
+## Ends in an error in state: 341.
 ##
 ## command -> OPEN DEFINE_SORT SYMBOL OPEN list(SYMBOL) CLOSE sort . CLOSE [ # ]
 ##
@@ -1031,11 +1284,13 @@ input: OPEN DEFINE_SORT SYMBOL OPEN CLOSE SYMBOL UNDERSCORE
 ## OPEN DEFINE_SORT SYMBOL OPEN list(SYMBOL) CLOSE sort
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+082
+a sort definition
+a closing parenthesis
 
 input: OPEN DEFINE_SORT SYMBOL OPEN CLOSE UNDERSCORE
 ##
-## Ends in an error in state: 339.
+## Ends in an error in state: 340.
 ##
 ## command -> OPEN DEFINE_SORT SYMBOL OPEN list(SYMBOL) CLOSE . sort CLOSE [ # ]
 ##
@@ -1043,11 +1298,13 @@ input: OPEN DEFINE_SORT SYMBOL OPEN CLOSE UNDERSCORE
 ## OPEN DEFINE_SORT SYMBOL OPEN list(SYMBOL) CLOSE
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+083
+a sort definition
+a sort for the definition body
 
 input: OPEN DEFINE_SORT SYMBOL OPEN UNDERSCORE
 ##
-## Ends in an error in state: 337.
+## Ends in an error in state: 338.
 ##
 ## command -> OPEN DEFINE_SORT SYMBOL OPEN . list(SYMBOL) CLOSE sort CLOSE [ # ]
 ##
@@ -1055,11 +1312,13 @@ input: OPEN DEFINE_SORT SYMBOL OPEN UNDERSCORE
 ## OPEN DEFINE_SORT SYMBOL OPEN
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+084
+a sort definition
+a closing parenthesis, or a list of symbols for the definition arguments
 
 input: OPEN DEFINE_SORT SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 336.
+## Ends in an error in state: 337.
 ##
 ## command -> OPEN DEFINE_SORT SYMBOL . OPEN list(SYMBOL) CLOSE sort CLOSE [ # ]
 ##
@@ -1067,11 +1326,13 @@ input: OPEN DEFINE_SORT SYMBOL UNDERSCORE
 ## OPEN DEFINE_SORT SYMBOL
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+085
+a sort definition
+an opening parenthesis to start a list of arguments
 
 input: OPEN DEFINE_SORT UNDERSCORE
 ##
-## Ends in an error in state: 335.
+## Ends in an error in state: 336.
 ##
 ## command -> OPEN DEFINE_SORT . SYMBOL OPEN list(SYMBOL) CLOSE sort CLOSE [ # ]
 ##
@@ -1079,11 +1340,13 @@ input: OPEN DEFINE_SORT UNDERSCORE
 ## OPEN DEFINE_SORT
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+086
+a sort definition
+a symbol for the defined sort's name
 
 input: OPEN ECHO STR UNDERSCORE
 ##
-## Ends in an error in state: 333.
+## Ends in an error in state: 334.
 ##
 ## command -> OPEN ECHO STR . CLOSE [ # ]
 ##
@@ -1091,11 +1354,13 @@ input: OPEN ECHO STR UNDERSCORE
 ## OPEN ECHO STR
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+087
+an echo command
+a closing parenthesis
 
 input: OPEN ECHO UNDERSCORE
 ##
-## Ends in an error in state: 332.
+## Ends in an error in state: 333.
 ##
 ## command -> OPEN ECHO . STR CLOSE [ # ]
 ##
@@ -1103,11 +1368,13 @@ input: OPEN ECHO UNDERSCORE
 ## OPEN ECHO
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+088
+an echo command
+a string literal
 
 input: OPEN EXIT UNDERSCORE
 ##
-## Ends in an error in state: 330.
+## Ends in an error in state: 331.
 ##
 ## command -> OPEN EXIT . CLOSE [ # ]
 ##
@@ -1115,11 +1382,13 @@ input: OPEN EXIT UNDERSCORE
 ## OPEN EXIT
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+089
+an exit command
+a closing parenthesis
 
 input: OPEN GET_ASSERTIONS UNDERSCORE
 ##
-## Ends in an error in state: 328.
+## Ends in an error in state: 329.
 ##
 ## command -> OPEN GET_ASSERTIONS . CLOSE [ # ]
 ##
@@ -1127,11 +1396,13 @@ input: OPEN GET_ASSERTIONS UNDERSCORE
 ## OPEN GET_ASSERTIONS
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+090
+a get-assertions command
+a closing parenthesis
 
 input: OPEN GET_ASSIGNMENT UNDERSCORE
 ##
-## Ends in an error in state: 326.
+## Ends in an error in state: 327.
 ##
 ## command -> OPEN GET_ASSIGNMENT . CLOSE [ # ]
 ##
@@ -1139,11 +1410,13 @@ input: OPEN GET_ASSIGNMENT UNDERSCORE
 ## OPEN GET_ASSIGNMENT
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+091
+a get-assignment command
+a closing parenthesis
 
 input: OPEN GET_INFO KEYWORD UNDERSCORE
 ##
-## Ends in an error in state: 324.
+## Ends in an error in state: 325.
 ##
 ## command -> OPEN GET_INFO info_flag . CLOSE [ # ]
 ##
@@ -1151,11 +1424,13 @@ input: OPEN GET_INFO KEYWORD UNDERSCORE
 ## OPEN GET_INFO info_flag
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+092
+a get-info command
+a closing parenthesis
 
 input: OPEN GET_INFO UNDERSCORE
 ##
-## Ends in an error in state: 323.
+## Ends in an error in state: 324.
 ##
 ## command -> OPEN GET_INFO . info_flag CLOSE [ # ]
 ##
@@ -1163,11 +1438,13 @@ input: OPEN GET_INFO UNDERSCORE
 ## OPEN GET_INFO
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+093
+a get-info command
+a keyword of the form ":symbol"
 
 input: OPEN GET_MODEL UNDERSCORE
 ##
-## Ends in an error in state: 321.
+## Ends in an error in state: 322.
 ##
 ## command -> OPEN GET_MODEL . CLOSE [ # ]
 ##
@@ -1175,11 +1452,13 @@ input: OPEN GET_MODEL UNDERSCORE
 ## OPEN GET_MODEL
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+094
+a get-model command
+a closing parenthesis
 
 input: OPEN GET_OPTION KEYWORD UNDERSCORE
 ##
-## Ends in an error in state: 319.
+## Ends in an error in state: 320.
 ##
 ## command -> OPEN GET_OPTION KEYWORD . CLOSE [ # ]
 ##
@@ -1187,11 +1466,13 @@ input: OPEN GET_OPTION KEYWORD UNDERSCORE
 ## OPEN GET_OPTION KEYWORD
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+095
+a get-option command
+a closing parenthesis
 
 input: OPEN GET_OPTION UNDERSCORE
 ##
-## Ends in an error in state: 318.
+## Ends in an error in state: 319.
 ##
 ## command -> OPEN GET_OPTION . KEYWORD CLOSE [ # ]
 ##
@@ -1199,11 +1480,13 @@ input: OPEN GET_OPTION UNDERSCORE
 ## OPEN GET_OPTION
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+096
+a get-option command
+a keyword of the form ":symbol"
 
 input: OPEN GET_PROOF UNDERSCORE
 ##
-## Ends in an error in state: 316.
+## Ends in an error in state: 317.
 ##
 ## command -> OPEN GET_PROOF . CLOSE [ # ]
 ##
@@ -1211,11 +1494,13 @@ input: OPEN GET_PROOF UNDERSCORE
 ## OPEN GET_PROOF
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+097
+a get-proof command
+a closing parenthesis
 
 input: OPEN GET_UNSAT_ASSUMPTIONS UNDERSCORE
 ##
-## Ends in an error in state: 314.
+## Ends in an error in state: 315.
 ##
 ## command -> OPEN GET_UNSAT_ASSUMPTIONS . CLOSE [ # ]
 ##
@@ -1223,11 +1508,13 @@ input: OPEN GET_UNSAT_ASSUMPTIONS UNDERSCORE
 ## OPEN GET_UNSAT_ASSUMPTIONS
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+098
+a get-unsat-assumptions command
+a closing parenthesis
 
 input: OPEN GET_UNSAT_CORE UNDERSCORE
 ##
-## Ends in an error in state: 312.
+## Ends in an error in state: 313.
 ##
 ## command -> OPEN GET_UNSAT_CORE . CLOSE [ # ]
 ##
@@ -1235,11 +1522,13 @@ input: OPEN GET_UNSAT_CORE UNDERSCORE
 ## OPEN GET_UNSAT_CORE
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+099
+a get-unsat-core command
+a closing parenthesis
 
 input: OPEN GET_VALUE OPEN SYMBOL CLOSE UNDERSCORE
 ##
-## Ends in an error in state: 310.
+## Ends in an error in state: 311.
 ##
 ## command -> OPEN GET_VALUE OPEN nonempty_list(term) CLOSE . CLOSE [ # ]
 ##
@@ -1247,11 +1536,13 @@ input: OPEN GET_VALUE OPEN SYMBOL CLOSE UNDERSCORE
 ## OPEN GET_VALUE OPEN nonempty_list(term) CLOSE
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+100
+a get-value command
+a closing parenthesis
 
 input: OPEN GET_VALUE OPEN UNDERSCORE
 ##
-## Ends in an error in state: 308.
+## Ends in an error in state: 309.
 ##
 ## command -> OPEN GET_VALUE OPEN . nonempty_list(term) CLOSE CLOSE [ # ]
 ##
@@ -1259,11 +1550,13 @@ input: OPEN GET_VALUE OPEN UNDERSCORE
 ## OPEN GET_VALUE OPEN
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+101
+a get-value command
+a term
 
 input: OPEN GET_VALUE UNDERSCORE
 ##
-## Ends in an error in state: 307.
+## Ends in an error in state: 308.
 ##
 ## command -> OPEN GET_VALUE . OPEN nonempty_list(term) CLOSE CLOSE [ # ]
 ##
@@ -1271,11 +1564,13 @@ input: OPEN GET_VALUE UNDERSCORE
 ## OPEN GET_VALUE
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+102
+a get-value command
+an opening parenthesis to start a list of terms
 
 input: OPEN POP NUM UNDERSCORE
 ##
-## Ends in an error in state: 305.
+## Ends in an error in state: 306.
 ##
 ## command -> OPEN POP NUM . CLOSE [ # ]
 ##
@@ -1283,11 +1578,13 @@ input: OPEN POP NUM UNDERSCORE
 ## OPEN POP NUM
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+103
+a pop command
+a closing parenthesis
 
 input: OPEN POP UNDERSCORE
 ##
-## Ends in an error in state: 304.
+## Ends in an error in state: 305.
 ##
 ## command -> OPEN POP . NUM CLOSE [ # ]
 ##
@@ -1295,11 +1592,13 @@ input: OPEN POP UNDERSCORE
 ## OPEN POP
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+104
+a pop command
+a numeral
 
 input: OPEN PUSH NUM UNDERSCORE
 ##
-## Ends in an error in state: 302.
+## Ends in an error in state: 303.
 ##
 ## command -> OPEN PUSH NUM . CLOSE [ # ]
 ##
@@ -1307,11 +1606,13 @@ input: OPEN PUSH NUM UNDERSCORE
 ## OPEN PUSH NUM
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+105
+a push command
+a closing parenthesis
 
 input: OPEN PUSH UNDERSCORE
 ##
-## Ends in an error in state: 301.
+## Ends in an error in state: 302.
 ##
 ## command -> OPEN PUSH . NUM CLOSE [ # ]
 ##
@@ -1319,11 +1620,13 @@ input: OPEN PUSH UNDERSCORE
 ## OPEN PUSH
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+106
+a push command
+a numeral
 
 input: OPEN RESET UNDERSCORE
 ##
-## Ends in an error in state: 299.
+## Ends in an error in state: 300.
 ##
 ## command -> OPEN RESET . CLOSE [ # ]
 ##
@@ -1331,11 +1634,13 @@ input: OPEN RESET UNDERSCORE
 ## OPEN RESET
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+107
+a reset command
+a closing parenthesis
 
 input: OPEN RESET_ASSERTIONS UNDERSCORE
 ##
-## Ends in an error in state: 297.
+## Ends in an error in state: 298.
 ##
 ## command -> OPEN RESET_ASSERTIONS . CLOSE [ # ]
 ##
@@ -1343,11 +1648,13 @@ input: OPEN RESET_ASSERTIONS UNDERSCORE
 ## OPEN RESET_ASSERTIONS
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+108
+a reset-assertions command
+a closing parenthesis
 
 input: OPEN SET_INFO KEYWORD KEYWORD
 ##
-## Ends in an error in state: 295.
+## Ends in an error in state: 296.
 ##
 ## command -> OPEN SET_INFO command_option . CLOSE [ # ]
 ##
@@ -1363,11 +1670,15 @@ input: OPEN SET_INFO KEYWORD KEYWORD
 ## In state 26, spurious reduction of production command_option -> attribute 
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+109
+a set-info command
+a closing parenthesis, or an attribute value;
+note that keywords and reserved words (such as '_', 'as', ...) are not
+valid attribute values, and thus are not allowed here
 
 input: OPEN SET_INFO UNDERSCORE
 ##
-## Ends in an error in state: 294.
+## Ends in an error in state: 295.
 ##
 ## command -> OPEN SET_INFO . command_option CLOSE [ # ]
 ##
@@ -1375,11 +1686,13 @@ input: OPEN SET_INFO UNDERSCORE
 ## OPEN SET_INFO
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+110
+a set-info command
+an attribute of the form "keyword value?"
 
 input: OPEN SET_LOGIC SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 292.
+## Ends in an error in state: 293.
 ##
 ## command -> OPEN SET_LOGIC SYMBOL . CLOSE [ # ]
 ##
@@ -1387,11 +1700,13 @@ input: OPEN SET_LOGIC SYMBOL UNDERSCORE
 ## OPEN SET_LOGIC SYMBOL
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+111
+a set-logic command
+a closing parenthesis
 
 input: OPEN SET_LOGIC UNDERSCORE
 ##
-## Ends in an error in state: 291.
+## Ends in an error in state: 292.
 ##
 ## command -> OPEN SET_LOGIC . SYMBOL CLOSE [ # ]
 ##
@@ -1399,11 +1714,13 @@ input: OPEN SET_LOGIC UNDERSCORE
 ## OPEN SET_LOGIC
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+112
+a set-logic command
+a symbol for the logic name
 
 input: OPEN SET_OPTION KEYWORD KEYWORD
 ##
-## Ends in an error in state: 289.
+## Ends in an error in state: 290.
 ##
 ## command -> OPEN SET_OPTION command_option . CLOSE [ # ]
 ##
@@ -1419,11 +1736,15 @@ input: OPEN SET_OPTION KEYWORD KEYWORD
 ## In state 26, spurious reduction of production command_option -> attribute 
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+113
+a set-option command
+a closing parenthesis, or an attribute value;
+note that keywords and reserved words (such as '_', 'as', ...) are not
+valid attribute values, and thus are not allowed here
 
 input: OPEN SET_OPTION UNDERSCORE
 ##
-## Ends in an error in state: 288.
+## Ends in an error in state: 289.
 ##
 ## command -> OPEN SET_OPTION . command_option CLOSE [ # ]
 ##
@@ -1431,11 +1752,13 @@ input: OPEN SET_OPTION UNDERSCORE
 ## OPEN SET_OPTION
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+114
+a set-option command
+an attribute of the form "keyword value?"
 
 input: OPEN UNDERSCORE
 ##
-## Ends in an error in state: 287.
+## Ends in an error in state: 288.
 ##
 ## command -> OPEN . ASSERT term CLOSE [ # ]
 ## command -> OPEN . CHECK_SAT CLOSE [ # ]
@@ -1472,11 +1795,13 @@ input: OPEN UNDERSCORE
 ## OPEN
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+115
+a command
+a command name
 
 input: UNDERSCORE
 ##
-## Ends in an error in state: 286.
+## Ends in an error in state: 287.
 ##
 ## input' -> . input [ # ]
 ##
@@ -1484,11 +1809,13 @@ input: UNDERSCORE
 ##
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+116
+an input statement
+an opening parenthesis to start a command
 
 file: OPEN ASSERT OPEN ATTRIBUTE SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 122.
+## Ends in an error in state: 123.
 ##
 ## term -> OPEN ATTRIBUTE term . nonempty_list(attribute) CLOSE [ SYMBOL STR OPEN NUM KEYWORD HEX DEC CLOSE BIN ]
 ##
@@ -1496,11 +1823,13 @@ file: OPEN ASSERT OPEN ATTRIBUTE SYMBOL UNDERSCORE
 ## OPEN ATTRIBUTE term
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+006
+attributes for a term
+an attribute of the form "keyword value"
 
 file: OPEN ASSERT OPEN ATTRIBUTE UNDERSCORE
 ##
-## Ends in an error in state: 121.
+## Ends in an error in state: 122.
 ##
 ## term -> OPEN ATTRIBUTE . term nonempty_list(attribute) CLOSE [ SYMBOL STR OPEN NUM KEYWORD HEX DEC CLOSE BIN ]
 ##
@@ -1508,11 +1837,13 @@ file: OPEN ASSERT OPEN ATTRIBUTE UNDERSCORE
 ## OPEN ATTRIBUTE
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+007
+a term with attribute
+a term.
 
 file: OPEN ASSERT OPEN EXISTS OPEN OPEN SYMBOL SYMBOL CLOSE CLOSE SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 119.
+## Ends in an error in state: 120.
 ##
 ## term -> OPEN EXISTS OPEN nonempty_list(sorted_var) CLOSE term . CLOSE [ SYMBOL STR OPEN NUM KEYWORD HEX DEC CLOSE BIN ]
 ##
@@ -1520,11 +1851,13 @@ file: OPEN ASSERT OPEN EXISTS OPEN OPEN SYMBOL SYMBOL CLOSE CLOSE SYMBOL UNDERSC
 ## OPEN EXISTS OPEN nonempty_list(sorted_var) CLOSE term
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+008
+a term
+a closing parenthesis to end the existencially quantified formula
 
 file: OPEN ASSERT OPEN EXISTS OPEN OPEN SYMBOL SYMBOL CLOSE CLOSE UNDERSCORE
 ##
-## Ends in an error in state: 118.
+## Ends in an error in state: 119.
 ##
 ## term -> OPEN EXISTS OPEN nonempty_list(sorted_var) CLOSE . term CLOSE [ SYMBOL STR OPEN NUM KEYWORD HEX DEC CLOSE BIN ]
 ##
@@ -1532,11 +1865,13 @@ file: OPEN ASSERT OPEN EXISTS OPEN OPEN SYMBOL SYMBOL CLOSE CLOSE UNDERSCORE
 ## OPEN EXISTS OPEN nonempty_list(sorted_var) CLOSE
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+009
+a term
+a term (body for the existencial quantification)
 
 file: OPEN ASSERT OPEN EXISTS OPEN UNDERSCORE
 ##
-## Ends in an error in state: 116.
+## Ends in an error in state: 117.
 ##
 ## term -> OPEN EXISTS OPEN . nonempty_list(sorted_var) CLOSE term CLOSE [ SYMBOL STR OPEN NUM KEYWORD HEX DEC CLOSE BIN ]
 ##
@@ -1544,11 +1879,13 @@ file: OPEN ASSERT OPEN EXISTS OPEN UNDERSCORE
 ## OPEN EXISTS OPEN
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+010
+a term
+a sorted variable of the form "(var sort)"
 
 file: OPEN ASSERT OPEN EXISTS UNDERSCORE
 ##
-## Ends in an error in state: 115.
+## Ends in an error in state: 116.
 ##
 ## term -> OPEN EXISTS . OPEN nonempty_list(sorted_var) CLOSE term CLOSE [ SYMBOL STR OPEN NUM KEYWORD HEX DEC CLOSE BIN ]
 ##
@@ -1556,11 +1893,13 @@ file: OPEN ASSERT OPEN EXISTS UNDERSCORE
 ## OPEN EXISTS
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+011
+a term
+a list of sorted variables, starting with an opening parenthesis
 
 file: OPEN ASSERT OPEN FORALL OPEN OPEN SYMBOL SYMBOL CLOSE CLOSE SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 113.
+## Ends in an error in state: 114.
 ##
 ## term -> OPEN FORALL OPEN nonempty_list(sorted_var) CLOSE term . CLOSE [ SYMBOL STR OPEN NUM KEYWORD HEX DEC CLOSE BIN ]
 ##
@@ -1568,11 +1907,13 @@ file: OPEN ASSERT OPEN FORALL OPEN OPEN SYMBOL SYMBOL CLOSE CLOSE SYMBOL UNDERSC
 ## OPEN FORALL OPEN nonempty_list(sorted_var) CLOSE term
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+012
+a term
+a closing parenthesis to end the universally quantified formula
 
 file: OPEN ASSERT OPEN FORALL OPEN OPEN SYMBOL SYMBOL CLOSE CLOSE UNDERSCORE
 ##
-## Ends in an error in state: 112.
+## Ends in an error in state: 113.
 ##
 ## term -> OPEN FORALL OPEN nonempty_list(sorted_var) CLOSE . term CLOSE [ SYMBOL STR OPEN NUM KEYWORD HEX DEC CLOSE BIN ]
 ##
@@ -1580,11 +1921,13 @@ file: OPEN ASSERT OPEN FORALL OPEN OPEN SYMBOL SYMBOL CLOSE CLOSE UNDERSCORE
 ## OPEN FORALL OPEN nonempty_list(sorted_var) CLOSE
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+013
+a term
+a term (body for the universal quantification)
 
 file: OPEN ASSERT OPEN FORALL OPEN UNDERSCORE
 ##
-## Ends in an error in state: 104.
+## Ends in an error in state: 105.
 ##
 ## term -> OPEN FORALL OPEN . nonempty_list(sorted_var) CLOSE term CLOSE [ SYMBOL STR OPEN NUM KEYWORD HEX DEC CLOSE BIN ]
 ##
@@ -1592,11 +1935,13 @@ file: OPEN ASSERT OPEN FORALL OPEN UNDERSCORE
 ## OPEN FORALL OPEN
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+018
+a term
+a sorted variable of the form "(var sort)"
 
 file: OPEN ASSERT OPEN FORALL UNDERSCORE
 ##
-## Ends in an error in state: 103.
+## Ends in an error in state: 104.
 ##
 ## term -> OPEN FORALL . OPEN nonempty_list(sorted_var) CLOSE term CLOSE [ SYMBOL STR OPEN NUM KEYWORD HEX DEC CLOSE BIN ]
 ##
@@ -1604,11 +1949,13 @@ file: OPEN ASSERT OPEN FORALL UNDERSCORE
 ## OPEN FORALL
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+019
+a term
+a list of sorted variables, starting with an opening parenthesis
 
 file: OPEN ASSERT OPEN LET OPEN OPEN SYMBOL BIN CLOSE CLOSE SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 101.
+## Ends in an error in state: 102.
 ##
 ## term -> OPEN LET OPEN nonempty_list(var_binding) CLOSE term . CLOSE [ SYMBOL STR OPEN NUM KEYWORD HEX DEC CLOSE BIN ]
 ##
@@ -1616,11 +1963,13 @@ file: OPEN ASSERT OPEN LET OPEN OPEN SYMBOL BIN CLOSE CLOSE SYMBOL UNDERSCORE
 ## OPEN LET OPEN nonempty_list(var_binding) CLOSE term
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+020
+a term
+a closing parenthesis to end the let binding
 
 file: OPEN ASSERT OPEN LET OPEN OPEN SYMBOL BIN CLOSE CLOSE UNDERSCORE
 ##
-## Ends in an error in state: 100.
+## Ends in an error in state: 101.
 ##
 ## term -> OPEN LET OPEN nonempty_list(var_binding) CLOSE . term CLOSE [ SYMBOL STR OPEN NUM KEYWORD HEX DEC CLOSE BIN ]
 ##
@@ -1628,11 +1977,13 @@ file: OPEN ASSERT OPEN LET OPEN OPEN SYMBOL BIN CLOSE CLOSE UNDERSCORE
 ## OPEN LET OPEN nonempty_list(var_binding) CLOSE
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+021
+a term
+a term (body for the let binding)
 
 file: OPEN ASSERT OPEN LET OPEN UNDERSCORE
 ##
-## Ends in an error in state: 92.
+## Ends in an error in state: 93.
 ##
 ## term -> OPEN LET OPEN . nonempty_list(var_binding) CLOSE term CLOSE [ SYMBOL STR OPEN NUM KEYWORD HEX DEC CLOSE BIN ]
 ##
@@ -1640,11 +1991,13 @@ file: OPEN ASSERT OPEN LET OPEN UNDERSCORE
 ## OPEN LET OPEN
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+026
+a term
+a variable binding of the form "(var term)"
 
 file: OPEN ASSERT OPEN LET UNDERSCORE
 ##
-## Ends in an error in state: 91.
+## Ends in an error in state: 92.
 ##
 ## term -> OPEN LET . OPEN nonempty_list(var_binding) CLOSE term CLOSE [ SYMBOL STR OPEN NUM KEYWORD HEX DEC CLOSE BIN ]
 ##
@@ -1652,11 +2005,13 @@ file: OPEN ASSERT OPEN LET UNDERSCORE
 ## OPEN LET
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+027
+a term
+a variable binding list, starting with an opening parenthesis
 
 file: OPEN ASSERT OPEN MATCH SYMBOL OPEN OPEN SYMBOL BIN CLOSE CLOSE UNDERSCORE
 ##
-## Ends in an error in state: 87.
+## Ends in an error in state: 88.
 ##
 ## term -> OPEN MATCH term OPEN nonempty_list(match_case) CLOSE . CLOSE [ SYMBOL STR OPEN NUM KEYWORD HEX DEC CLOSE BIN ]
 ##
@@ -1664,11 +2019,13 @@ file: OPEN ASSERT OPEN MATCH SYMBOL OPEN OPEN SYMBOL BIN CLOSE CLOSE UNDERSCORE
 ## OPEN MATCH term OPEN nonempty_list(match_case) CLOSE
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+031
+a match
+a closing parenthesis to close the match
 
 file: OPEN ASSERT OPEN MATCH SYMBOL OPEN UNDERSCORE
 ##
-## Ends in an error in state: 70.
+## Ends in an error in state: 71.
 ##
 ## term -> OPEN MATCH term OPEN . nonempty_list(match_case) CLOSE CLOSE [ SYMBOL STR OPEN NUM KEYWORD HEX DEC CLOSE BIN ]
 ##
@@ -1676,11 +2033,13 @@ file: OPEN ASSERT OPEN MATCH SYMBOL OPEN UNDERSCORE
 ## OPEN MATCH term OPEN
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+036
+a list of match cases
+a match case of the form "(pattern term)"
 
 file: OPEN ASSERT OPEN MATCH SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 69.
+## Ends in an error in state: 70.
 ##
 ## term -> OPEN MATCH term . OPEN nonempty_list(match_case) CLOSE CLOSE [ SYMBOL STR OPEN NUM KEYWORD HEX DEC CLOSE BIN ]
 ##
@@ -1688,11 +2047,13 @@ file: OPEN ASSERT OPEN MATCH SYMBOL UNDERSCORE
 ## OPEN MATCH term
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+037
+a match
+a match case list, starting with an opening parenthesis
 
 file: OPEN ASSERT OPEN MATCH UNDERSCORE
 ##
-## Ends in an error in state: 68.
+## Ends in an error in state: 69.
 ##
 ## term -> OPEN MATCH . term OPEN nonempty_list(match_case) CLOSE CLOSE [ SYMBOL STR OPEN NUM KEYWORD HEX DEC CLOSE BIN ]
 ##
@@ -1700,7 +2061,9 @@ file: OPEN ASSERT OPEN MATCH UNDERSCORE
 ## OPEN MATCH
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+038
+a match
+a term to match (i.e. the scrutinee of the match)
 
 file: OPEN ASSERT OPEN STR
 ##
@@ -1719,11 +2082,14 @@ file: OPEN ASSERT OPEN STR
 ## OPEN
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+042
+a term
+a term construction (identifier, let binding, quantification, ...);
+note that this expectation if caused by the preceding opening parenthesis
 
 file: OPEN ASSERT OPEN SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 127.
+## Ends in an error in state: 128.
 ##
 ## term -> OPEN qual_identifier . nonempty_list(term) CLOSE [ SYMBOL STR OPEN NUM KEYWORD HEX DEC CLOSE BIN ]
 ##
@@ -1731,11 +2097,15 @@ file: OPEN ASSERT OPEN SYMBOL UNDERSCORE
 ## OPEN qual_identifier
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+044
+a function application
+a term as argument;
+note that keywords and reserved words (such as '_', 'as', ...) are
+not terms, and thus are not allowed here
 
 file: OPEN ASSERT SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 279.
+## Ends in an error in state: 280.
 ##
 ## command -> OPEN ASSERT term . CLOSE [ OPEN EOF ]
 ##
@@ -1743,11 +2113,13 @@ file: OPEN ASSERT SYMBOL UNDERSCORE
 ## OPEN ASSERT term
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+049
+an assertion
+a closing parenthesis
 
 file: OPEN ASSERT UNDERSCORE
 ##
-## Ends in an error in state: 278.
+## Ends in an error in state: 279.
 ##
 ## command -> OPEN ASSERT . term CLOSE [ OPEN EOF ]
 ##
@@ -1755,11 +2127,15 @@ file: OPEN ASSERT UNDERSCORE
 ## OPEN ASSERT
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+048
+a term
+a term construction (symbol, function application, match, let binding, ...);
+note that keywords and reserved words (such as '_', 'as', ...) are
+not symbols, and thus are not allowed here
 
 file: OPEN CHECK_SAT UNDERSCORE
 ##
-## Ends in an error in state: 276.
+## Ends in an error in state: 277.
 ##
 ## command -> OPEN CHECK_SAT . CLOSE [ OPEN EOF ]
 ##
@@ -1767,11 +2143,13 @@ file: OPEN CHECK_SAT UNDERSCORE
 ## OPEN CHECK_SAT
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+050
+a check-sat command
+a closing parenthesis
 
 file: OPEN CHECK_SAT_ASSUMING OPEN CLOSE UNDERSCORE
 ##
-## Ends in an error in state: 274.
+## Ends in an error in state: 275.
 ##
 ## command -> OPEN CHECK_SAT_ASSUMING OPEN list(prop_literal) CLOSE . CLOSE [ OPEN EOF ]
 ##
@@ -1779,11 +2157,13 @@ file: OPEN CHECK_SAT_ASSUMING OPEN CLOSE UNDERSCORE
 ## OPEN CHECK_SAT_ASSUMING OPEN list(prop_literal) CLOSE
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+051
+a check-sat-assuming command
+a closing parenthesis
 
 file: OPEN CHECK_SAT_ASSUMING OPEN OPEN SYMBOL SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 267.
+## Ends in an error in state: 268.
 ##
 ## prop_literal -> OPEN not_symbol prop_symbol . CLOSE [ SYMBOL OPEN CLOSE ]
 ##
@@ -1791,11 +2171,13 @@ file: OPEN CHECK_SAT_ASSUMING OPEN OPEN SYMBOL SYMBOL UNDERSCORE
 ## OPEN not_symbol prop_symbol
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+046
+a propositional literal
+a closing parenthesis
 
 file: OPEN CHECK_SAT_ASSUMING OPEN OPEN SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 266.
+## Ends in an error in state: 267.
 ##
 ## prop_literal -> OPEN not_symbol . prop_symbol CLOSE [ SYMBOL OPEN CLOSE ]
 ##
@@ -1803,11 +2185,13 @@ file: OPEN CHECK_SAT_ASSUMING OPEN OPEN SYMBOL UNDERSCORE
 ## OPEN not_symbol
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+047
+a propositional literal
+a symbol
 
 file: OPEN CHECK_SAT_ASSUMING OPEN OPEN UNDERSCORE
 ##
-## Ends in an error in state: 264.
+## Ends in an error in state: 265.
 ##
 ## prop_literal -> OPEN . not_symbol prop_symbol CLOSE [ SYMBOL OPEN CLOSE ]
 ##
@@ -1815,11 +2199,13 @@ file: OPEN CHECK_SAT_ASSUMING OPEN OPEN UNDERSCORE
 ## OPEN
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+117
+a propositional literal
+the "not" symbol
 
 file: OPEN CHECK_SAT_ASSUMING OPEN SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 271.
+## Ends in an error in state: 272.
 ##
 ## list(prop_literal) -> prop_literal . list(prop_literal) [ CLOSE ]
 ##
@@ -1827,11 +2213,13 @@ file: OPEN CHECK_SAT_ASSUMING OPEN SYMBOL UNDERSCORE
 ## prop_literal
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+119
+a list of propositional literals
+a propositional literal of the form "symbol" or "(not symbol)"
 
 file: OPEN CHECK_SAT_ASSUMING OPEN UNDERSCORE
 ##
-## Ends in an error in state: 263.
+## Ends in an error in state: 264.
 ##
 ## command -> OPEN CHECK_SAT_ASSUMING OPEN . list(prop_literal) CLOSE CLOSE [ OPEN EOF ]
 ##
@@ -1839,11 +2227,13 @@ file: OPEN CHECK_SAT_ASSUMING OPEN UNDERSCORE
 ## OPEN CHECK_SAT_ASSUMING OPEN
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+052
+a list of propositional literals
+a propositional literal, i.e. either a symbol or the negation of a symbol
 
 file: OPEN CHECK_SAT_ASSUMING UNDERSCORE
 ##
-## Ends in an error in state: 262.
+## Ends in an error in state: 263.
 ##
 ## command -> OPEN CHECK_SAT_ASSUMING . OPEN list(prop_literal) CLOSE CLOSE [ OPEN EOF ]
 ##
@@ -1851,11 +2241,13 @@ file: OPEN CHECK_SAT_ASSUMING UNDERSCORE
 ## OPEN CHECK_SAT_ASSUMING
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+053
+a check-sat-assuming command
+a list of propositional literals, starting with an opening parenthesis
 
 file: OPEN DECLARE_CONST SYMBOL OPEN STR
 ##
-## Ends in an error in state: 59.
+## Ends in an error in state: 60.
 ##
 ## identifier -> OPEN . UNDERSCORE SYMBOL nonempty_list(index) CLOSE [ SYMBOL STR OPEN NUM HEX DEC CLOSE BIN ]
 ## sort -> OPEN . identifier nonempty_list(sort) CLOSE [ SYMBOL STR OPEN NUM HEX DEC CLOSE BIN ]
@@ -1864,11 +2256,14 @@ file: OPEN DECLARE_CONST SYMBOL OPEN STR
 ## OPEN
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+120
+a sort
+an identifier to make a sort function application (such as "f x y"),
+or an underscore to start an indexed identifier
 
 file: OPEN DECLARE_CONST SYMBOL OPEN SYMBOL SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 61.
+## Ends in an error in state: 62.
 ##
 ## nonempty_list(sort) -> sort . [ CLOSE ]
 ## nonempty_list(sort) -> sort . nonempty_list(sort) [ CLOSE ]
@@ -1877,11 +2272,13 @@ file: OPEN DECLARE_CONST SYMBOL OPEN SYMBOL SYMBOL UNDERSCORE
 ## sort
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+121
+a list of sorts
+a sort, or a closing parenthesis
 
 file: OPEN DECLARE_CONST SYMBOL OPEN SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 60.
+## Ends in an error in state: 61.
 ##
 ## sort -> OPEN identifier . nonempty_list(sort) CLOSE [ SYMBOL STR OPEN NUM HEX DEC CLOSE BIN ]
 ##
@@ -1889,11 +2286,13 @@ file: OPEN DECLARE_CONST SYMBOL OPEN SYMBOL UNDERSCORE
 ## OPEN identifier
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+122
+a sort
+a sort to start a non-empty list of arguments
 
 file: OPEN DECLARE_CONST SYMBOL SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 260.
+## Ends in an error in state: 261.
 ##
 ## command -> OPEN DECLARE_CONST SYMBOL sort . CLOSE [ OPEN EOF ]
 ##
@@ -1901,11 +2300,13 @@ file: OPEN DECLARE_CONST SYMBOL SYMBOL UNDERSCORE
 ## OPEN DECLARE_CONST SYMBOL sort
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+054
+a constant declaration
+a closing parenthesis
 
 file: OPEN DECLARE_CONST SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 259.
+## Ends in an error in state: 260.
 ##
 ## command -> OPEN DECLARE_CONST SYMBOL . sort CLOSE [ OPEN EOF ]
 ##
@@ -1913,11 +2314,13 @@ file: OPEN DECLARE_CONST SYMBOL UNDERSCORE
 ## OPEN DECLARE_CONST SYMBOL
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+055
+a constant declaration
+a sort
 
 file: OPEN DECLARE_CONST UNDERSCORE
 ##
-## Ends in an error in state: 258.
+## Ends in an error in state: 259.
 ##
 ## command -> OPEN DECLARE_CONST . SYMBOL sort CLOSE [ OPEN EOF ]
 ##
@@ -1925,11 +2328,15 @@ file: OPEN DECLARE_CONST UNDERSCORE
 ## OPEN DECLARE_CONST
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+056
+a constant declaration
+a symbol;
+note that keywords and reserved words (such as '_', 'as', ...) are not
+symbols, and thus are not allowed here
 
 file: OPEN DECLARE_DATATYPE SYMBOL OPEN OPEN SYMBOL CLOSE CLOSE UNDERSCORE
 ##
-## Ends in an error in state: 256.
+## Ends in an error in state: 257.
 ##
 ## command -> OPEN DECLARE_DATATYPE SYMBOL datatype_dec . CLOSE [ OPEN EOF ]
 ##
@@ -1937,11 +2344,13 @@ file: OPEN DECLARE_DATATYPE SYMBOL OPEN OPEN SYMBOL CLOSE CLOSE UNDERSCORE
 ## OPEN DECLARE_DATATYPE SYMBOL datatype_dec
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+057
+a datatype declaration
+a closing parenthesis
 
 file: OPEN DECLARE_DATATYPE SYMBOL OPEN OPEN SYMBOL CLOSE UNDERSCORE
 ##
-## Ends in an error in state: 243.
+## Ends in an error in state: 244.
 ##
 ## nonempty_list(constructor_dec) -> constructor_dec . [ CLOSE ]
 ## nonempty_list(constructor_dec) -> constructor_dec . nonempty_list(constructor_dec) [ CLOSE ]
@@ -1950,11 +2359,14 @@ file: OPEN DECLARE_DATATYPE SYMBOL OPEN OPEN SYMBOL CLOSE UNDERSCORE
 ## constructor_dec
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+123
+a list of constructor declarations
+another constructor declaration of the form "(constructor selectors*)",
+or a closing parenthesis
 
 file: OPEN DECLARE_DATATYPE SYMBOL OPEN OPEN SYMBOL OPEN SYMBOL SYMBOL CLOSE UNDERSCORE
 ##
-## Ends in an error in state: 236.
+## Ends in an error in state: 237.
 ##
 ## list(selector_dec) -> selector_dec . list(selector_dec) [ CLOSE ]
 ##
@@ -1962,11 +2374,13 @@ file: OPEN DECLARE_DATATYPE SYMBOL OPEN OPEN SYMBOL OPEN SYMBOL SYMBOL CLOSE UND
 ## selector_dec
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+124
+a list of selectors
+another selector of the form "(selector sort)", or a closing parenthesis
 
 file: OPEN DECLARE_DATATYPE SYMBOL OPEN OPEN SYMBOL OPEN SYMBOL SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 234.
+## Ends in an error in state: 235.
 ##
 ## selector_dec -> OPEN SYMBOL sort . CLOSE [ OPEN CLOSE ]
 ##
@@ -1974,11 +2388,13 @@ file: OPEN DECLARE_DATATYPE SYMBOL OPEN OPEN SYMBOL OPEN SYMBOL SYMBOL UNDERSCOR
 ## OPEN SYMBOL sort
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+125
+a selector declaration
+a closing parenthesis
 
 file: OPEN DECLARE_DATATYPE SYMBOL OPEN OPEN SYMBOL OPEN SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 233.
+## Ends in an error in state: 234.
 ##
 ## selector_dec -> OPEN SYMBOL . sort CLOSE [ OPEN CLOSE ]
 ##
@@ -1986,11 +2402,13 @@ file: OPEN DECLARE_DATATYPE SYMBOL OPEN OPEN SYMBOL OPEN SYMBOL UNDERSCORE
 ## OPEN SYMBOL
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+126
+a selector declaration
+a sort for the return type of the selector
 
 file: OPEN DECLARE_DATATYPE SYMBOL OPEN OPEN SYMBOL OPEN UNDERSCORE
 ##
-## Ends in an error in state: 232.
+## Ends in an error in state: 233.
 ##
 ## selector_dec -> OPEN . SYMBOL sort CLOSE [ OPEN CLOSE ]
 ##
@@ -1998,11 +2416,13 @@ file: OPEN DECLARE_DATATYPE SYMBOL OPEN OPEN SYMBOL OPEN UNDERSCORE
 ## OPEN
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+127
+a selector declaration
+a symbol for the selector name
 
 file: OPEN DECLARE_DATATYPE SYMBOL OPEN OPEN SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 231.
+## Ends in an error in state: 232.
 ##
 ## constructor_dec -> OPEN SYMBOL . list(selector_dec) CLOSE [ OPEN CLOSE ]
 ##
@@ -2010,11 +2430,13 @@ file: OPEN DECLARE_DATATYPE SYMBOL OPEN OPEN SYMBOL UNDERSCORE
 ## OPEN SYMBOL
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+128
+a constructor declaration
+a selector declaration, of the form "(selector sort)", or a closing parenthesis
 
 file: OPEN DECLARE_DATATYPE SYMBOL OPEN OPEN UNDERSCORE
 ##
-## Ends in an error in state: 230.
+## Ends in an error in state: 231.
 ##
 ## constructor_dec -> OPEN . SYMBOL list(selector_dec) CLOSE [ OPEN CLOSE ]
 ##
@@ -2022,11 +2444,13 @@ file: OPEN DECLARE_DATATYPE SYMBOL OPEN OPEN UNDERSCORE
 ## OPEN
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+129
+a constructor declaration
+a symbol for the constructor name
 
 file: OPEN DECLARE_DATATYPE SYMBOL OPEN PAR OPEN SYMBOL CLOSE OPEN OPEN SYMBOL CLOSE CLOSE UNDERSCORE
 ##
-## Ends in an error in state: 241.
+## Ends in an error in state: 242.
 ##
 ## datatype_dec -> OPEN PAR OPEN nonempty_list(datatype_symbol) CLOSE OPEN nonempty_list(constructor_dec) CLOSE . CLOSE [ OPEN CLOSE ]
 ##
@@ -2034,11 +2458,13 @@ file: OPEN DECLARE_DATATYPE SYMBOL OPEN PAR OPEN SYMBOL CLOSE OPEN OPEN SYMBOL C
 ## OPEN PAR OPEN nonempty_list(datatype_symbol) CLOSE OPEN nonempty_list(constructor_dec) CLOSE
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+130
+a datatype declaration
+a closing parenthesis
 
 file: OPEN DECLARE_DATATYPE SYMBOL OPEN PAR OPEN SYMBOL CLOSE OPEN UNDERSCORE
 ##
-## Ends in an error in state: 229.
+## Ends in an error in state: 230.
 ##
 ## datatype_dec -> OPEN PAR OPEN nonempty_list(datatype_symbol) CLOSE OPEN . nonempty_list(constructor_dec) CLOSE CLOSE [ OPEN CLOSE ]
 ##
@@ -2046,11 +2472,13 @@ file: OPEN DECLARE_DATATYPE SYMBOL OPEN PAR OPEN SYMBOL CLOSE OPEN UNDERSCORE
 ## OPEN PAR OPEN nonempty_list(datatype_symbol) CLOSE OPEN
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+131
+a datatype declaration
+a constructor declaration of the form "(symbol selector*)"
 
 file: OPEN DECLARE_DATATYPE SYMBOL OPEN PAR OPEN SYMBOL CLOSE UNDERSCORE
 ##
-## Ends in an error in state: 228.
+## Ends in an error in state: 229.
 ##
 ## datatype_dec -> OPEN PAR OPEN nonempty_list(datatype_symbol) CLOSE . OPEN nonempty_list(constructor_dec) CLOSE CLOSE [ OPEN CLOSE ]
 ##
@@ -2058,11 +2486,13 @@ file: OPEN DECLARE_DATATYPE SYMBOL OPEN PAR OPEN SYMBOL CLOSE UNDERSCORE
 ## OPEN PAR OPEN nonempty_list(datatype_symbol) CLOSE
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+132
+a datatype declaration
+an opening parenthesis to start the list of constructors
 
 file: OPEN DECLARE_DATATYPE SYMBOL OPEN PAR OPEN SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 245.
+## Ends in an error in state: 246.
 ##
 ## nonempty_list(datatype_symbol) -> datatype_symbol . [ CLOSE ]
 ## nonempty_list(datatype_symbol) -> datatype_symbol . nonempty_list(datatype_symbol) [ CLOSE ]
@@ -2071,11 +2501,13 @@ file: OPEN DECLARE_DATATYPE SYMBOL OPEN PAR OPEN SYMBOL UNDERSCORE
 ## datatype_symbol
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+133
+a list of sort variables to parameterize a datatype
+another symbol, or a closing parenthesis
 
 file: OPEN DECLARE_DATATYPE SYMBOL OPEN PAR OPEN UNDERSCORE
 ##
-## Ends in an error in state: 225.
+## Ends in an error in state: 226.
 ##
 ## datatype_dec -> OPEN PAR OPEN . nonempty_list(datatype_symbol) CLOSE OPEN nonempty_list(constructor_dec) CLOSE CLOSE [ OPEN CLOSE ]
 ##
@@ -2083,11 +2515,13 @@ file: OPEN DECLARE_DATATYPE SYMBOL OPEN PAR OPEN UNDERSCORE
 ## OPEN PAR OPEN
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+134
+a list of sort variables to parameterize a datatype
+a symbol
 
 file: OPEN DECLARE_DATATYPE SYMBOL OPEN PAR UNDERSCORE
 ##
-## Ends in an error in state: 224.
+## Ends in an error in state: 225.
 ##
 ## datatype_dec -> OPEN PAR . OPEN nonempty_list(datatype_symbol) CLOSE OPEN nonempty_list(constructor_dec) CLOSE CLOSE [ OPEN CLOSE ]
 ##
@@ -2095,11 +2529,13 @@ file: OPEN DECLARE_DATATYPE SYMBOL OPEN PAR UNDERSCORE
 ## OPEN PAR
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+135
+a datatype declaration
+an opening parenthesis to start a list of sort parameters for the datatype
 
 file: OPEN DECLARE_DATATYPE SYMBOL OPEN UNDERSCORE
 ##
-## Ends in an error in state: 223.
+## Ends in an error in state: 224.
 ##
 ## datatype_dec -> OPEN . nonempty_list(constructor_dec) CLOSE [ OPEN CLOSE ]
 ## datatype_dec -> OPEN . PAR OPEN nonempty_list(datatype_symbol) CLOSE OPEN nonempty_list(constructor_dec) CLOSE CLOSE [ OPEN CLOSE ]
@@ -2108,11 +2544,14 @@ file: OPEN DECLARE_DATATYPE SYMBOL OPEN UNDERSCORE
 ## OPEN
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+136
+a datatype declaration
+a list of constructor declarations of the form "(symbol selector*)",
+or a parameterization of the datatype of the form "par (sort+)"
 
 file: OPEN DECLARE_DATATYPE SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 255.
+## Ends in an error in state: 256.
 ##
 ## command -> OPEN DECLARE_DATATYPE SYMBOL . datatype_dec CLOSE [ OPEN EOF ]
 ##
@@ -2120,11 +2559,13 @@ file: OPEN DECLARE_DATATYPE SYMBOL UNDERSCORE
 ## OPEN DECLARE_DATATYPE SYMBOL
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+058
+a datatype declaration
+an opening parenthesis to start the datatype declaration
 
 file: OPEN DECLARE_DATATYPE UNDERSCORE
 ##
-## Ends in an error in state: 254.
+## Ends in an error in state: 255.
 ##
 ## command -> OPEN DECLARE_DATATYPE . SYMBOL datatype_dec CLOSE [ OPEN EOF ]
 ##
@@ -2132,11 +2573,13 @@ file: OPEN DECLARE_DATATYPE UNDERSCORE
 ## OPEN DECLARE_DATATYPE
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+059
+a datatype declaration
+a symbol
 
 file: OPEN DECLARE_DATATYPES OPEN OPEN SYMBOL NUM CLOSE CLOSE OPEN OPEN OPEN SYMBOL CLOSE CLOSE CLOSE UNDERSCORE
 ##
-## Ends in an error in state: 250.
+## Ends in an error in state: 251.
 ##
 ## command -> OPEN DECLARE_DATATYPES OPEN nonempty_list(sort_dec) CLOSE OPEN nonempty_list(datatype_dec) CLOSE . CLOSE [ OPEN EOF ]
 ##
@@ -2144,11 +2587,13 @@ file: OPEN DECLARE_DATATYPES OPEN OPEN SYMBOL NUM CLOSE CLOSE OPEN OPEN OPEN SYM
 ## OPEN DECLARE_DATATYPES OPEN nonempty_list(sort_dec) CLOSE OPEN nonempty_list(datatype_dec) CLOSE
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+060
+a datatypes declaration
+a closing parenthesis
 
 file: OPEN DECLARE_DATATYPES OPEN OPEN SYMBOL NUM CLOSE CLOSE OPEN OPEN OPEN SYMBOL CLOSE CLOSE UNDERSCORE
 ##
-## Ends in an error in state: 252.
+## Ends in an error in state: 253.
 ##
 ## nonempty_list(datatype_dec) -> datatype_dec . [ CLOSE ]
 ## nonempty_list(datatype_dec) -> datatype_dec . nonempty_list(datatype_dec) [ CLOSE ]
@@ -2157,11 +2602,13 @@ file: OPEN DECLARE_DATATYPES OPEN OPEN SYMBOL NUM CLOSE CLOSE OPEN OPEN OPEN SYM
 ## datatype_dec
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+137
+a list of datatype declarations
+another datatype declaration, or a closing parenthesis
 
 file: OPEN DECLARE_DATATYPES OPEN OPEN SYMBOL NUM CLOSE CLOSE OPEN UNDERSCORE
 ##
-## Ends in an error in state: 222.
+## Ends in an error in state: 223.
 ##
 ## command -> OPEN DECLARE_DATATYPES OPEN nonempty_list(sort_dec) CLOSE OPEN . nonempty_list(datatype_dec) CLOSE CLOSE [ OPEN EOF ]
 ##
@@ -2169,11 +2616,13 @@ file: OPEN DECLARE_DATATYPES OPEN OPEN SYMBOL NUM CLOSE CLOSE OPEN UNDERSCORE
 ## OPEN DECLARE_DATATYPES OPEN nonempty_list(sort_dec) CLOSE OPEN
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+061
+a datatypes definition
+an opening parenthesis to start a list of constructors for the first defined datatype
 
 file: OPEN DECLARE_DATATYPES OPEN OPEN SYMBOL NUM CLOSE CLOSE UNDERSCORE
 ##
-## Ends in an error in state: 221.
+## Ends in an error in state: 222.
 ##
 ## command -> OPEN DECLARE_DATATYPES OPEN nonempty_list(sort_dec) CLOSE . OPEN nonempty_list(datatype_dec) CLOSE CLOSE [ OPEN EOF ]
 ##
@@ -2181,11 +2630,14 @@ file: OPEN DECLARE_DATATYPES OPEN OPEN SYMBOL NUM CLOSE CLOSE UNDERSCORE
 ## OPEN DECLARE_DATATYPES OPEN nonempty_list(sort_dec) CLOSE
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+062
+a datatypes declaration
+an opening parenthesis to start a list of datatype definitions,
+one for each of the sorts being declared
 
 file: OPEN DECLARE_DATATYPES OPEN OPEN SYMBOL NUM CLOSE UNDERSCORE
 ##
-## Ends in an error in state: 218.
+## Ends in an error in state: 219.
 ##
 ## nonempty_list(sort_dec) -> sort_dec . [ CLOSE ]
 ## nonempty_list(sort_dec) -> sort_dec . nonempty_list(sort_dec) [ CLOSE ]
@@ -2194,11 +2646,13 @@ file: OPEN DECLARE_DATATYPES OPEN OPEN SYMBOL NUM CLOSE UNDERSCORE
 ## sort_dec
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+138
+a list of datatype arity declarations
+another datatype arity declaration, or a closing parenthesis
 
 file: OPEN DECLARE_DATATYPES OPEN OPEN SYMBOL NUM UNDERSCORE
 ##
-## Ends in an error in state: 216.
+## Ends in an error in state: 217.
 ##
 ## sort_dec -> OPEN SYMBOL NUM . CLOSE [ OPEN CLOSE ]
 ##
@@ -2206,11 +2660,13 @@ file: OPEN DECLARE_DATATYPES OPEN OPEN SYMBOL NUM UNDERSCORE
 ## OPEN SYMBOL NUM
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+139
+a datatype arity declaration
+a closing parenthesis
 
 file: OPEN DECLARE_DATATYPES OPEN OPEN SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 215.
+## Ends in an error in state: 216.
 ##
 ## sort_dec -> OPEN SYMBOL . NUM CLOSE [ OPEN CLOSE ]
 ##
@@ -2218,11 +2674,13 @@ file: OPEN DECLARE_DATATYPES OPEN OPEN SYMBOL UNDERSCORE
 ## OPEN SYMBOL
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+140
+a datatype arity declaration
+a numeral for the datatype arity
 
 file: OPEN DECLARE_DATATYPES OPEN OPEN UNDERSCORE
 ##
-## Ends in an error in state: 214.
+## Ends in an error in state: 215.
 ##
 ## sort_dec -> OPEN . SYMBOL NUM CLOSE [ OPEN CLOSE ]
 ##
@@ -2230,11 +2688,13 @@ file: OPEN DECLARE_DATATYPES OPEN OPEN UNDERSCORE
 ## OPEN
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+141
+a datatype arity declaration
+a symbol for the datatype name
 
 file: OPEN DECLARE_DATATYPES OPEN UNDERSCORE
 ##
-## Ends in an error in state: 213.
+## Ends in an error in state: 214.
 ##
 ## command -> OPEN DECLARE_DATATYPES OPEN . nonempty_list(sort_dec) CLOSE OPEN nonempty_list(datatype_dec) CLOSE CLOSE [ OPEN EOF ]
 ##
@@ -2242,11 +2702,13 @@ file: OPEN DECLARE_DATATYPES OPEN UNDERSCORE
 ## OPEN DECLARE_DATATYPES OPEN
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+063
+a datatypes declaration
+a parametric sort declaration of the form "(symbol num)"
 
 file: OPEN DECLARE_DATATYPES UNDERSCORE
 ##
-## Ends in an error in state: 212.
+## Ends in an error in state: 213.
 ##
 ## command -> OPEN DECLARE_DATATYPES . OPEN nonempty_list(sort_dec) CLOSE OPEN nonempty_list(datatype_dec) CLOSE CLOSE [ OPEN EOF ]
 ##
@@ -2254,11 +2716,13 @@ file: OPEN DECLARE_DATATYPES UNDERSCORE
 ## OPEN DECLARE_DATATYPES
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+064
+a datatypes declaration
+a list of sort declaration, starting with an opening parenthesis
 
 file: OPEN DECLARE_FUN SYMBOL OPEN CLOSE SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 210.
+## Ends in an error in state: 211.
 ##
 ## command -> OPEN DECLARE_FUN SYMBOL OPEN list(sort) CLOSE sort . CLOSE [ OPEN EOF ]
 ##
@@ -2266,11 +2730,13 @@ file: OPEN DECLARE_FUN SYMBOL OPEN CLOSE SYMBOL UNDERSCORE
 ## OPEN DECLARE_FUN SYMBOL OPEN list(sort) CLOSE sort
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+065
+a function declaration
+a closing parenthesis
 
 file: OPEN DECLARE_FUN SYMBOL OPEN CLOSE UNDERSCORE
 ##
-## Ends in an error in state: 209.
+## Ends in an error in state: 210.
 ##
 ## command -> OPEN DECLARE_FUN SYMBOL OPEN list(sort) CLOSE . sort CLOSE [ OPEN EOF ]
 ##
@@ -2278,11 +2744,13 @@ file: OPEN DECLARE_FUN SYMBOL OPEN CLOSE UNDERSCORE
 ## OPEN DECLARE_FUN SYMBOL OPEN list(sort) CLOSE
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+066
+a function declaration
+a sort for the return type of the function
 
 file: OPEN DECLARE_FUN SYMBOL OPEN SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 206.
+## Ends in an error in state: 207.
 ##
 ## list(sort) -> sort . list(sort) [ CLOSE ]
 ##
@@ -2290,11 +2758,13 @@ file: OPEN DECLARE_FUN SYMBOL OPEN SYMBOL UNDERSCORE
 ## sort
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+142
+a list of sorts
+another sort or a closing parenthesis
 
 file: OPEN DECLARE_FUN SYMBOL OPEN UNDERSCORE
 ##
-## Ends in an error in state: 205.
+## Ends in an error in state: 206.
 ##
 ## command -> OPEN DECLARE_FUN SYMBOL OPEN . list(sort) CLOSE sort CLOSE [ OPEN EOF ]
 ##
@@ -2302,11 +2772,13 @@ file: OPEN DECLARE_FUN SYMBOL OPEN UNDERSCORE
 ## OPEN DECLARE_FUN SYMBOL OPEN
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+067
+a function declaration
+a closing parenthesis, or a list of sorts for the arguments of the function
 
 file: OPEN DECLARE_FUN SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 204.
+## Ends in an error in state: 205.
 ##
 ## command -> OPEN DECLARE_FUN SYMBOL . OPEN list(sort) CLOSE sort CLOSE [ OPEN EOF ]
 ##
@@ -2314,11 +2786,13 @@ file: OPEN DECLARE_FUN SYMBOL UNDERSCORE
 ## OPEN DECLARE_FUN SYMBOL
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+068
+a function declaration
+an opening parenthesis to start the list of sorts for the function's arguments
 
 file: OPEN DECLARE_FUN UNDERSCORE
 ##
-## Ends in an error in state: 203.
+## Ends in an error in state: 204.
 ##
 ## command -> OPEN DECLARE_FUN . SYMBOL OPEN list(sort) CLOSE sort CLOSE [ OPEN EOF ]
 ##
@@ -2326,11 +2800,13 @@ file: OPEN DECLARE_FUN UNDERSCORE
 ## OPEN DECLARE_FUN
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+069
+a function declaration
+a symbol for the function's name
 
 file: OPEN DECLARE_SORT SYMBOL NUM UNDERSCORE
 ##
-## Ends in an error in state: 201.
+## Ends in an error in state: 202.
 ##
 ## command -> OPEN DECLARE_SORT SYMBOL NUM . CLOSE [ OPEN EOF ]
 ##
@@ -2338,11 +2814,13 @@ file: OPEN DECLARE_SORT SYMBOL NUM UNDERSCORE
 ## OPEN DECLARE_SORT SYMBOL NUM
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+070
+a sort declaration
+a closing parenthesis
 
 file: OPEN DECLARE_SORT SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 200.
+## Ends in an error in state: 201.
 ##
 ## command -> OPEN DECLARE_SORT SYMBOL . NUM CLOSE [ OPEN EOF ]
 ##
@@ -2350,11 +2828,13 @@ file: OPEN DECLARE_SORT SYMBOL UNDERSCORE
 ## OPEN DECLARE_SORT SYMBOL
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+071
+a sort declaration
+a numeral for the arity of the sort being declared
 
 file: OPEN DECLARE_SORT UNDERSCORE
 ##
-## Ends in an error in state: 199.
+## Ends in an error in state: 200.
 ##
 ## command -> OPEN DECLARE_SORT . SYMBOL NUM CLOSE [ OPEN EOF ]
 ##
@@ -2362,11 +2842,13 @@ file: OPEN DECLARE_SORT UNDERSCORE
 ## OPEN DECLARE_SORT
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+072
+a sort declaration
+a symbol for the sort name
 
 file: OPEN DEFINE_FUN SYMBOL OPEN CLOSE SYMBOL SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 197.
+## Ends in an error in state: 198.
 ##
 ## command -> OPEN DEFINE_FUN function_def . CLOSE [ OPEN EOF ]
 ##
@@ -2374,11 +2856,13 @@ file: OPEN DEFINE_FUN SYMBOL OPEN CLOSE SYMBOL SYMBOL UNDERSCORE
 ## OPEN DEFINE_FUN function_def
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+073
+a function definition
+a closing parenthesis
 
 file: OPEN DEFINE_FUN UNDERSCORE
 ##
-## Ends in an error in state: 196.
+## Ends in an error in state: 197.
 ##
 ## command -> OPEN DEFINE_FUN . function_def CLOSE [ OPEN EOF ]
 ##
@@ -2386,11 +2870,13 @@ file: OPEN DEFINE_FUN UNDERSCORE
 ## OPEN DEFINE_FUN
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+074
+a function definition
+a symbol for the function's name
 
 file: OPEN DEFINE_FUNS_REC OPEN OPEN SYMBOL OPEN CLOSE SYMBOL CLOSE CLOSE OPEN SYMBOL CLOSE UNDERSCORE
 ##
-## Ends in an error in state: 192.
+## Ends in an error in state: 193.
 ##
 ## command -> OPEN DEFINE_FUNS_REC OPEN nonempty_list(function_dec) CLOSE OPEN nonempty_list(term) CLOSE . OPEN [ OPEN EOF ]
 ##
@@ -2398,11 +2884,13 @@ file: OPEN DEFINE_FUNS_REC OPEN OPEN SYMBOL OPEN CLOSE SYMBOL CLOSE CLOSE OPEN S
 ## OPEN DEFINE_FUNS_REC OPEN nonempty_list(function_dec) CLOSE OPEN nonempty_list(term) CLOSE
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+075
+a recursive functions definition
+a closing parenthesis
 
 file: OPEN DEFINE_FUNS_REC OPEN OPEN SYMBOL OPEN CLOSE SYMBOL CLOSE CLOSE OPEN UNDERSCORE
 ##
-## Ends in an error in state: 190.
+## Ends in an error in state: 191.
 ##
 ## command -> OPEN DEFINE_FUNS_REC OPEN nonempty_list(function_dec) CLOSE OPEN . nonempty_list(term) CLOSE OPEN [ OPEN EOF ]
 ##
@@ -2410,11 +2898,13 @@ file: OPEN DEFINE_FUNS_REC OPEN OPEN SYMBOL OPEN CLOSE SYMBOL CLOSE CLOSE OPEN U
 ## OPEN DEFINE_FUNS_REC OPEN nonempty_list(function_dec) CLOSE OPEN
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+076
+a recursive functions definition
+a term for the first function's body
 
 file: OPEN DEFINE_FUNS_REC OPEN OPEN SYMBOL OPEN CLOSE SYMBOL CLOSE CLOSE UNDERSCORE
 ##
-## Ends in an error in state: 189.
+## Ends in an error in state: 190.
 ##
 ## command -> OPEN DEFINE_FUNS_REC OPEN nonempty_list(function_dec) CLOSE . OPEN nonempty_list(term) CLOSE OPEN [ OPEN EOF ]
 ##
@@ -2422,11 +2912,13 @@ file: OPEN DEFINE_FUNS_REC OPEN OPEN SYMBOL OPEN CLOSE SYMBOL CLOSE CLOSE UNDERS
 ## OPEN DEFINE_FUNS_REC OPEN nonempty_list(function_dec) CLOSE
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+077
+a recursive functions definition
+an opening parenthesis to start a list the function's bodies
 
 file: OPEN DEFINE_FUNS_REC OPEN OPEN SYMBOL OPEN CLOSE SYMBOL CLOSE UNDERSCORE
 ##
-## Ends in an error in state: 194.
+## Ends in an error in state: 195.
 ##
 ## nonempty_list(function_dec) -> function_dec . [ CLOSE ]
 ## nonempty_list(function_dec) -> function_dec . nonempty_list(function_dec) [ CLOSE ]
@@ -2435,11 +2927,13 @@ file: OPEN DEFINE_FUNS_REC OPEN OPEN SYMBOL OPEN CLOSE SYMBOL CLOSE UNDERSCORE
 ## function_dec
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+143
+a list of function declarations
+another function declaration, or a closing parenthesis
 
 file: OPEN DEFINE_FUNS_REC OPEN OPEN SYMBOL OPEN CLOSE SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 186.
+## Ends in an error in state: 187.
 ##
 ## function_dec -> OPEN SYMBOL OPEN list(sorted_var) CLOSE sort . CLOSE [ OPEN CLOSE ]
 ##
@@ -2447,11 +2941,13 @@ file: OPEN DEFINE_FUNS_REC OPEN OPEN SYMBOL OPEN CLOSE SYMBOL UNDERSCORE
 ## OPEN SYMBOL OPEN list(sorted_var) CLOSE sort
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+144
+a function declaration
+a closing parenthesis
 
 file: OPEN DEFINE_FUNS_REC OPEN OPEN SYMBOL OPEN CLOSE UNDERSCORE
 ##
-## Ends in an error in state: 185.
+## Ends in an error in state: 186.
 ##
 ## function_dec -> OPEN SYMBOL OPEN list(sorted_var) CLOSE . sort CLOSE [ OPEN CLOSE ]
 ##
@@ -2459,11 +2955,13 @@ file: OPEN DEFINE_FUNS_REC OPEN OPEN SYMBOL OPEN CLOSE UNDERSCORE
 ## OPEN SYMBOL OPEN list(sorted_var) CLOSE
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+145
+a function declaration
+a sort for the return type of the function
 
 file: OPEN DEFINE_FUNS_REC OPEN OPEN SYMBOL OPEN UNDERSCORE
 ##
-## Ends in an error in state: 183.
+## Ends in an error in state: 184.
 ##
 ## function_dec -> OPEN SYMBOL OPEN . list(sorted_var) CLOSE sort CLOSE [ OPEN CLOSE ]
 ##
@@ -2471,11 +2969,13 @@ file: OPEN DEFINE_FUNS_REC OPEN OPEN SYMBOL OPEN UNDERSCORE
 ## OPEN SYMBOL OPEN
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+146
+a function declaration
+either a sort for the first argument type, or a closing parenthesis
 
 file: OPEN DEFINE_FUNS_REC OPEN OPEN SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 182.
+## Ends in an error in state: 183.
 ##
 ## function_dec -> OPEN SYMBOL . OPEN list(sorted_var) CLOSE sort CLOSE [ OPEN CLOSE ]
 ##
@@ -2483,11 +2983,13 @@ file: OPEN DEFINE_FUNS_REC OPEN OPEN SYMBOL UNDERSCORE
 ## OPEN SYMBOL
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+147
+a function declaration
+an opening parenthesis to start the list of arguments sorts
 
 file: OPEN DEFINE_FUNS_REC OPEN OPEN UNDERSCORE
 ##
-## Ends in an error in state: 181.
+## Ends in an error in state: 182.
 ##
 ## function_dec -> OPEN . SYMBOL OPEN list(sorted_var) CLOSE sort CLOSE [ OPEN CLOSE ]
 ##
@@ -2495,11 +2997,13 @@ file: OPEN DEFINE_FUNS_REC OPEN OPEN UNDERSCORE
 ## OPEN
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+148
+a function declaration
+a symbol for the function name
 
 file: OPEN DEFINE_FUNS_REC OPEN UNDERSCORE
 ##
-## Ends in an error in state: 180.
+## Ends in an error in state: 181.
 ##
 ## command -> OPEN DEFINE_FUNS_REC OPEN . nonempty_list(function_dec) CLOSE OPEN nonempty_list(term) CLOSE OPEN [ OPEN EOF ]
 ##
@@ -2507,11 +3011,13 @@ file: OPEN DEFINE_FUNS_REC OPEN UNDERSCORE
 ## OPEN DEFINE_FUNS_REC OPEN
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+078
+a recursive functions definition
+a function declaration of the form "(name (sort*) sort)"
 
 file: OPEN DEFINE_FUNS_REC UNDERSCORE
 ##
-## Ends in an error in state: 179.
+## Ends in an error in state: 180.
 ##
 ## command -> OPEN DEFINE_FUNS_REC . OPEN nonempty_list(function_dec) CLOSE OPEN nonempty_list(term) CLOSE OPEN [ OPEN EOF ]
 ##
@@ -2519,11 +3025,13 @@ file: OPEN DEFINE_FUNS_REC UNDERSCORE
 ## OPEN DEFINE_FUNS_REC
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+079
+a recursive functions declaration
+an opening parenthesis to start a list of function declaration
 
 file: OPEN DEFINE_FUN_REC SYMBOL OPEN CLOSE SYMBOL SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 177.
+## Ends in an error in state: 178.
 ##
 ## command -> OPEN DEFINE_FUN_REC function_def . CLOSE [ OPEN EOF ]
 ##
@@ -2531,11 +3039,13 @@ file: OPEN DEFINE_FUN_REC SYMBOL OPEN CLOSE SYMBOL SYMBOL UNDERSCORE
 ## OPEN DEFINE_FUN_REC function_def
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+080
+a recursive function definition
+a closing parenthesis
 
 file: OPEN DEFINE_FUN_REC SYMBOL OPEN CLOSE SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 175.
+## Ends in an error in state: 176.
 ##
 ## function_def -> SYMBOL OPEN list(sorted_var) CLOSE sort . term [ CLOSE ]
 ##
@@ -2543,11 +3053,13 @@ file: OPEN DEFINE_FUN_REC SYMBOL OPEN CLOSE SYMBOL UNDERSCORE
 ## SYMBOL OPEN list(sorted_var) CLOSE sort
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+149
+a function definition
+a term for the body of the function
 
 file: OPEN DEFINE_FUN_REC SYMBOL OPEN CLOSE UNDERSCORE
 ##
-## Ends in an error in state: 174.
+## Ends in an error in state: 175.
 ##
 ## function_def -> SYMBOL OPEN list(sorted_var) CLOSE . sort term [ CLOSE ]
 ##
@@ -2555,11 +3067,13 @@ file: OPEN DEFINE_FUN_REC SYMBOL OPEN CLOSE UNDERSCORE
 ## SYMBOL OPEN list(sorted_var) CLOSE
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+150
+a function definition
+a sort for the return type of the function
 
 file: OPEN DEFINE_FUN_REC SYMBOL OPEN OPEN SYMBOL SYMBOL CLOSE UNDERSCORE
 ##
-## Ends in an error in state: 171.
+## Ends in an error in state: 172.
 ##
 ## list(sorted_var) -> sorted_var . list(sorted_var) [ CLOSE ]
 ##
@@ -2567,11 +3081,13 @@ file: OPEN DEFINE_FUN_REC SYMBOL OPEN OPEN SYMBOL SYMBOL CLOSE UNDERSCORE
 ## sorted_var
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+151
+a list of sorted variables
+another sorted variable of the form "(var sort)", or a closing parenthesis
 
 file: OPEN DEFINE_FUN_REC SYMBOL OPEN UNDERSCORE
 ##
-## Ends in an error in state: 170.
+## Ends in an error in state: 171.
 ##
 ## function_def -> SYMBOL OPEN . list(sorted_var) CLOSE sort term [ CLOSE ]
 ##
@@ -2579,11 +3095,13 @@ file: OPEN DEFINE_FUN_REC SYMBOL OPEN UNDERSCORE
 ## SYMBOL OPEN
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+152
+a function definition
+a sorted variable of the form "(var sort)", or a closing parenthesis
 
 file: OPEN DEFINE_FUN_REC SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 169.
+## Ends in an error in state: 170.
 ##
 ## function_def -> SYMBOL . OPEN list(sorted_var) CLOSE sort term [ CLOSE ]
 ##
@@ -2591,11 +3109,13 @@ file: OPEN DEFINE_FUN_REC SYMBOL UNDERSCORE
 ## SYMBOL
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+153
+a function definition
+an opening parenthesis to start the list of arguments
 
 file: OPEN DEFINE_FUN_REC UNDERSCORE
 ##
-## Ends in an error in state: 168.
+## Ends in an error in state: 169.
 ##
 ## command -> OPEN DEFINE_FUN_REC . function_def CLOSE [ OPEN EOF ]
 ##
@@ -2603,11 +3123,13 @@ file: OPEN DEFINE_FUN_REC UNDERSCORE
 ## OPEN DEFINE_FUN_REC
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+081
+a recursive function definition
+a symbol for the function's name
 
 file: OPEN DEFINE_SORT SYMBOL OPEN CLOSE SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 166.
+## Ends in an error in state: 167.
 ##
 ## command -> OPEN DEFINE_SORT SYMBOL OPEN list(SYMBOL) CLOSE sort . CLOSE [ OPEN EOF ]
 ##
@@ -2615,11 +3137,13 @@ file: OPEN DEFINE_SORT SYMBOL OPEN CLOSE SYMBOL UNDERSCORE
 ## OPEN DEFINE_SORT SYMBOL OPEN list(SYMBOL) CLOSE sort
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+082
+a sort definition
+a closing parenthesis
 
 file: OPEN DEFINE_SORT SYMBOL OPEN CLOSE UNDERSCORE
 ##
-## Ends in an error in state: 165.
+## Ends in an error in state: 166.
 ##
 ## command -> OPEN DEFINE_SORT SYMBOL OPEN list(SYMBOL) CLOSE . sort CLOSE [ OPEN EOF ]
 ##
@@ -2627,11 +3151,13 @@ file: OPEN DEFINE_SORT SYMBOL OPEN CLOSE UNDERSCORE
 ## OPEN DEFINE_SORT SYMBOL OPEN list(SYMBOL) CLOSE
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+083
+a sort definition
+a sort for the definition body
 
 file: OPEN DEFINE_SORT SYMBOL OPEN SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 162.
+## Ends in an error in state: 163.
 ##
 ## list(SYMBOL) -> SYMBOL . list(SYMBOL) [ CLOSE ]
 ##
@@ -2639,11 +3165,13 @@ file: OPEN DEFINE_SORT SYMBOL OPEN SYMBOL UNDERSCORE
 ## SYMBOL
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+154
+a list of symbols
+another symbol or a closing parenthesis
 
 file: OPEN DEFINE_SORT SYMBOL OPEN UNDERSCORE
 ##
-## Ends in an error in state: 161.
+## Ends in an error in state: 162.
 ##
 ## command -> OPEN DEFINE_SORT SYMBOL OPEN . list(SYMBOL) CLOSE sort CLOSE [ OPEN EOF ]
 ##
@@ -2651,11 +3179,13 @@ file: OPEN DEFINE_SORT SYMBOL OPEN UNDERSCORE
 ## OPEN DEFINE_SORT SYMBOL OPEN
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+084
+a sort definition
+a closing parenthesis, or a list of symbols for the definition arguments
 
 file: OPEN DEFINE_SORT SYMBOL UNDERSCORE
 ##
-## Ends in an error in state: 160.
+## Ends in an error in state: 161.
 ##
 ## command -> OPEN DEFINE_SORT SYMBOL . OPEN list(SYMBOL) CLOSE sort CLOSE [ OPEN EOF ]
 ##
@@ -2663,11 +3193,13 @@ file: OPEN DEFINE_SORT SYMBOL UNDERSCORE
 ## OPEN DEFINE_SORT SYMBOL
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+085
+a sort definition
+an opening parenthesis to start a list of arguments
 
 file: OPEN DEFINE_SORT UNDERSCORE
 ##
-## Ends in an error in state: 159.
+## Ends in an error in state: 160.
 ##
 ## command -> OPEN DEFINE_SORT . SYMBOL OPEN list(SYMBOL) CLOSE sort CLOSE [ OPEN EOF ]
 ##
@@ -2675,11 +3207,13 @@ file: OPEN DEFINE_SORT UNDERSCORE
 ## OPEN DEFINE_SORT
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+086
+a sort definition
+a symbol for the defined sort's name
 
 file: OPEN ECHO STR UNDERSCORE
 ##
-## Ends in an error in state: 157.
+## Ends in an error in state: 158.
 ##
 ## command -> OPEN ECHO STR . CLOSE [ OPEN EOF ]
 ##
@@ -2687,11 +3221,13 @@ file: OPEN ECHO STR UNDERSCORE
 ## OPEN ECHO STR
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+087
+an echo command
+a closing parenthesis
 
 file: OPEN ECHO UNDERSCORE
 ##
-## Ends in an error in state: 156.
+## Ends in an error in state: 157.
 ##
 ## command -> OPEN ECHO . STR CLOSE [ OPEN EOF ]
 ##
@@ -2699,11 +3235,13 @@ file: OPEN ECHO UNDERSCORE
 ## OPEN ECHO
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+088
+an echo command
+a string literal
 
 file: OPEN EXIT UNDERSCORE
 ##
-## Ends in an error in state: 154.
+## Ends in an error in state: 155.
 ##
 ## command -> OPEN EXIT . CLOSE [ OPEN EOF ]
 ##
@@ -2711,11 +3249,13 @@ file: OPEN EXIT UNDERSCORE
 ## OPEN EXIT
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+089
+an exit command
+a closing parenthesis
 
 file: OPEN GET_ASSERTIONS UNDERSCORE
 ##
-## Ends in an error in state: 152.
+## Ends in an error in state: 153.
 ##
 ## command -> OPEN GET_ASSERTIONS . CLOSE [ OPEN EOF ]
 ##
@@ -2723,11 +3263,13 @@ file: OPEN GET_ASSERTIONS UNDERSCORE
 ## OPEN GET_ASSERTIONS
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+090
+a get-assertions command
+a closing parenthesis
 
 file: OPEN GET_ASSIGNMENT UNDERSCORE
 ##
-## Ends in an error in state: 150.
+## Ends in an error in state: 151.
 ##
 ## command -> OPEN GET_ASSIGNMENT . CLOSE [ OPEN EOF ]
 ##
@@ -2735,11 +3277,13 @@ file: OPEN GET_ASSIGNMENT UNDERSCORE
 ## OPEN GET_ASSIGNMENT
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+091
+a get-assignment command
+a closing parenthesis
 
 file: OPEN GET_INFO KEYWORD UNDERSCORE
 ##
-## Ends in an error in state: 148.
+## Ends in an error in state: 149.
 ##
 ## command -> OPEN GET_INFO info_flag . CLOSE [ OPEN EOF ]
 ##
@@ -2747,11 +3291,13 @@ file: OPEN GET_INFO KEYWORD UNDERSCORE
 ## OPEN GET_INFO info_flag
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+092
+a get-info command
+a closing parenthesis
 
 file: OPEN GET_INFO UNDERSCORE
 ##
-## Ends in an error in state: 146.
+## Ends in an error in state: 147.
 ##
 ## command -> OPEN GET_INFO . info_flag CLOSE [ OPEN EOF ]
 ##
@@ -2759,11 +3305,13 @@ file: OPEN GET_INFO UNDERSCORE
 ## OPEN GET_INFO
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+093
+a get-info command
+a keyword of the form ":symbol"
 
 file: OPEN GET_MODEL UNDERSCORE
 ##
-## Ends in an error in state: 144.
+## Ends in an error in state: 145.
 ##
 ## command -> OPEN GET_MODEL . CLOSE [ OPEN EOF ]
 ##
@@ -2771,11 +3319,13 @@ file: OPEN GET_MODEL UNDERSCORE
 ## OPEN GET_MODEL
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+094
+a get-model command
+a closing parenthesis
 
 file: OPEN GET_OPTION KEYWORD UNDERSCORE
 ##
-## Ends in an error in state: 142.
+## Ends in an error in state: 143.
 ##
 ## command -> OPEN GET_OPTION KEYWORD . CLOSE [ OPEN EOF ]
 ##
@@ -2783,11 +3333,13 @@ file: OPEN GET_OPTION KEYWORD UNDERSCORE
 ## OPEN GET_OPTION KEYWORD
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+095
+a get-option command
+a closing parenthesis
 
 file: OPEN GET_OPTION UNDERSCORE
 ##
-## Ends in an error in state: 141.
+## Ends in an error in state: 142.
 ##
 ## command -> OPEN GET_OPTION . KEYWORD CLOSE [ OPEN EOF ]
 ##
@@ -2795,11 +3347,13 @@ file: OPEN GET_OPTION UNDERSCORE
 ## OPEN GET_OPTION
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+096
+a get-option command
+a keyword of the form ":symbol"
 
 file: OPEN GET_PROOF UNDERSCORE
 ##
-## Ends in an error in state: 139.
+## Ends in an error in state: 140.
 ##
 ## command -> OPEN GET_PROOF . CLOSE [ OPEN EOF ]
 ##
@@ -2807,11 +3361,13 @@ file: OPEN GET_PROOF UNDERSCORE
 ## OPEN GET_PROOF
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+097
+a get-proof command
+a closing parenthesis
 
 file: OPEN GET_UNSAT_ASSUMPTIONS UNDERSCORE
 ##
-## Ends in an error in state: 137.
+## Ends in an error in state: 138.
 ##
 ## command -> OPEN GET_UNSAT_ASSUMPTIONS . CLOSE [ OPEN EOF ]
 ##
@@ -2819,11 +3375,13 @@ file: OPEN GET_UNSAT_ASSUMPTIONS UNDERSCORE
 ## OPEN GET_UNSAT_ASSUMPTIONS
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+098
+a get-unsat-assumptions command
+a closing parenthesis
 
 file: OPEN GET_UNSAT_CORE UNDERSCORE
 ##
-## Ends in an error in state: 135.
+## Ends in an error in state: 136.
 ##
 ## command -> OPEN GET_UNSAT_CORE . CLOSE [ OPEN EOF ]
 ##
@@ -2831,11 +3389,13 @@ file: OPEN GET_UNSAT_CORE UNDERSCORE
 ## OPEN GET_UNSAT_CORE
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+099
+a get-unsat-core command
+a closing parenthesis
 
 file: OPEN GET_VALUE OPEN SYMBOL CLOSE UNDERSCORE
 ##
-## Ends in an error in state: 133.
+## Ends in an error in state: 134.
 ##
 ## command -> OPEN GET_VALUE OPEN nonempty_list(term) CLOSE . CLOSE [ OPEN EOF ]
 ##
@@ -2843,7 +3403,9 @@ file: OPEN GET_VALUE OPEN SYMBOL CLOSE UNDERSCORE
 ## OPEN GET_VALUE OPEN nonempty_list(term) CLOSE
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+100
+a get-value command
+a closing parenthesis
 
 file: OPEN GET_VALUE OPEN UNDERSCORE
 ##
@@ -2855,7 +3417,9 @@ file: OPEN GET_VALUE OPEN UNDERSCORE
 ## OPEN GET_VALUE OPEN
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+101
+a get-value command
+a term
 
 file: OPEN GET_VALUE UNDERSCORE
 ##
@@ -2867,7 +3431,9 @@ file: OPEN GET_VALUE UNDERSCORE
 ## OPEN GET_VALUE
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+102
+a get-value command
+an opening parenthesis to start a list of terms
 
 file: OPEN POP NUM UNDERSCORE
 ##
@@ -2879,7 +3445,9 @@ file: OPEN POP NUM UNDERSCORE
 ## OPEN POP NUM
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+103
+a pop command
+a closing parenthesis
 
 file: OPEN POP UNDERSCORE
 ##
@@ -2891,7 +3459,9 @@ file: OPEN POP UNDERSCORE
 ## OPEN POP
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+104
+a pop command
+a numeral
 
 file: OPEN PUSH NUM UNDERSCORE
 ##
@@ -2903,7 +3473,9 @@ file: OPEN PUSH NUM UNDERSCORE
 ## OPEN PUSH NUM
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+105
+a push command
+a closing parenthesis
 
 file: OPEN PUSH UNDERSCORE
 ##
@@ -2915,7 +3487,9 @@ file: OPEN PUSH UNDERSCORE
 ## OPEN PUSH
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+106
+a push command
+a numeral
 
 file: OPEN RESET UNDERSCORE
 ##
@@ -2927,11 +3501,13 @@ file: OPEN RESET UNDERSCORE
 ## OPEN RESET
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+107
+a reset command
+a closing parenthesis
 
 file: OPEN RESET_ASSERTIONS CLOSE UNDERSCORE
 ##
-## Ends in an error in state: 284.
+## Ends in an error in state: 285.
 ##
 ## list(command) -> command . list(command) [ EOF ]
 ##
@@ -2939,7 +3515,9 @@ file: OPEN RESET_ASSERTIONS CLOSE UNDERSCORE
 ## command
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+116
+an input statement
+an opening parenthesis to start a command
 
 file: OPEN RESET_ASSERTIONS UNDERSCORE
 ##
@@ -2951,7 +3529,9 @@ file: OPEN RESET_ASSERTIONS UNDERSCORE
 ## OPEN RESET_ASSERTIONS
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+108
+a reset-assertions command
+a closing parenthesis
 
 file: OPEN SET_INFO KEYWORD KEYWORD
 ##
@@ -2971,7 +3551,11 @@ file: OPEN SET_INFO KEYWORD KEYWORD
 ## In state 26, spurious reduction of production command_option -> attribute 
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+109
+a set-info command
+a closing parenthesis, or an attribute value;
+note that keywords and reserved words (such as '_', 'as', ...) are not
+valid attribute values, and thus are not allowed here
 
 file: OPEN SET_INFO UNDERSCORE
 ##
@@ -2983,7 +3567,9 @@ file: OPEN SET_INFO UNDERSCORE
 ## OPEN SET_INFO
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+110
+a set-info command
+an attribute of the form "keyword value?"
 
 file: OPEN SET_LOGIC SYMBOL UNDERSCORE
 ##
@@ -2995,7 +3581,9 @@ file: OPEN SET_LOGIC SYMBOL UNDERSCORE
 ## OPEN SET_LOGIC SYMBOL
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+111
+a set-logic command
+a closing parenthesis
 
 file: OPEN SET_LOGIC UNDERSCORE
 ##
@@ -3007,7 +3595,9 @@ file: OPEN SET_LOGIC UNDERSCORE
 ## OPEN SET_LOGIC
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+112
+a set-logic command
+a symbol for the logic name
 
 file: OPEN SET_OPTION KEYWORD KEYWORD
 ##
@@ -3027,7 +3617,11 @@ file: OPEN SET_OPTION KEYWORD KEYWORD
 ## In state 26, spurious reduction of production command_option -> attribute 
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+113
+a set-option command
+a closing parenthesis, or an attribute value;
+note that keywords and reserved words (such as '_', 'as', ...) are not
+valid attribute values, and thus are not allowed here
 
 file: OPEN SET_OPTION KEYWORD OPEN OPEN UNDERSCORE
 ##
@@ -3039,7 +3633,10 @@ file: OPEN SET_OPTION KEYWORD OPEN OPEN UNDERSCORE
 ## OPEN
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+155
+an s-expression
+a literal, symbol, keyword, or another s-expression in parentheses
+
 
 file: OPEN SET_OPTION KEYWORD OPEN SYMBOL UNDERSCORE
 ##
@@ -3051,7 +3648,10 @@ file: OPEN SET_OPTION KEYWORD OPEN SYMBOL UNDERSCORE
 ## s_expr
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+156
+a list of s-expressions
+a closing parenthesis, or another s-expression, i.e.
+a literal, symbol, keyword, or an s-expression in parentheses
 
 file: OPEN SET_OPTION KEYWORD OPEN UNDERSCORE
 ##
@@ -3063,7 +3663,10 @@ file: OPEN SET_OPTION KEYWORD OPEN UNDERSCORE
 ## OPEN
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+157
+an attribute value
+a closing parenthesis, or an s-expression, i.e.
+a literal, symbol, keyword, or an s-expression in parentheses
 
 file: OPEN SET_OPTION KEYWORD UNDERSCORE
 ##
@@ -3075,7 +3678,10 @@ file: OPEN SET_OPTION KEYWORD UNDERSCORE
 ## KEYWORD
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+158
+an attribute
+either an attribute value as s-expression,
+another attribute, or a closing parenthesis
 
 file: OPEN SET_OPTION UNDERSCORE
 ##
@@ -3087,7 +3693,9 @@ file: OPEN SET_OPTION UNDERSCORE
 ## OPEN SET_OPTION
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+114
+a set-option command
+an attribute of the form "keyword value?"
 
 file: OPEN UNDERSCORE
 ##
@@ -3128,7 +3736,9 @@ file: OPEN UNDERSCORE
 ## OPEN
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+115
+a command
+a command name
 
 file: UNDERSCORE
 ##
@@ -3140,5 +3750,7 @@ file: UNDERSCORE
 ##
 ##
 
-<YOUR SYNTAX ERROR MESSAGE HERE>
+116
+an input statement
+an opening parenthesis to start a command
 
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/smtlib2/v2.6/tokens_smtlib.mly b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/smtlib2/v2.6/tokens_smtlib.mly
index cfd8fc2b6d636334eecbb63a0a12534b4da54eab..976030224d3d21dd7e286ef20be365c9ff1031cd 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/smtlib2/v2.6/tokens_smtlib.mly
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/smtlib2/v2.6/tokens_smtlib.mly
@@ -45,4 +45,3 @@
 
 %%
 
-
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/tptp/v6.3.0/dolmen_tptp_v6_3_0.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/tptp/v6.3.0/dolmen_tptp_v6_3_0.ml
index 25d15af4efc038b63ec0335040f7422aa5beee87..a606bc7689bc75441b20397d9a3fcf20bbcf3342 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/tptp/v6.3.0/dolmen_tptp_v6_3_0.ml
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/tptp/v6.3.0/dolmen_tptp_v6_3_0.ml
@@ -15,6 +15,6 @@ module Make
     type statement = S.t
     let env = ["TPTP"]
     let incremental = true
-    let error _ = ""
+    let error s = Syntax_messages.message s
   end)(LexTptp)(ParseTptp.Make(L)(I)(T)(S))
 
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/tptp/v6.3.0/dune b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/tptp/v6.3.0/dune
index 059b0c7c16b4bae04072d234b8993946a0e880f1..11d8f243cf4c1412d63a7a3e94ed51ca303e097b 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/tptp/v6.3.0/dune
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/tptp/v6.3.0/dune
@@ -13,9 +13,53 @@
  (merge_into parseTptp)
 )
 
+(rule
+  (target syntax_messages.ml)
+  (deps   (:tokens tokens_tptp.mly)
+          (:parser parseTptp.mly)
+          (:msg syntax.messages))
+  (action (with-stdout-to %{target}
+          (run menhir --external-tokens Tokens_tptp %{tokens}
+                      %{parser} --base %{parser} --compile-errors %{msg})))
+)
+
 (library
   (name           dolmen_tptp_v6_3_0)
   (public_name    dolmen.tptp.v6_3_0)
-  (libraries      dolmen_std menhirLib)
-  (modules        Tokens_tptp LexTptp ParseTptp Ast_tptp Dolmen_tptp_v6_3_0)
+  (libraries      dolmen_std dolmen_intf menhirLib)
+  (modules        Tokens_tptp LexTptp ParseTptp Ast_tptp Syntax_messages Dolmen_tptp_v6_3_0)
+)
+
+; Convenience rule to generate a fresh messages file,
+; and update an already existing one.
+(rule
+  (target new.messages)
+  (mode   promote-until-clean)
+  (deps   (:tokens tokens_tptp.mly)
+          (:parser parseTptp.mly))
+  (action (with-stdout-to %{target}
+          (run menhir --external-tokens Tokens_tptp %{tokens}
+                      %{parser} --base %{parser} --list-errors)))
+)
+
+(rule
+  (target updated.messages)
+  (mode   promote-until-clean)
+  (deps   (:tokens tokens_tptp.mly)
+          (:parser parseTptp.mly)
+          (:msg syntax.messages))
+  (action (with-stdout-to %{target}
+          (run menhir --external-tokens Tokens_tptp %{tokens}
+                      %{parser} --base %{parser} --update-errors %{msg})))
+)
+
+; Additional rule to add to runtest a check that the messages file is up-to-date
+(rule
+  (alias runtest)
+  (deps   (:tokens tokens_tptp.mly)
+          (:parser parseTptp.mly)
+          (:new new.messages)
+          (:msg syntax.messages))
+  (action (run menhir --external-tokens Tokens_tptp %{tokens}
+                      %{parser} --base %{parser} --compare-errors %{new} --compare-errors %{msg}))
 )
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/tptp/v6.3.0/lexTptp.mll b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/tptp/v6.3.0/lexTptp.mll
index 4d06d7aa2afe309d6be55e3aea16455ab890471a..22edd21d05e49af2ac2519e2ba49c320931b6dc1 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/tptp/v6.3.0/lexTptp.mll
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/tptp/v6.3.0/lexTptp.mll
@@ -27,9 +27,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 (** {1 TPTP Lexer} *)
 
 {
+  exception Error
+
   open Tokens_tptp
 
-  exception Error
+  let descr _ = assert false
 }
 
 let printable_char = [^ '\n']
@@ -72,16 +74,16 @@ let lower_word = lower_alpha alpha_numeric*
 let dollar_word = '$' lower_word
 let dollar_dollar_word = "$$" lower_word
 
-rule token = parse
+rule token newline = parse
   | comment
     { String.iter (function
-        | '\n' -> Lexing.new_line lexbuf
+        | '\n' -> newline lexbuf
         | _ -> ()
       ) (Lexing.lexeme lexbuf);
-      token lexbuf }
+      token newline lexbuf }
 
-  | '\n' { Lexing.new_line lexbuf; token lexbuf }
-  | [' ' '\t' '\r'] { token lexbuf }
+  | '\n' { newline lexbuf; token newline lexbuf }
+  | [' ' '\t' '\r'] { token newline lexbuf }
   | eof { EOF }
 
   | '.'   { DOT }
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/tptp/v6.3.0/parseTptp.mly b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/tptp/v6.3.0/parseTptp.mly
index 6baac4c24ab7fb9f1a947c05ad183e21780073ef..ce03c01a9f8f65fd5038cf4b03c9e4ff145ce283 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/tptp/v6.3.0/parseTptp.mly
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/tptp/v6.3.0/parseTptp.mly
@@ -818,7 +818,7 @@ general_terms:
 /*
   name: atomic_word | integer
 
-  this porduction has been expanded to
+  this production has been expanded to
   produce ids instead of terms
 */
 name:
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/tptp/v6.3.0/syntax.messages b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/tptp/v6.3.0/syntax.messages
new file mode 100644
index 0000000000000000000000000000000000000000..56bb319aba8904bb66459f8315c8478d10a7fca6
--- /dev/null
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/tptp/v6.3.0/syntax.messages
@@ -0,0 +1,4667 @@
+input: CNF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LEFT_PAREN DOLLAR_DOLLAR_WORD RIGHT_PAREN XOR
+##
+## Ends in an error in state: 617.
+##
+## cnf_annotated -> CNF LEFT_PAREN name COMMA formula_role COMMA cnf_formula . annotations RIGHT_PAREN DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## CNF LEFT_PAREN name COMMA formula_role COMMA cnf_formula
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: CNF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED COMMA DISTINCT_OBJECT COMMA LEFT_BRACKET RIGHT_BRACKET XOR
+##
+## Ends in an error in state: 618.
+##
+## cnf_annotated -> CNF LEFT_PAREN name COMMA formula_role COMMA cnf_formula annotations . RIGHT_PAREN DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## CNF LEFT_PAREN name COMMA formula_role COMMA cnf_formula annotations
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: CNF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED RIGHT_PAREN XOR
+##
+## Ends in an error in state: 619.
+##
+## cnf_annotated -> CNF LEFT_PAREN name COMMA formula_role COMMA cnf_formula annotations RIGHT_PAREN . DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## CNF LEFT_PAREN name COMMA formula_role COMMA cnf_formula annotations RIGHT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: CNF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA XOR
+##
+## Ends in an error in state: 616.
+##
+## cnf_annotated -> CNF LEFT_PAREN name COMMA formula_role COMMA . cnf_formula annotations RIGHT_PAREN DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## CNF LEFT_PAREN name COMMA formula_role COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: CNF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD XOR
+##
+## Ends in an error in state: 615.
+##
+## cnf_annotated -> CNF LEFT_PAREN name COMMA formula_role . COMMA cnf_formula annotations RIGHT_PAREN DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## CNF LEFT_PAREN name COMMA formula_role
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: CNF LEFT_PAREN SINGLE_QUOTED COMMA XOR
+##
+## Ends in an error in state: 614.
+##
+## cnf_annotated -> CNF LEFT_PAREN name COMMA . formula_role COMMA cnf_formula annotations RIGHT_PAREN DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## CNF LEFT_PAREN name COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: CNF LEFT_PAREN SINGLE_QUOTED XOR
+##
+## Ends in an error in state: 613.
+##
+## cnf_annotated -> CNF LEFT_PAREN name . COMMA formula_role COMMA cnf_formula annotations RIGHT_PAREN DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## CNF LEFT_PAREN name
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: CNF LEFT_PAREN XOR
+##
+## Ends in an error in state: 612.
+##
+## cnf_annotated -> CNF LEFT_PAREN . name COMMA formula_role COMMA cnf_formula annotations RIGHT_PAREN DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## CNF LEFT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: CNF XOR
+##
+## Ends in an error in state: 611.
+##
+## cnf_annotated -> CNF . LEFT_PAREN name COMMA formula_role COMMA cnf_formula annotations RIGHT_PAREN DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## CNF
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: FOF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED COMMA DISTINCT_OBJECT COMMA LEFT_BRACKET RIGHT_BRACKET XOR
+##
+## Ends in an error in state: 607.
+##
+## fof_annotated -> FOF LEFT_PAREN name COMMA formula_role COMMA fof_formula annotations . RIGHT_PAREN DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## FOF LEFT_PAREN name COMMA formula_role COMMA fof_formula annotations
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: FOF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED RIGHT_BRACKET
+##
+## Ends in an error in state: 606.
+##
+## fof_annotated -> FOF LEFT_PAREN name COMMA formula_role COMMA fof_formula . annotations RIGHT_PAREN DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## FOF LEFT_PAREN name COMMA formula_role COMMA fof_formula
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 32, spurious reduction of production constant -> tptp_functor 
+## In state 55, spurious reduction of production plain_term -> constant 
+## In state 114, spurious reduction of production plain_atomic_formula -> plain_term 
+## In state 115, spurious reduction of production atomic_formula -> plain_atomic_formula 
+## In state 268, spurious reduction of production fof_unitary_formula -> atomic_formula 
+## In state 270, spurious reduction of production fof_logic_formula -> fof_unitary_formula 
+## In state 451, spurious reduction of production fof_formula -> fof_logic_formula 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: FOF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED RIGHT_PAREN XOR
+##
+## Ends in an error in state: 608.
+##
+## fof_annotated -> FOF LEFT_PAREN name COMMA formula_role COMMA fof_formula annotations RIGHT_PAREN . DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## FOF LEFT_PAREN name COMMA formula_role COMMA fof_formula annotations RIGHT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: FOF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA XOR
+##
+## Ends in an error in state: 605.
+##
+## fof_annotated -> FOF LEFT_PAREN name COMMA formula_role COMMA . fof_formula annotations RIGHT_PAREN DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## FOF LEFT_PAREN name COMMA formula_role COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: FOF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD XOR
+##
+## Ends in an error in state: 604.
+##
+## fof_annotated -> FOF LEFT_PAREN name COMMA formula_role . COMMA fof_formula annotations RIGHT_PAREN DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## FOF LEFT_PAREN name COMMA formula_role
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: FOF LEFT_PAREN SINGLE_QUOTED COMMA XOR
+##
+## Ends in an error in state: 603.
+##
+## fof_annotated -> FOF LEFT_PAREN name COMMA . formula_role COMMA fof_formula annotations RIGHT_PAREN DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## FOF LEFT_PAREN name COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: FOF LEFT_PAREN SINGLE_QUOTED XOR
+##
+## Ends in an error in state: 602.
+##
+## fof_annotated -> FOF LEFT_PAREN name . COMMA formula_role COMMA fof_formula annotations RIGHT_PAREN DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## FOF LEFT_PAREN name
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: FOF LEFT_PAREN XOR
+##
+## Ends in an error in state: 601.
+##
+## fof_annotated -> FOF LEFT_PAREN . name COMMA formula_role COMMA fof_formula annotations RIGHT_PAREN DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## FOF LEFT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: FOF XOR
+##
+## Ends in an error in state: 600.
+##
+## fof_annotated -> FOF . LEFT_PAREN name COMMA formula_role COMMA fof_formula annotations RIGHT_PAREN DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## FOF
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: INCLUDE LEFT_PAREN SINGLE_QUOTED COMMA LEFT_BRACKET INTEGER RIGHT_BRACKET XOR
+##
+## Ends in an error in state: 597.
+##
+## tptp_include -> INCLUDE LEFT_PAREN file_name formula_section . RIGHT_PAREN DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## INCLUDE LEFT_PAREN file_name formula_section
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: INCLUDE LEFT_PAREN SINGLE_QUOTED RIGHT_PAREN XOR
+##
+## Ends in an error in state: 598.
+##
+## tptp_include -> INCLUDE LEFT_PAREN file_name formula_section RIGHT_PAREN . DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## INCLUDE LEFT_PAREN file_name formula_section RIGHT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: INCLUDE LEFT_PAREN SINGLE_QUOTED XOR
+##
+## Ends in an error in state: 596.
+##
+## tptp_include -> INCLUDE LEFT_PAREN file_name . formula_section RIGHT_PAREN DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## INCLUDE LEFT_PAREN file_name
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: INCLUDE LEFT_PAREN XOR
+##
+## Ends in an error in state: 595.
+##
+## tptp_include -> INCLUDE LEFT_PAREN . file_name formula_section RIGHT_PAREN DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## INCLUDE LEFT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: INCLUDE XOR
+##
+## Ends in an error in state: 594.
+##
+## tptp_include -> INCLUDE . LEFT_PAREN file_name formula_section RIGHT_PAREN DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## INCLUDE
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA DOLLAR_WORD RIGHT_BRACKET
+##
+## Ends in an error in state: 590.
+##
+## tff_annotated -> TFF LEFT_PAREN name COMMA formula_role COMMA tff_formula . annotations RIGHT_PAREN DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## TFF LEFT_PAREN name COMMA formula_role COMMA tff_formula
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 50, spurious reduction of production defined_constant -> defined_functor 
+## In state 52, spurious reduction of production defined_plain_term -> defined_constant 
+## In state 116, spurious reduction of production defined_plain_formula -> defined_plain_term 
+## In state 117, spurious reduction of production defined_atomic_formula -> defined_plain_formula 
+## In state 119, spurious reduction of production atomic_formula -> defined_atomic_formula 
+## In state 145, spurious reduction of production tff_unitary_formula -> atomic_formula 
+## In state 146, spurious reduction of production tff_logic_formula -> tff_unitary_formula 
+## In state 230, spurious reduction of production tff_formula -> tff_logic_formula 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED COMMA DISTINCT_OBJECT COMMA LEFT_BRACKET RIGHT_BRACKET XOR
+##
+## Ends in an error in state: 591.
+##
+## tff_annotated -> TFF LEFT_PAREN name COMMA formula_role COMMA tff_formula annotations . RIGHT_PAREN DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## TFF LEFT_PAREN name COMMA formula_role COMMA tff_formula annotations
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED RIGHT_PAREN XOR
+##
+## Ends in an error in state: 592.
+##
+## tff_annotated -> TFF LEFT_PAREN name COMMA formula_role COMMA tff_formula annotations RIGHT_PAREN . DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## TFF LEFT_PAREN name COMMA formula_role COMMA tff_formula annotations RIGHT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA XOR
+##
+## Ends in an error in state: 589.
+##
+## tff_annotated -> TFF LEFT_PAREN name COMMA formula_role COMMA . tff_formula annotations RIGHT_PAREN DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## TFF LEFT_PAREN name COMMA formula_role COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD XOR
+##
+## Ends in an error in state: 588.
+##
+## tff_annotated -> TFF LEFT_PAREN name COMMA formula_role . COMMA tff_formula annotations RIGHT_PAREN DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## TFF LEFT_PAREN name COMMA formula_role
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: TFF LEFT_PAREN SINGLE_QUOTED COMMA XOR
+##
+## Ends in an error in state: 587.
+##
+## tff_annotated -> TFF LEFT_PAREN name COMMA . formula_role COMMA tff_formula annotations RIGHT_PAREN DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## TFF LEFT_PAREN name COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: TFF LEFT_PAREN SINGLE_QUOTED XOR
+##
+## Ends in an error in state: 586.
+##
+## tff_annotated -> TFF LEFT_PAREN name . COMMA formula_role COMMA tff_formula annotations RIGHT_PAREN DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## TFF LEFT_PAREN name
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: TFF LEFT_PAREN XOR
+##
+## Ends in an error in state: 585.
+##
+## tff_annotated -> TFF LEFT_PAREN . name COMMA formula_role COMMA tff_formula annotations RIGHT_PAREN DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## TFF LEFT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: TFF XOR
+##
+## Ends in an error in state: 584.
+##
+## tff_annotated -> TFF . LEFT_PAREN name COMMA formula_role COMMA tff_formula annotations RIGHT_PAREN DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## TFF
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA TPI
+##
+## Ends in an error in state: 579.
+##
+## thf_annotated -> THF LEFT_PAREN name COMMA formula_role COMMA . thf_formula annotations RIGHT_PAREN DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## THF LEFT_PAREN name COMMA formula_role COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA XOR COMMA DISTINCT_OBJECT COMMA LEFT_BRACKET RIGHT_BRACKET XOR
+##
+## Ends in an error in state: 581.
+##
+## thf_annotated -> THF LEFT_PAREN name COMMA formula_role COMMA thf_formula annotations . RIGHT_PAREN DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## THF LEFT_PAREN name COMMA formula_role COMMA thf_formula annotations
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA XOR RIGHT_BRACKET
+##
+## Ends in an error in state: 580.
+##
+## thf_annotated -> THF LEFT_PAREN name COMMA formula_role COMMA thf_formula . annotations RIGHT_PAREN DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## THF LEFT_PAREN name COMMA formula_role COMMA thf_formula
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 379, spurious reduction of production thf_unitary_formula -> thf_atom 
+## In state 341, spurious reduction of production thf_logic_formula -> thf_unitary_formula 
+## In state 421, spurious reduction of production thf_formula -> thf_logic_formula 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA XOR RIGHT_PAREN XOR
+##
+## Ends in an error in state: 582.
+##
+## thf_annotated -> THF LEFT_PAREN name COMMA formula_role COMMA thf_formula annotations RIGHT_PAREN . DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## THF LEFT_PAREN name COMMA formula_role COMMA thf_formula annotations RIGHT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD XOR
+##
+## Ends in an error in state: 578.
+##
+## thf_annotated -> THF LEFT_PAREN name COMMA formula_role . COMMA thf_formula annotations RIGHT_PAREN DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## THF LEFT_PAREN name COMMA formula_role
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: THF LEFT_PAREN SINGLE_QUOTED COMMA XOR
+##
+## Ends in an error in state: 577.
+##
+## thf_annotated -> THF LEFT_PAREN name COMMA . formula_role COMMA thf_formula annotations RIGHT_PAREN DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## THF LEFT_PAREN name COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: THF LEFT_PAREN SINGLE_QUOTED XOR
+##
+## Ends in an error in state: 576.
+##
+## thf_annotated -> THF LEFT_PAREN name . COMMA formula_role COMMA thf_formula annotations RIGHT_PAREN DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## THF LEFT_PAREN name
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: THF LEFT_PAREN XOR
+##
+## Ends in an error in state: 575.
+##
+## thf_annotated -> THF LEFT_PAREN . name COMMA formula_role COMMA thf_formula annotations RIGHT_PAREN DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## THF LEFT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: THF XOR
+##
+## Ends in an error in state: 574.
+##
+## thf_annotated -> THF . LEFT_PAREN name COMMA formula_role COMMA thf_formula annotations RIGHT_PAREN DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## THF
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED COMMA DISTINCT_OBJECT COMMA LEFT_BRACKET RIGHT_BRACKET XOR
+##
+## Ends in an error in state: 571.
+##
+## tpi_annotated -> TPI LEFT_PAREN name COMMA formula_role COMMA tpi_formula annotations . RIGHT_PAREN DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## TPI LEFT_PAREN name COMMA formula_role COMMA tpi_formula annotations
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED RIGHT_BRACKET
+##
+## Ends in an error in state: 570.
+##
+## tpi_annotated -> TPI LEFT_PAREN name COMMA formula_role COMMA tpi_formula . annotations RIGHT_PAREN DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## TPI LEFT_PAREN name COMMA formula_role COMMA tpi_formula
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 32, spurious reduction of production constant -> tptp_functor 
+## In state 55, spurious reduction of production plain_term -> constant 
+## In state 114, spurious reduction of production plain_atomic_formula -> plain_term 
+## In state 115, spurious reduction of production atomic_formula -> plain_atomic_formula 
+## In state 268, spurious reduction of production fof_unitary_formula -> atomic_formula 
+## In state 270, spurious reduction of production fof_logic_formula -> fof_unitary_formula 
+## In state 451, spurious reduction of production fof_formula -> fof_logic_formula 
+## In state 496, spurious reduction of production tpi_formula -> fof_formula 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED RIGHT_PAREN XOR
+##
+## Ends in an error in state: 572.
+##
+## tpi_annotated -> TPI LEFT_PAREN name COMMA formula_role COMMA tpi_formula annotations RIGHT_PAREN . DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## TPI LEFT_PAREN name COMMA formula_role COMMA tpi_formula annotations RIGHT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA XOR
+##
+## Ends in an error in state: 569.
+##
+## tpi_annotated -> TPI LEFT_PAREN name COMMA formula_role COMMA . tpi_formula annotations RIGHT_PAREN DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## TPI LEFT_PAREN name COMMA formula_role COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD XOR
+##
+## Ends in an error in state: 568.
+##
+## tpi_annotated -> TPI LEFT_PAREN name COMMA formula_role . COMMA tpi_formula annotations RIGHT_PAREN DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## TPI LEFT_PAREN name COMMA formula_role
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: TPI LEFT_PAREN SINGLE_QUOTED COMMA XOR
+##
+## Ends in an error in state: 567.
+##
+## tpi_annotated -> TPI LEFT_PAREN name COMMA . formula_role COMMA tpi_formula annotations RIGHT_PAREN DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## TPI LEFT_PAREN name COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: TPI LEFT_PAREN SINGLE_QUOTED XOR
+##
+## Ends in an error in state: 566.
+##
+## tpi_annotated -> TPI LEFT_PAREN name . COMMA formula_role COMMA tpi_formula annotations RIGHT_PAREN DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## TPI LEFT_PAREN name
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: TPI LEFT_PAREN XOR
+##
+## Ends in an error in state: 565.
+##
+## tpi_annotated -> TPI LEFT_PAREN . name COMMA formula_role COMMA tpi_formula annotations RIGHT_PAREN DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## TPI LEFT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: TPI XOR
+##
+## Ends in an error in state: 564.
+##
+## tpi_annotated -> TPI . LEFT_PAREN name COMMA formula_role COMMA tpi_formula annotations RIGHT_PAREN DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## TPI
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: XOR
+##
+## Ends in an error in state: 563.
+##
+## input' -> . input [ # ]
+##
+## The known suffix of the stack is as follows:
+##
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: CNF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LEFT_PAREN DOLLAR_DOLLAR_WORD RIGHT_PAREN XOR
+##
+## Ends in an error in state: 547.
+##
+## cnf_annotated -> CNF LEFT_PAREN name COMMA formula_role COMMA cnf_formula . annotations RIGHT_PAREN DOT [ TPI THF TFF INCLUDE FOF EOF CNF ]
+##
+## The known suffix of the stack is as follows:
+## CNF LEFT_PAREN name COMMA formula_role COMMA cnf_formula
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: CNF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LEFT_PAREN SINGLE_QUOTED XOR
+##
+## Ends in an error in state: 461.
+##
+## cnf_formula -> LEFT_PAREN disjunction . RIGHT_PAREN [ RIGHT_PAREN COMMA ]
+## disjunction -> disjunction . VLINE literal [ VLINE RIGHT_PAREN ]
+##
+## The known suffix of the stack is as follows:
+## LEFT_PAREN disjunction
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 32, spurious reduction of production constant -> tptp_functor 
+## In state 55, spurious reduction of production plain_term -> constant 
+## In state 114, spurious reduction of production plain_atomic_formula -> plain_term 
+## In state 115, spurious reduction of production atomic_formula -> plain_atomic_formula 
+## In state 464, spurious reduction of production literal -> atomic_formula 
+## In state 459, spurious reduction of production disjunction -> literal 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: CNF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LEFT_PAREN XOR
+##
+## Ends in an error in state: 456.
+##
+## cnf_formula -> LEFT_PAREN . disjunction RIGHT_PAREN [ RIGHT_PAREN COMMA ]
+##
+## The known suffix of the stack is as follows:
+## LEFT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: CNF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA NOT UPPER_WORD XOR
+##
+## Ends in an error in state: 107.
+##
+## defined_infix_formula -> term . defined_infix_pred term [ VLINE RIGHT_PAREN EQUIV COMMA ]
+##
+## The known suffix of the stack is as follows:
+## term
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: CNF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA NOT XOR
+##
+## Ends in an error in state: 457.
+##
+## literal -> unary_negation . atomic_formula [ VLINE RIGHT_PAREN COMMA ]
+##
+## The known suffix of the stack is as follows:
+## unary_negation
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: CNF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED COMMA DISTINCT_OBJECT COMMA LEFT_BRACKET RIGHT_BRACKET XOR
+##
+## Ends in an error in state: 548.
+##
+## cnf_annotated -> CNF LEFT_PAREN name COMMA formula_role COMMA cnf_formula annotations . RIGHT_PAREN DOT [ TPI THF TFF INCLUDE FOF EOF CNF ]
+##
+## The known suffix of the stack is as follows:
+## CNF LEFT_PAREN name COMMA formula_role COMMA cnf_formula annotations
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: CNF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED RIGHT_PAREN XOR
+##
+## Ends in an error in state: 549.
+##
+## cnf_annotated -> CNF LEFT_PAREN name COMMA formula_role COMMA cnf_formula annotations RIGHT_PAREN . DOT [ TPI THF TFF INCLUDE FOF EOF CNF ]
+##
+## The known suffix of the stack is as follows:
+## CNF LEFT_PAREN name COMMA formula_role COMMA cnf_formula annotations RIGHT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: CNF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED VLINE XOR
+##
+## Ends in an error in state: 462.
+##
+## disjunction -> disjunction VLINE . literal [ VLINE RIGHT_PAREN COMMA ]
+##
+## The known suffix of the stack is as follows:
+## disjunction VLINE
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: CNF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED XOR
+##
+## Ends in an error in state: 466.
+##
+## cnf_formula -> disjunction . [ RIGHT_PAREN COMMA ]
+## disjunction -> disjunction . VLINE literal [ VLINE RIGHT_PAREN COMMA ]
+##
+## The known suffix of the stack is as follows:
+## disjunction
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 32, spurious reduction of production constant -> tptp_functor 
+## In state 55, spurious reduction of production plain_term -> constant 
+## In state 114, spurious reduction of production plain_atomic_formula -> plain_term 
+## In state 115, spurious reduction of production atomic_formula -> plain_atomic_formula 
+## In state 464, spurious reduction of production literal -> atomic_formula 
+## In state 459, spurious reduction of production disjunction -> literal 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: CNF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA XOR
+##
+## Ends in an error in state: 546.
+##
+## cnf_annotated -> CNF LEFT_PAREN name COMMA formula_role COMMA . cnf_formula annotations RIGHT_PAREN DOT [ TPI THF TFF INCLUDE FOF EOF CNF ]
+##
+## The known suffix of the stack is as follows:
+## CNF LEFT_PAREN name COMMA formula_role COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: CNF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD XOR
+##
+## Ends in an error in state: 545.
+##
+## cnf_annotated -> CNF LEFT_PAREN name COMMA formula_role . COMMA cnf_formula annotations RIGHT_PAREN DOT [ TPI THF TFF INCLUDE FOF EOF CNF ]
+##
+## The known suffix of the stack is as follows:
+## CNF LEFT_PAREN name COMMA formula_role
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: CNF LEFT_PAREN SINGLE_QUOTED COMMA XOR
+##
+## Ends in an error in state: 544.
+##
+## cnf_annotated -> CNF LEFT_PAREN name COMMA . formula_role COMMA cnf_formula annotations RIGHT_PAREN DOT [ TPI THF TFF INCLUDE FOF EOF CNF ]
+##
+## The known suffix of the stack is as follows:
+## CNF LEFT_PAREN name COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: CNF LEFT_PAREN SINGLE_QUOTED XOR
+##
+## Ends in an error in state: 543.
+##
+## cnf_annotated -> CNF LEFT_PAREN name . COMMA formula_role COMMA cnf_formula annotations RIGHT_PAREN DOT [ TPI THF TFF INCLUDE FOF EOF CNF ]
+##
+## The known suffix of the stack is as follows:
+## CNF LEFT_PAREN name
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: CNF LEFT_PAREN XOR
+##
+## Ends in an error in state: 542.
+##
+## cnf_annotated -> CNF LEFT_PAREN . name COMMA formula_role COMMA cnf_formula annotations RIGHT_PAREN DOT [ TPI THF TFF INCLUDE FOF EOF CNF ]
+##
+## The known suffix of the stack is as follows:
+## CNF LEFT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: CNF XOR
+##
+## Ends in an error in state: 541.
+##
+## cnf_annotated -> CNF . LEFT_PAREN name COMMA formula_role COMMA cnf_formula annotations RIGHT_PAREN DOT [ TPI THF TFF INCLUDE FOF EOF CNF ]
+##
+## The known suffix of the stack is as follows:
+## CNF
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: FOF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED COMMA DISTINCT_OBJECT COMMA LEFT_BRACKET RIGHT_BRACKET XOR
+##
+## Ends in an error in state: 538.
+##
+## fof_annotated -> FOF LEFT_PAREN name COMMA formula_role COMMA fof_formula annotations . RIGHT_PAREN DOT [ TPI THF TFF INCLUDE FOF EOF CNF ]
+##
+## The known suffix of the stack is as follows:
+## FOF LEFT_PAREN name COMMA formula_role COMMA fof_formula annotations
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: FOF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED RIGHT_BRACKET
+##
+## Ends in an error in state: 537.
+##
+## fof_annotated -> FOF LEFT_PAREN name COMMA formula_role COMMA fof_formula . annotations RIGHT_PAREN DOT [ TPI THF TFF INCLUDE FOF EOF CNF ]
+##
+## The known suffix of the stack is as follows:
+## FOF LEFT_PAREN name COMMA formula_role COMMA fof_formula
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 32, spurious reduction of production constant -> tptp_functor 
+## In state 55, spurious reduction of production plain_term -> constant 
+## In state 114, spurious reduction of production plain_atomic_formula -> plain_term 
+## In state 115, spurious reduction of production atomic_formula -> plain_atomic_formula 
+## In state 268, spurious reduction of production fof_unitary_formula -> atomic_formula 
+## In state 270, spurious reduction of production fof_logic_formula -> fof_unitary_formula 
+## In state 451, spurious reduction of production fof_formula -> fof_logic_formula 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: FOF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED RIGHT_PAREN XOR
+##
+## Ends in an error in state: 539.
+##
+## fof_annotated -> FOF LEFT_PAREN name COMMA formula_role COMMA fof_formula annotations RIGHT_PAREN . DOT [ TPI THF TFF INCLUDE FOF EOF CNF ]
+##
+## The known suffix of the stack is as follows:
+## FOF LEFT_PAREN name COMMA formula_role COMMA fof_formula annotations RIGHT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: FOF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA XOR
+##
+## Ends in an error in state: 536.
+##
+## fof_annotated -> FOF LEFT_PAREN name COMMA formula_role COMMA . fof_formula annotations RIGHT_PAREN DOT [ TPI THF TFF INCLUDE FOF EOF CNF ]
+##
+## The known suffix of the stack is as follows:
+## FOF LEFT_PAREN name COMMA formula_role COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: FOF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD XOR
+##
+## Ends in an error in state: 535.
+##
+## fof_annotated -> FOF LEFT_PAREN name COMMA formula_role . COMMA fof_formula annotations RIGHT_PAREN DOT [ TPI THF TFF INCLUDE FOF EOF CNF ]
+##
+## The known suffix of the stack is as follows:
+## FOF LEFT_PAREN name COMMA formula_role
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: FOF LEFT_PAREN SINGLE_QUOTED COMMA XOR
+##
+## Ends in an error in state: 534.
+##
+## fof_annotated -> FOF LEFT_PAREN name COMMA . formula_role COMMA fof_formula annotations RIGHT_PAREN DOT [ TPI THF TFF INCLUDE FOF EOF CNF ]
+##
+## The known suffix of the stack is as follows:
+## FOF LEFT_PAREN name COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: FOF LEFT_PAREN SINGLE_QUOTED XOR
+##
+## Ends in an error in state: 533.
+##
+## fof_annotated -> FOF LEFT_PAREN name . COMMA formula_role COMMA fof_formula annotations RIGHT_PAREN DOT [ TPI THF TFF INCLUDE FOF EOF CNF ]
+##
+## The known suffix of the stack is as follows:
+## FOF LEFT_PAREN name
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: FOF LEFT_PAREN XOR
+##
+## Ends in an error in state: 532.
+##
+## fof_annotated -> FOF LEFT_PAREN . name COMMA formula_role COMMA fof_formula annotations RIGHT_PAREN DOT [ TPI THF TFF INCLUDE FOF EOF CNF ]
+##
+## The known suffix of the stack is as follows:
+## FOF LEFT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: FOF XOR
+##
+## Ends in an error in state: 531.
+##
+## fof_annotated -> FOF . LEFT_PAREN name COMMA formula_role COMMA fof_formula annotations RIGHT_PAREN DOT [ TPI THF TFF INCLUDE FOF EOF CNF ]
+##
+## The known suffix of the stack is as follows:
+## FOF
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: INCLUDE LEFT_PAREN SINGLE_QUOTED COMMA LEFT_BRACKET INTEGER RIGHT_BRACKET XOR
+##
+## Ends in an error in state: 528.
+##
+## tptp_include -> INCLUDE LEFT_PAREN file_name formula_section . RIGHT_PAREN DOT [ TPI THF TFF INCLUDE FOF EOF CNF ]
+##
+## The known suffix of the stack is as follows:
+## INCLUDE LEFT_PAREN file_name formula_section
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: INCLUDE LEFT_PAREN SINGLE_QUOTED COMMA LEFT_BRACKET SINGLE_QUOTED COMMA XOR
+##
+## Ends in an error in state: 526.
+##
+## name_list -> name COMMA . name_list [ RIGHT_BRACKET ]
+##
+## The known suffix of the stack is as follows:
+## name COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: INCLUDE LEFT_PAREN SINGLE_QUOTED COMMA LEFT_BRACKET SINGLE_QUOTED XOR
+##
+## Ends in an error in state: 525.
+##
+## name_list -> name . [ RIGHT_BRACKET ]
+## name_list -> name . COMMA name_list [ RIGHT_BRACKET ]
+##
+## The known suffix of the stack is as follows:
+## name
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: INCLUDE LEFT_PAREN SINGLE_QUOTED COMMA LEFT_BRACKET XOR
+##
+## Ends in an error in state: 522.
+##
+## formula_section -> COMMA LEFT_BRACKET . name_list RIGHT_BRACKET [ RIGHT_PAREN ]
+##
+## The known suffix of the stack is as follows:
+## COMMA LEFT_BRACKET
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: INCLUDE LEFT_PAREN SINGLE_QUOTED COMMA XOR
+##
+## Ends in an error in state: 521.
+##
+## formula_section -> COMMA . LEFT_BRACKET name_list RIGHT_BRACKET [ RIGHT_PAREN ]
+##
+## The known suffix of the stack is as follows:
+## COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: INCLUDE LEFT_PAREN SINGLE_QUOTED RIGHT_PAREN DOT XOR
+##
+## Ends in an error in state: 551.
+##
+## list(tptp_input) -> tptp_input . list(tptp_input) [ EOF ]
+##
+## The known suffix of the stack is as follows:
+## tptp_input
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: INCLUDE LEFT_PAREN SINGLE_QUOTED RIGHT_PAREN XOR
+##
+## Ends in an error in state: 529.
+##
+## tptp_include -> INCLUDE LEFT_PAREN file_name formula_section RIGHT_PAREN . DOT [ TPI THF TFF INCLUDE FOF EOF CNF ]
+##
+## The known suffix of the stack is as follows:
+## INCLUDE LEFT_PAREN file_name formula_section RIGHT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: INCLUDE LEFT_PAREN SINGLE_QUOTED XOR
+##
+## Ends in an error in state: 520.
+##
+## tptp_include -> INCLUDE LEFT_PAREN file_name . formula_section RIGHT_PAREN DOT [ TPI THF TFF INCLUDE FOF EOF CNF ]
+##
+## The known suffix of the stack is as follows:
+## INCLUDE LEFT_PAREN file_name
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: INCLUDE LEFT_PAREN XOR
+##
+## Ends in an error in state: 518.
+##
+## tptp_include -> INCLUDE LEFT_PAREN . file_name formula_section RIGHT_PAREN DOT [ TPI THF TFF INCLUDE FOF EOF CNF ]
+##
+## The known suffix of the stack is as follows:
+## INCLUDE LEFT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: INCLUDE XOR
+##
+## Ends in an error in state: 517.
+##
+## tptp_include -> INCLUDE . LEFT_PAREN file_name formula_section RIGHT_PAREN DOT [ TPI THF TFF INCLUDE FOF EOF CNF ]
+##
+## The known suffix of the stack is as follows:
+## INCLUDE
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA DOLLAR_DOLLAR_WORD UPPER_WORD
+##
+## Ends in an error in state: 227.
+##
+## system_constant -> system_functor . [ XOR VLINE RIGHT_PAREN NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA AND ]
+## system_term -> system_functor . LEFT_PAREN arguments RIGHT_PAREN [ XOR VLINE RIGHT_PAREN NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA AND ]
+## tff_untyped_atom -> system_functor . [ COLON ]
+##
+## The known suffix of the stack is as follows:
+## system_functor
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA DOLLAR_WORD RIGHT_BRACKET
+##
+## Ends in an error in state: 513.
+##
+## tff_annotated -> TFF LEFT_PAREN name COMMA formula_role COMMA tff_formula . annotations RIGHT_PAREN DOT [ TPI THF TFF INCLUDE FOF EOF CNF ]
+##
+## The known suffix of the stack is as follows:
+## TFF LEFT_PAREN name COMMA formula_role COMMA tff_formula
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 50, spurious reduction of production defined_constant -> defined_functor 
+## In state 52, spurious reduction of production defined_plain_term -> defined_constant 
+## In state 116, spurious reduction of production defined_plain_formula -> defined_plain_term 
+## In state 117, spurious reduction of production defined_atomic_formula -> defined_plain_formula 
+## In state 119, spurious reduction of production atomic_formula -> defined_atomic_formula 
+## In state 145, spurious reduction of production tff_unitary_formula -> atomic_formula 
+## In state 146, spurious reduction of production tff_logic_formula -> tff_unitary_formula 
+## In state 230, spurious reduction of production tff_formula -> tff_logic_formula 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA FORALL LEFT_BRACKET UPPER_WORD COLON DOLLAR_WORD XOR
+##
+## Ends in an error in state: 92.
+##
+## tff_variable_list -> tff_variable . [ RIGHT_BRACKET ]
+## tff_variable_list -> tff_variable . COMMA tff_variable_list [ RIGHT_BRACKET ]
+##
+## The known suffix of the stack is as follows:
+## tff_variable
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA FORALL LEFT_BRACKET UPPER_WORD COLON XOR
+##
+## Ends in an error in state: 75.
+##
+## tff_typed_variable -> variable COLON . tff_atomic_type [ RIGHT_BRACKET COMMA ]
+##
+## The known suffix of the stack is as follows:
+## variable COLON
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA FORALL LEFT_BRACKET UPPER_WORD COMMA XOR
+##
+## Ends in an error in state: 93.
+##
+## tff_variable_list -> tff_variable COMMA . tff_variable_list [ RIGHT_BRACKET ]
+##
+## The known suffix of the stack is as follows:
+## tff_variable COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA FORALL LEFT_BRACKET UPPER_WORD RIGHT_BRACKET COLON XOR
+##
+## Ends in an error in state: 142.
+##
+## tff_quantified_formula -> fol_quantifier LEFT_BRACKET tff_variable_list RIGHT_BRACKET COLON . tff_unitary_formula [ XOR VLINE RIGHT_PAREN RIGHT_BRACKET NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV COMMA AND ]
+##
+## The known suffix of the stack is as follows:
+## fol_quantifier LEFT_BRACKET tff_variable_list RIGHT_BRACKET COLON
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA FORALL LEFT_BRACKET UPPER_WORD RIGHT_BRACKET XOR
+##
+## Ends in an error in state: 141.
+##
+## tff_quantified_formula -> fol_quantifier LEFT_BRACKET tff_variable_list RIGHT_BRACKET . COLON tff_unitary_formula [ XOR VLINE RIGHT_PAREN RIGHT_BRACKET NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV COMMA AND ]
+##
+## The known suffix of the stack is as follows:
+## fol_quantifier LEFT_BRACKET tff_variable_list RIGHT_BRACKET
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA FORALL LEFT_BRACKET UPPER_WORD XOR
+##
+## Ends in an error in state: 74.
+##
+## tff_typed_variable -> variable . COLON tff_atomic_type [ RIGHT_BRACKET COMMA ]
+## tff_variable -> variable . [ RIGHT_BRACKET COMMA ]
+##
+## The known suffix of the stack is as follows:
+## variable
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA FORALL LEFT_BRACKET XOR
+##
+## Ends in an error in state: 139.
+##
+## tff_quantified_formula -> fol_quantifier LEFT_BRACKET . tff_variable_list RIGHT_BRACKET COLON tff_unitary_formula [ XOR VLINE RIGHT_PAREN RIGHT_BRACKET NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV COMMA AND ]
+##
+## The known suffix of the stack is as follows:
+## fol_quantifier LEFT_BRACKET
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA FORALL XOR
+##
+## Ends in an error in state: 138.
+##
+## tff_quantified_formula -> fol_quantifier . LEFT_BRACKET tff_variable_list RIGHT_BRACKET COLON tff_unitary_formula [ XOR VLINE RIGHT_PAREN RIGHT_BRACKET NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV COMMA AND ]
+##
+## The known suffix of the stack is as follows:
+## fol_quantifier
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA ITE_F LEFT_PAREN SINGLE_QUOTED COMMA SINGLE_QUOTED COMMA SINGLE_QUOTED RIGHT_BRACKET
+##
+## Ends in an error in state: 166.
+##
+## tff_conditional -> ITE_F LEFT_PAREN tff_logic_formula COMMA tff_logic_formula COMMA tff_logic_formula . RIGHT_PAREN [ XOR VLINE RIGHT_PAREN RIGHT_BRACKET NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV COMMA AND ]
+##
+## The known suffix of the stack is as follows:
+## ITE_F LEFT_PAREN tff_logic_formula COMMA tff_logic_formula COMMA tff_logic_formula
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 32, spurious reduction of production constant -> tptp_functor 
+## In state 55, spurious reduction of production plain_term -> constant 
+## In state 114, spurious reduction of production plain_atomic_formula -> plain_term 
+## In state 115, spurious reduction of production atomic_formula -> plain_atomic_formula 
+## In state 145, spurious reduction of production tff_unitary_formula -> atomic_formula 
+## In state 146, spurious reduction of production tff_logic_formula -> tff_unitary_formula 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA ITE_F LEFT_PAREN SINGLE_QUOTED COMMA SINGLE_QUOTED COMMA XOR
+##
+## Ends in an error in state: 165.
+##
+## tff_conditional -> ITE_F LEFT_PAREN tff_logic_formula COMMA tff_logic_formula COMMA . tff_logic_formula RIGHT_PAREN [ XOR VLINE RIGHT_PAREN RIGHT_BRACKET NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV COMMA AND ]
+##
+## The known suffix of the stack is as follows:
+## ITE_F LEFT_PAREN tff_logic_formula COMMA tff_logic_formula COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA ITE_F LEFT_PAREN SINGLE_QUOTED COMMA SINGLE_QUOTED RIGHT_PAREN
+##
+## Ends in an error in state: 164.
+##
+## tff_conditional -> ITE_F LEFT_PAREN tff_logic_formula COMMA tff_logic_formula . COMMA tff_logic_formula RIGHT_PAREN [ XOR VLINE RIGHT_PAREN RIGHT_BRACKET NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV COMMA AND ]
+##
+## The known suffix of the stack is as follows:
+## ITE_F LEFT_PAREN tff_logic_formula COMMA tff_logic_formula
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 32, spurious reduction of production constant -> tptp_functor 
+## In state 55, spurious reduction of production plain_term -> constant 
+## In state 114, spurious reduction of production plain_atomic_formula -> plain_term 
+## In state 115, spurious reduction of production atomic_formula -> plain_atomic_formula 
+## In state 145, spurious reduction of production tff_unitary_formula -> atomic_formula 
+## In state 146, spurious reduction of production tff_logic_formula -> tff_unitary_formula 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA ITE_F LEFT_PAREN SINGLE_QUOTED COMMA XOR
+##
+## Ends in an error in state: 163.
+##
+## tff_conditional -> ITE_F LEFT_PAREN tff_logic_formula COMMA . tff_logic_formula COMMA tff_logic_formula RIGHT_PAREN [ XOR VLINE RIGHT_PAREN RIGHT_BRACKET NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV COMMA AND ]
+##
+## The known suffix of the stack is as follows:
+## ITE_F LEFT_PAREN tff_logic_formula COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA ITE_F LEFT_PAREN SINGLE_QUOTED RIGHT_PAREN
+##
+## Ends in an error in state: 162.
+##
+## tff_conditional -> ITE_F LEFT_PAREN tff_logic_formula . COMMA tff_logic_formula COMMA tff_logic_formula RIGHT_PAREN [ XOR VLINE RIGHT_PAREN RIGHT_BRACKET NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV COMMA AND ]
+##
+## The known suffix of the stack is as follows:
+## ITE_F LEFT_PAREN tff_logic_formula
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 32, spurious reduction of production constant -> tptp_functor 
+## In state 55, spurious reduction of production plain_term -> constant 
+## In state 114, spurious reduction of production plain_atomic_formula -> plain_term 
+## In state 115, spurious reduction of production atomic_formula -> plain_atomic_formula 
+## In state 145, spurious reduction of production tff_unitary_formula -> atomic_formula 
+## In state 146, spurious reduction of production tff_logic_formula -> tff_unitary_formula 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA ITE_F LEFT_PAREN XOR
+##
+## Ends in an error in state: 124.
+##
+## tff_conditional -> ITE_F LEFT_PAREN . tff_logic_formula COMMA tff_logic_formula COMMA tff_logic_formula RIGHT_PAREN [ XOR VLINE RIGHT_PAREN RIGHT_BRACKET NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV COMMA AND ]
+##
+## The known suffix of the stack is as follows:
+## ITE_F LEFT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA ITE_F XOR
+##
+## Ends in an error in state: 123.
+##
+## tff_conditional -> ITE_F . LEFT_PAREN tff_logic_formula COMMA tff_logic_formula COMMA tff_logic_formula RIGHT_PAREN [ XOR VLINE RIGHT_PAREN RIGHT_BRACKET NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV COMMA AND ]
+##
+## The known suffix of the stack is as follows:
+## ITE_F
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LEFT_BRACKET RIGHT_BRACKET GENTZEN_ARROW XOR
+##
+## Ends in an error in state: 223.
+##
+## tff_sequent -> tff_tuple GENTZEN_ARROW . tff_tuple [ RIGHT_PAREN COMMA ]
+##
+## The known suffix of the stack is as follows:
+## tff_tuple GENTZEN_ARROW
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LEFT_BRACKET RIGHT_BRACKET XOR
+##
+## Ends in an error in state: 222.
+##
+## tff_sequent -> tff_tuple . GENTZEN_ARROW tff_tuple [ RIGHT_PAREN COMMA ]
+##
+## The known suffix of the stack is as follows:
+## tff_tuple
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LEFT_BRACKET SINGLE_QUOTED COMMA XOR
+##
+## Ends in an error in state: 185.
+##
+## tff_tuple_list -> tff_logic_formula COMMA . tff_tuple_list [ RIGHT_BRACKET ]
+##
+## The known suffix of the stack is as follows:
+## tff_logic_formula COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LEFT_BRACKET SINGLE_QUOTED RIGHT_PAREN
+##
+## Ends in an error in state: 184.
+##
+## tff_tuple_list -> tff_logic_formula . [ RIGHT_BRACKET ]
+## tff_tuple_list -> tff_logic_formula . COMMA tff_tuple_list [ RIGHT_BRACKET ]
+##
+## The known suffix of the stack is as follows:
+## tff_logic_formula
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 32, spurious reduction of production constant -> tptp_functor 
+## In state 55, spurious reduction of production plain_term -> constant 
+## In state 114, spurious reduction of production plain_atomic_formula -> plain_term 
+## In state 115, spurious reduction of production atomic_formula -> plain_atomic_formula 
+## In state 145, spurious reduction of production tff_unitary_formula -> atomic_formula 
+## In state 146, spurious reduction of production tff_logic_formula -> tff_unitary_formula 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LEFT_BRACKET XOR
+##
+## Ends in an error in state: 180.
+##
+## tff_tuple -> LEFT_BRACKET . RIGHT_BRACKET [ RIGHT_PAREN GENTZEN_ARROW COMMA ]
+## tff_tuple -> LEFT_BRACKET . tff_tuple_list RIGHT_BRACKET [ RIGHT_PAREN GENTZEN_ARROW COMMA ]
+##
+## The known suffix of the stack is as follows:
+## LEFT_BRACKET
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LEFT_PAREN LEFT_BRACKET RIGHT_BRACKET GENTZEN_ARROW LEFT_BRACKET RIGHT_BRACKET XOR
+##
+## Ends in an error in state: 225.
+##
+## tff_sequent -> LEFT_PAREN tff_sequent . RIGHT_PAREN [ RIGHT_PAREN COMMA ]
+##
+## The known suffix of the stack is as follows:
+## LEFT_PAREN tff_sequent
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LEFT_PAREN SINGLE_QUOTED COLON DOLLAR_WORD COMMA
+##
+## Ends in an error in state: 220.
+##
+## tff_typed_atom -> LEFT_PAREN tff_typed_atom . RIGHT_PAREN [ RIGHT_PAREN COMMA ]
+##
+## The known suffix of the stack is as follows:
+## LEFT_PAREN tff_typed_atom
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 218, spurious reduction of production tff_top_level_type -> tff_atomic_type 
+## In state 219, spurious reduction of production tff_typed_atom -> tff_untyped_atom COLON tff_top_level_type 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LEFT_PAREN SINGLE_QUOTED COMMA
+##
+## Ends in an error in state: 174.
+##
+## tff_unitary_formula -> LEFT_PAREN tff_logic_formula . RIGHT_PAREN [ XOR VLINE RIGHT_PAREN RIGHT_BRACKET NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV COMMA AND ]
+##
+## The known suffix of the stack is as follows:
+## LEFT_PAREN tff_logic_formula
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 187, spurious reduction of production constant -> tptp_functor 
+## In state 55, spurious reduction of production plain_term -> constant 
+## In state 114, spurious reduction of production plain_atomic_formula -> plain_term 
+## In state 115, spurious reduction of production atomic_formula -> plain_atomic_formula 
+## In state 145, spurious reduction of production tff_unitary_formula -> atomic_formula 
+## In state 146, spurious reduction of production tff_logic_formula -> tff_unitary_formula 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LEFT_PAREN XOR
+##
+## Ends in an error in state: 179.
+##
+## tff_sequent -> LEFT_PAREN . tff_sequent RIGHT_PAREN [ RIGHT_PAREN COMMA ]
+## tff_typed_atom -> LEFT_PAREN . tff_typed_atom RIGHT_PAREN [ RIGHT_PAREN COMMA ]
+## tff_unitary_formula -> LEFT_PAREN . tff_logic_formula RIGHT_PAREN [ XOR VLINE RIGHT_PAREN NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV COMMA AND ]
+##
+## The known suffix of the stack is as follows:
+## LEFT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LET_FF LEFT_PAREN SINGLE_QUOTED EQUIV DOLLAR_DOLLAR_WORD COMMA SINGLE_QUOTED COMMA
+##
+## Ends in an error in state: 231.
+##
+## tff_let -> LET_FF LEFT_PAREN tff_let_formula_defn COMMA tff_formula . RIGHT_PAREN [ XOR VLINE RIGHT_PAREN RIGHT_BRACKET NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV COMMA AND ]
+##
+## The known suffix of the stack is as follows:
+## LET_FF LEFT_PAREN tff_let_formula_defn COMMA tff_formula
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 187, spurious reduction of production constant -> tptp_functor 
+## In state 55, spurious reduction of production plain_term -> constant 
+## In state 114, spurious reduction of production plain_atomic_formula -> plain_term 
+## In state 115, spurious reduction of production atomic_formula -> plain_atomic_formula 
+## In state 145, spurious reduction of production tff_unitary_formula -> atomic_formula 
+## In state 146, spurious reduction of production tff_logic_formula -> tff_unitary_formula 
+## In state 230, spurious reduction of production tff_formula -> tff_logic_formula 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LET_FF LEFT_PAREN SINGLE_QUOTED EQUIV DOLLAR_DOLLAR_WORD COMMA XOR
+##
+## Ends in an error in state: 178.
+##
+## tff_let -> LET_FF LEFT_PAREN tff_let_formula_defn COMMA . tff_formula RIGHT_PAREN [ XOR VLINE RIGHT_PAREN RIGHT_BRACKET NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV COMMA AND ]
+##
+## The known suffix of the stack is as follows:
+## LET_FF LEFT_PAREN tff_let_formula_defn COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LET_FF LEFT_PAREN SINGLE_QUOTED EQUIV DOLLAR_DOLLAR_WORD XOR
+##
+## Ends in an error in state: 177.
+##
+## tff_let -> LET_FF LEFT_PAREN tff_let_formula_defn . COMMA tff_formula RIGHT_PAREN [ XOR VLINE RIGHT_PAREN RIGHT_BRACKET NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV COMMA AND ]
+##
+## The known suffix of the stack is as follows:
+## LET_FF LEFT_PAREN tff_let_formula_defn
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 37, spurious reduction of production system_constant -> system_functor 
+## In state 39, spurious reduction of production system_term -> system_constant 
+## In state 112, spurious reduction of production system_atomic_formula -> system_term 
+## In state 113, spurious reduction of production atomic_formula -> system_atomic_formula 
+## In state 145, spurious reduction of production tff_unitary_formula -> atomic_formula 
+## In state 176, spurious reduction of production tff_let_formula_binding -> atomic_formula EQUIV tff_unitary_formula 
+## In state 106, spurious reduction of production tff_let_formula_defn -> tff_let_formula_binding 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LET_FF LEFT_PAREN XOR
+##
+## Ends in an error in state: 99.
+##
+## tff_let -> LET_FF LEFT_PAREN . tff_let_formula_defn COMMA tff_formula RIGHT_PAREN [ XOR VLINE RIGHT_PAREN RIGHT_BRACKET NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV COMMA AND ]
+##
+## The known suffix of the stack is as follows:
+## LET_FF LEFT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LET_FF XOR
+##
+## Ends in an error in state: 98.
+##
+## tff_let -> LET_FF . LEFT_PAREN tff_let_formula_defn COMMA tff_formula RIGHT_PAREN [ XOR VLINE RIGHT_PAREN RIGHT_BRACKET NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV COMMA AND ]
+##
+## The known suffix of the stack is as follows:
+## LET_FF
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LET_TF LEFT_PAREN UPPER_WORD EQUAL DISTINCT_OBJECT COMMA SINGLE_QUOTED COMMA
+##
+## Ends in an error in state: 233.
+##
+## tff_let -> LET_TF LEFT_PAREN tff_let_term_defn COMMA tff_formula . RIGHT_PAREN [ XOR VLINE RIGHT_PAREN RIGHT_BRACKET NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV COMMA AND ]
+##
+## The known suffix of the stack is as follows:
+## LET_TF LEFT_PAREN tff_let_term_defn COMMA tff_formula
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 187, spurious reduction of production constant -> tptp_functor 
+## In state 55, spurious reduction of production plain_term -> constant 
+## In state 114, spurious reduction of production plain_atomic_formula -> plain_term 
+## In state 115, spurious reduction of production atomic_formula -> plain_atomic_formula 
+## In state 145, spurious reduction of production tff_unitary_formula -> atomic_formula 
+## In state 146, spurious reduction of production tff_logic_formula -> tff_unitary_formula 
+## In state 230, spurious reduction of production tff_formula -> tff_logic_formula 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LET_TF LEFT_PAREN UPPER_WORD EQUAL DISTINCT_OBJECT COMMA XOR
+##
+## Ends in an error in state: 97.
+##
+## tff_let -> LET_TF LEFT_PAREN tff_let_term_defn COMMA . tff_formula RIGHT_PAREN [ XOR VLINE RIGHT_PAREN RIGHT_BRACKET NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV COMMA AND ]
+##
+## The known suffix of the stack is as follows:
+## LET_TF LEFT_PAREN tff_let_term_defn COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LET_TF LEFT_PAREN UPPER_WORD EQUAL DISTINCT_OBJECT XOR
+##
+## Ends in an error in state: 96.
+##
+## tff_let -> LET_TF LEFT_PAREN tff_let_term_defn . COMMA tff_formula RIGHT_PAREN [ XOR VLINE RIGHT_PAREN RIGHT_BRACKET NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV COMMA AND ]
+##
+## The known suffix of the stack is as follows:
+## LET_TF LEFT_PAREN tff_let_term_defn
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LET_TF LEFT_PAREN XOR
+##
+## Ends in an error in state: 25.
+##
+## tff_let -> LET_TF LEFT_PAREN . tff_let_term_defn COMMA tff_formula RIGHT_PAREN [ XOR VLINE RIGHT_PAREN RIGHT_BRACKET NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV COMMA AND ]
+##
+## The known suffix of the stack is as follows:
+## LET_TF LEFT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LET_TF XOR
+##
+## Ends in an error in state: 24.
+##
+## tff_let -> LET_TF . LEFT_PAREN tff_let_term_defn COMMA tff_formula RIGHT_PAREN [ XOR VLINE RIGHT_PAREN RIGHT_BRACKET NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV COMMA AND ]
+##
+## The known suffix of the stack is as follows:
+## LET_TF
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA NOT LEFT_PAREN XOR
+##
+## Ends in an error in state: 122.
+##
+## tff_unitary_formula -> LEFT_PAREN . tff_logic_formula RIGHT_PAREN [ XOR VLINE RIGHT_PAREN RIGHT_BRACKET NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV COMMA AND ]
+##
+## The known suffix of the stack is as follows:
+## LEFT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA NOT XOR
+##
+## Ends in an error in state: 128.
+##
+## tff_unary_formula -> unary_connective . tff_unitary_formula [ XOR VLINE RIGHT_PAREN RIGHT_BRACKET NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV COMMA AND ]
+##
+## The known suffix of the stack is as follows:
+## unary_connective
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED AND DOLLAR_DOLLAR_WORD AND XOR
+##
+## Ends in an error in state: 172.
+##
+## tff_and_formula -> tff_and_formula AND . tff_unitary_formula [ RIGHT_PAREN RIGHT_BRACKET COMMA AND ]
+##
+## The known suffix of the stack is as follows:
+## tff_and_formula AND
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED AND DOLLAR_DOLLAR_WORD XOR
+##
+## Ends in an error in state: 171.
+##
+## tff_and_formula -> tff_and_formula . AND tff_unitary_formula [ RIGHT_PAREN RIGHT_BRACKET COMMA AND ]
+## tff_binary_assoc -> tff_and_formula . [ RIGHT_PAREN RIGHT_BRACKET COMMA ]
+##
+## The known suffix of the stack is as follows:
+## tff_and_formula
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 37, spurious reduction of production system_constant -> system_functor 
+## In state 39, spurious reduction of production system_term -> system_constant 
+## In state 112, spurious reduction of production system_atomic_formula -> system_term 
+## In state 113, spurious reduction of production atomic_formula -> system_atomic_formula 
+## In state 145, spurious reduction of production tff_unitary_formula -> atomic_formula 
+## In state 156, spurious reduction of production tff_and_formula -> tff_unitary_formula AND tff_unitary_formula 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED AND XOR
+##
+## Ends in an error in state: 155.
+##
+## tff_and_formula -> tff_unitary_formula AND . tff_unitary_formula [ RIGHT_PAREN RIGHT_BRACKET COMMA AND ]
+##
+## The known suffix of the stack is as follows:
+## tff_unitary_formula AND
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED COLON FORALL_TY LEFT_BRACKET UPPER_WORD RIGHT_BRACKET COLON LEFT_PAREN LEFT_PAREN UPPER_WORD XOR
+##
+## Ends in an error in state: 202.
+##
+## tff_xprod_type -> tff_unitary_type . STAR tff_atomic_type [ STAR RIGHT_PAREN ]
+##
+## The known suffix of the stack is as follows:
+## tff_unitary_type
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED COLON FORALL_TY LEFT_BRACKET UPPER_WORD RIGHT_BRACKET COLON LEFT_PAREN LEFT_PAREN XOR
+##
+## Ends in an error in state: 197.
+##
+## tff_unitary_type -> LEFT_PAREN . tff_xprod_type RIGHT_PAREN [ STAR ARROW ]
+##
+## The known suffix of the stack is as follows:
+## LEFT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED COLON FORALL_TY LEFT_BRACKET UPPER_WORD RIGHT_BRACKET COLON LEFT_PAREN UPPER_WORD ARROW DOLLAR_WORD XOR
+##
+## Ends in an error in state: 209.
+##
+## tff_monotype -> LEFT_PAREN tff_mapping_type . RIGHT_PAREN [ RIGHT_PAREN COMMA ]
+##
+## The known suffix of the stack is as follows:
+## LEFT_PAREN tff_mapping_type
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED COLON FORALL_TY LEFT_BRACKET UPPER_WORD RIGHT_BRACKET COLON LEFT_PAREN XOR
+##
+## Ends in an error in state: 196.
+##
+## tff_monotype -> LEFT_PAREN . tff_mapping_type RIGHT_PAREN [ RIGHT_PAREN COMMA ]
+##
+## The known suffix of the stack is as follows:
+## LEFT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED COLON FORALL_TY LEFT_BRACKET UPPER_WORD RIGHT_BRACKET COLON XOR
+##
+## Ends in an error in state: 195.
+##
+## tff_quantified_type -> FORALL_TY LEFT_BRACKET tff_variable_list RIGHT_BRACKET COLON . tff_monotype [ RIGHT_PAREN COMMA ]
+##
+## The known suffix of the stack is as follows:
+## FORALL_TY LEFT_BRACKET tff_variable_list RIGHT_BRACKET COLON
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED COLON FORALL_TY LEFT_BRACKET UPPER_WORD RIGHT_BRACKET XOR
+##
+## Ends in an error in state: 194.
+##
+## tff_quantified_type -> FORALL_TY LEFT_BRACKET tff_variable_list RIGHT_BRACKET . COLON tff_monotype [ RIGHT_PAREN COMMA ]
+##
+## The known suffix of the stack is as follows:
+## FORALL_TY LEFT_BRACKET tff_variable_list RIGHT_BRACKET
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED COLON FORALL_TY LEFT_BRACKET XOR
+##
+## Ends in an error in state: 192.
+##
+## tff_quantified_type -> FORALL_TY LEFT_BRACKET . tff_variable_list RIGHT_BRACKET COLON tff_monotype [ RIGHT_PAREN COMMA ]
+##
+## The known suffix of the stack is as follows:
+## FORALL_TY LEFT_BRACKET
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED COLON FORALL_TY XOR
+##
+## Ends in an error in state: 191.
+##
+## tff_quantified_type -> FORALL_TY . LEFT_BRACKET tff_variable_list RIGHT_BRACKET COLON tff_monotype [ RIGHT_PAREN COMMA ]
+##
+## The known suffix of the stack is as follows:
+## FORALL_TY
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED COLON LEFT_PAREN LEFT_PAREN UPPER_WORD STAR DOLLAR_WORD RIGHT_PAREN XOR
+##
+## Ends in an error in state: 213.
+##
+## tff_mapping_type -> tff_unitary_type . ARROW tff_atomic_type [ RIGHT_PAREN ]
+## tff_xprod_type -> tff_unitary_type . STAR tff_atomic_type [ STAR RIGHT_PAREN ]
+##
+## The known suffix of the stack is as follows:
+## tff_unitary_type
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED COLON LEFT_PAREN UPPER_WORD COMMA
+##
+## Ends in an error in state: 214.
+##
+## tff_top_level_type -> LEFT_PAREN tff_top_level_type . RIGHT_PAREN [ RIGHT_PAREN COMMA ]
+##
+## The known suffix of the stack is as follows:
+## LEFT_PAREN tff_top_level_type
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 218, spurious reduction of production tff_top_level_type -> tff_atomic_type 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED COLON LEFT_PAREN UPPER_WORD STAR DOLLAR_WORD STAR XOR
+##
+## Ends in an error in state: 199.
+##
+## tff_xprod_type -> tff_xprod_type STAR . tff_atomic_type [ STAR RIGHT_PAREN ]
+##
+## The known suffix of the stack is as follows:
+## tff_xprod_type STAR
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED COLON LEFT_PAREN UPPER_WORD STAR DOLLAR_WORD XOR
+##
+## Ends in an error in state: 198.
+##
+## tff_unitary_type -> LEFT_PAREN tff_xprod_type . RIGHT_PAREN [ STAR ARROW ]
+## tff_xprod_type -> tff_xprod_type . STAR tff_atomic_type [ STAR RIGHT_PAREN ]
+##
+## The known suffix of the stack is as follows:
+## LEFT_PAREN tff_xprod_type
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED COLON LEFT_PAREN UPPER_WORD STAR XOR
+##
+## Ends in an error in state: 203.
+##
+## tff_xprod_type -> tff_unitary_type STAR . tff_atomic_type [ STAR RIGHT_PAREN ]
+##
+## The known suffix of the stack is as follows:
+## tff_unitary_type STAR
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED COLON LEFT_PAREN XOR
+##
+## Ends in an error in state: 190.
+##
+## tff_top_level_type -> LEFT_PAREN . tff_top_level_type RIGHT_PAREN [ RIGHT_PAREN COMMA ]
+## tff_unitary_type -> LEFT_PAREN . tff_xprod_type RIGHT_PAREN [ STAR ARROW ]
+##
+## The known suffix of the stack is as follows:
+## LEFT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED COLON SINGLE_QUOTED LEFT_PAREN UPPER_WORD COMMA XOR
+##
+## Ends in an error in state: 84.
+##
+## tff_type_arguments -> tff_atomic_type COMMA . tff_type_arguments [ RIGHT_PAREN ]
+##
+## The known suffix of the stack is as follows:
+## tff_atomic_type COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED COLON SINGLE_QUOTED LEFT_PAREN UPPER_WORD XOR
+##
+## Ends in an error in state: 83.
+##
+## tff_type_arguments -> tff_atomic_type . [ RIGHT_PAREN ]
+## tff_type_arguments -> tff_atomic_type . COMMA tff_type_arguments [ RIGHT_PAREN ]
+##
+## The known suffix of the stack is as follows:
+## tff_atomic_type
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED COLON SINGLE_QUOTED LEFT_PAREN XOR
+##
+## Ends in an error in state: 80.
+##
+## tff_atomic_type -> atomic_word LEFT_PAREN . tff_type_arguments RIGHT_PAREN [ STAR RIGHT_PAREN RIGHT_BRACKET COMMA ARROW ]
+##
+## The known suffix of the stack is as follows:
+## atomic_word LEFT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED COLON SINGLE_QUOTED XOR
+##
+## Ends in an error in state: 79.
+##
+## tff_atomic_type -> atomic_word . [ STAR RIGHT_PAREN RIGHT_BRACKET COMMA ARROW ]
+## tff_atomic_type -> atomic_word . LEFT_PAREN tff_type_arguments RIGHT_PAREN [ STAR RIGHT_PAREN RIGHT_BRACKET COMMA ARROW ]
+##
+## The known suffix of the stack is as follows:
+## atomic_word
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED COLON UPPER_WORD ARROW XOR
+##
+## Ends in an error in state: 207.
+##
+## tff_mapping_type -> tff_unitary_type ARROW . tff_atomic_type [ RIGHT_PAREN COMMA ]
+##
+## The known suffix of the stack is as follows:
+## tff_unitary_type ARROW
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED COLON UPPER_WORD STAR
+##
+## Ends in an error in state: 206.
+##
+## tff_mapping_type -> tff_unitary_type . ARROW tff_atomic_type [ RIGHT_PAREN COMMA ]
+##
+## The known suffix of the stack is as follows:
+## tff_unitary_type
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 218, spurious reduction of production tff_unitary_type -> tff_atomic_type 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED COLON UPPER_WORD XOR
+##
+## Ends in an error in state: 218.
+##
+## tff_top_level_type -> tff_atomic_type . [ RIGHT_PAREN COMMA ]
+## tff_unitary_type -> tff_atomic_type . [ STAR ARROW ]
+##
+## The known suffix of the stack is as follows:
+## tff_atomic_type
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED COLON XOR
+##
+## Ends in an error in state: 189.
+##
+## tff_typed_atom -> tff_untyped_atom COLON . tff_top_level_type [ RIGHT_PAREN COMMA ]
+##
+## The known suffix of the stack is as follows:
+## tff_untyped_atom COLON
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED COMMA DISTINCT_OBJECT COMMA LEFT_BRACKET RIGHT_BRACKET XOR
+##
+## Ends in an error in state: 514.
+##
+## tff_annotated -> TFF LEFT_PAREN name COMMA formula_role COMMA tff_formula annotations . RIGHT_PAREN DOT [ TPI THF TFF INCLUDE FOF EOF CNF ]
+##
+## The known suffix of the stack is as follows:
+## TFF LEFT_PAREN name COMMA formula_role COMMA tff_formula annotations
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED RIGHT_PAREN XOR
+##
+## Ends in an error in state: 515.
+##
+## tff_annotated -> TFF LEFT_PAREN name COMMA formula_role COMMA tff_formula annotations RIGHT_PAREN . DOT [ TPI THF TFF INCLUDE FOF EOF CNF ]
+##
+## The known suffix of the stack is as follows:
+## TFF LEFT_PAREN name COMMA formula_role COMMA tff_formula annotations RIGHT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED UPPER_WORD
+##
+## Ends in an error in state: 187.
+##
+## constant -> tptp_functor . [ XOR VLINE RIGHT_PAREN NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA AND ]
+## plain_term -> tptp_functor . LEFT_PAREN arguments RIGHT_PAREN [ XOR VLINE RIGHT_PAREN NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA AND ]
+## tff_untyped_atom -> tptp_functor . [ COLON ]
+##
+## The known suffix of the stack is as follows:
+## tptp_functor
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED VLINE DOLLAR_DOLLAR_WORD VLINE XOR
+##
+## Ends in an error in state: 160.
+##
+## tff_or_formula -> tff_or_formula VLINE . tff_unitary_formula [ VLINE RIGHT_PAREN RIGHT_BRACKET COMMA ]
+##
+## The known suffix of the stack is as follows:
+## tff_or_formula VLINE
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED VLINE DOLLAR_DOLLAR_WORD XOR
+##
+## Ends in an error in state: 159.
+##
+## tff_binary_assoc -> tff_or_formula . [ RIGHT_PAREN RIGHT_BRACKET COMMA ]
+## tff_or_formula -> tff_or_formula . VLINE tff_unitary_formula [ VLINE RIGHT_PAREN RIGHT_BRACKET COMMA ]
+##
+## The known suffix of the stack is as follows:
+## tff_or_formula
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 37, spurious reduction of production system_constant -> system_functor 
+## In state 39, spurious reduction of production system_term -> system_constant 
+## In state 112, spurious reduction of production system_atomic_formula -> system_term 
+## In state 113, spurious reduction of production atomic_formula -> system_atomic_formula 
+## In state 145, spurious reduction of production tff_unitary_formula -> atomic_formula 
+## In state 149, spurious reduction of production tff_or_formula -> tff_unitary_formula VLINE tff_unitary_formula 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED VLINE XOR
+##
+## Ends in an error in state: 148.
+##
+## tff_or_formula -> tff_unitary_formula VLINE . tff_unitary_formula [ VLINE RIGHT_PAREN RIGHT_BRACKET COMMA ]
+##
+## The known suffix of the stack is as follows:
+## tff_unitary_formula VLINE
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED XOR XOR
+##
+## Ends in an error in state: 157.
+##
+## tff_binary_nonassoc -> tff_unitary_formula binary_connective . tff_unitary_formula [ RIGHT_PAREN RIGHT_BRACKET COMMA ]
+##
+## The known suffix of the stack is as follows:
+## tff_unitary_formula binary_connective
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA UPPER_WORD EQUAL UPPER_WORD UPPER_WORD
+##
+## Ends in an error in state: 146.
+##
+## tff_and_formula -> tff_unitary_formula . AND tff_unitary_formula [ RIGHT_PAREN RIGHT_BRACKET COMMA AND ]
+## tff_binary_nonassoc -> tff_unitary_formula . binary_connective tff_unitary_formula [ RIGHT_PAREN RIGHT_BRACKET COMMA ]
+## tff_logic_formula -> tff_unitary_formula . [ RIGHT_PAREN RIGHT_BRACKET COMMA ]
+## tff_or_formula -> tff_unitary_formula . VLINE tff_unitary_formula [ VLINE RIGHT_PAREN RIGHT_BRACKET COMMA ]
+##
+## The known suffix of the stack is as follows:
+## tff_unitary_formula
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA XOR
+##
+## Ends in an error in state: 512.
+##
+## tff_annotated -> TFF LEFT_PAREN name COMMA formula_role COMMA . tff_formula annotations RIGHT_PAREN DOT [ TPI THF TFF INCLUDE FOF EOF CNF ]
+##
+## The known suffix of the stack is as follows:
+## TFF LEFT_PAREN name COMMA formula_role COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD XOR
+##
+## Ends in an error in state: 511.
+##
+## tff_annotated -> TFF LEFT_PAREN name COMMA formula_role . COMMA tff_formula annotations RIGHT_PAREN DOT [ TPI THF TFF INCLUDE FOF EOF CNF ]
+##
+## The known suffix of the stack is as follows:
+## TFF LEFT_PAREN name COMMA formula_role
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED COMMA XOR
+##
+## Ends in an error in state: 510.
+##
+## tff_annotated -> TFF LEFT_PAREN name COMMA . formula_role COMMA tff_formula annotations RIGHT_PAREN DOT [ TPI THF TFF INCLUDE FOF EOF CNF ]
+##
+## The known suffix of the stack is as follows:
+## TFF LEFT_PAREN name COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN SINGLE_QUOTED XOR
+##
+## Ends in an error in state: 509.
+##
+## tff_annotated -> TFF LEFT_PAREN name . COMMA formula_role COMMA tff_formula annotations RIGHT_PAREN DOT [ TPI THF TFF INCLUDE FOF EOF CNF ]
+##
+## The known suffix of the stack is as follows:
+## TFF LEFT_PAREN name
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF LEFT_PAREN XOR
+##
+## Ends in an error in state: 508.
+##
+## tff_annotated -> TFF LEFT_PAREN . name COMMA formula_role COMMA tff_formula annotations RIGHT_PAREN DOT [ TPI THF TFF INCLUDE FOF EOF CNF ]
+##
+## The known suffix of the stack is as follows:
+## TFF LEFT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TFF XOR
+##
+## Ends in an error in state: 507.
+##
+## tff_annotated -> TFF . LEFT_PAREN name COMMA formula_role COMMA tff_formula annotations RIGHT_PAREN DOT [ TPI THF TFF INCLUDE FOF EOF CNF ]
+##
+## The known suffix of the stack is as follows:
+## TFF
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA ITE_F LEFT_PAREN TPI
+##
+## Ends in an error in state: 328.
+##
+## thf_conditional -> ITE_F LEFT_PAREN . thf_logic_formula COMMA thf_logic_formula COMMA thf_logic_formula RIGHT_PAREN [ XOR VLINE STAR RIGHT_PAREN RIGHT_BRACKET PLUS NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA ARROW APPLY AND ]
+##
+## The known suffix of the stack is as follows:
+## ITE_F LEFT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA ITE_F LEFT_PAREN XOR COMMA TPI
+##
+## Ends in an error in state: 403.
+##
+## thf_conditional -> ITE_F LEFT_PAREN thf_logic_formula COMMA . thf_logic_formula COMMA thf_logic_formula RIGHT_PAREN [ XOR VLINE STAR RIGHT_PAREN RIGHT_BRACKET PLUS NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA ARROW APPLY AND ]
+##
+## The known suffix of the stack is as follows:
+## ITE_F LEFT_PAREN thf_logic_formula COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA ITE_F LEFT_PAREN XOR COMMA XOR COMMA TPI
+##
+## Ends in an error in state: 405.
+##
+## thf_conditional -> ITE_F LEFT_PAREN thf_logic_formula COMMA thf_logic_formula COMMA . thf_logic_formula RIGHT_PAREN [ XOR VLINE STAR RIGHT_PAREN RIGHT_BRACKET PLUS NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA ARROW APPLY AND ]
+##
+## The known suffix of the stack is as follows:
+## ITE_F LEFT_PAREN thf_logic_formula COMMA thf_logic_formula COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA ITE_F LEFT_PAREN XOR COMMA XOR COMMA XOR RIGHT_BRACKET
+##
+## Ends in an error in state: 406.
+##
+## thf_conditional -> ITE_F LEFT_PAREN thf_logic_formula COMMA thf_logic_formula COMMA thf_logic_formula . RIGHT_PAREN [ XOR VLINE STAR RIGHT_PAREN RIGHT_BRACKET PLUS NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA ARROW APPLY AND ]
+##
+## The known suffix of the stack is as follows:
+## ITE_F LEFT_PAREN thf_logic_formula COMMA thf_logic_formula COMMA thf_logic_formula
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 379, spurious reduction of production thf_unitary_formula -> thf_atom 
+## In state 341, spurious reduction of production thf_logic_formula -> thf_unitary_formula 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA ITE_F LEFT_PAREN XOR COMMA XOR RIGHT_PAREN
+##
+## Ends in an error in state: 404.
+##
+## thf_conditional -> ITE_F LEFT_PAREN thf_logic_formula COMMA thf_logic_formula . COMMA thf_logic_formula RIGHT_PAREN [ XOR VLINE STAR RIGHT_PAREN RIGHT_BRACKET PLUS NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA ARROW APPLY AND ]
+##
+## The known suffix of the stack is as follows:
+## ITE_F LEFT_PAREN thf_logic_formula COMMA thf_logic_formula
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 379, spurious reduction of production thf_unitary_formula -> thf_atom 
+## In state 341, spurious reduction of production thf_logic_formula -> thf_unitary_formula 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA ITE_F LEFT_PAREN XOR RIGHT_PAREN
+##
+## Ends in an error in state: 402.
+##
+## thf_conditional -> ITE_F LEFT_PAREN thf_logic_formula . COMMA thf_logic_formula COMMA thf_logic_formula RIGHT_PAREN [ XOR VLINE STAR RIGHT_PAREN RIGHT_BRACKET PLUS NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA ARROW APPLY AND ]
+##
+## The known suffix of the stack is as follows:
+## ITE_F LEFT_PAREN thf_logic_formula
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 379, spurious reduction of production thf_unitary_formula -> thf_atom 
+## In state 341, spurious reduction of production thf_logic_formula -> thf_unitary_formula 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA ITE_F XOR
+##
+## Ends in an error in state: 327.
+##
+## thf_conditional -> ITE_F . LEFT_PAREN thf_logic_formula COMMA thf_logic_formula COMMA thf_logic_formula RIGHT_PAREN [ XOR VLINE STAR RIGHT_PAREN RIGHT_BRACKET PLUS NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA ARROW APPLY AND ]
+##
+## The known suffix of the stack is as follows:
+## ITE_F
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LAMBDA LEFT_BRACKET UPPER_WORD COLON AND RIGHT_PAREN
+##
+## Ends in an error in state: 429.
+##
+## thf_variable_list -> thf_variable . [ RIGHT_BRACKET ]
+## thf_variable_list -> thf_variable . COMMA thf_variable_list [ RIGHT_BRACKET ]
+##
+## The known suffix of the stack is as follows:
+## thf_variable
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 379, spurious reduction of production thf_unitary_formula -> thf_atom 
+## In state 341, spurious reduction of production thf_logic_formula -> thf_unitary_formula 
+## In state 374, spurious reduction of production thf_top_level_type -> thf_logic_formula 
+## In state 424, spurious reduction of production thf_typed_variable -> variable COLON thf_top_level_type 
+## In state 432, spurious reduction of production thf_variable -> thf_typed_variable 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LAMBDA LEFT_BRACKET UPPER_WORD COLON TPI
+##
+## Ends in an error in state: 317.
+##
+## thf_typed_variable -> variable COLON . thf_top_level_type [ RIGHT_BRACKET COMMA ]
+##
+## The known suffix of the stack is as follows:
+## variable COLON
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LAMBDA LEFT_BRACKET UPPER_WORD COMMA XOR
+##
+## Ends in an error in state: 430.
+##
+## thf_variable_list -> thf_variable COMMA . thf_variable_list [ RIGHT_BRACKET ]
+##
+## The known suffix of the stack is as follows:
+## thf_variable COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LAMBDA LEFT_BRACKET UPPER_WORD RIGHT_BRACKET COLON TPI
+##
+## Ends in an error in state: 427.
+##
+## thf_quantified_formula -> thf_quantifier LEFT_BRACKET thf_variable_list RIGHT_BRACKET COLON . thf_unitary_formula [ XOR VLINE STAR RIGHT_PAREN RIGHT_BRACKET PLUS NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA ARROW APPLY AND ]
+##
+## The known suffix of the stack is as follows:
+## thf_quantifier LEFT_BRACKET thf_variable_list RIGHT_BRACKET COLON
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LAMBDA LEFT_BRACKET UPPER_WORD RIGHT_BRACKET XOR
+##
+## Ends in an error in state: 426.
+##
+## thf_quantified_formula -> thf_quantifier LEFT_BRACKET thf_variable_list RIGHT_BRACKET . COLON thf_unitary_formula [ XOR VLINE STAR RIGHT_PAREN RIGHT_BRACKET PLUS NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA ARROW APPLY AND ]
+##
+## The known suffix of the stack is as follows:
+## thf_quantifier LEFT_BRACKET thf_variable_list RIGHT_BRACKET
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LAMBDA LEFT_BRACKET UPPER_WORD XOR
+##
+## Ends in an error in state: 316.
+##
+## thf_typed_variable -> variable . COLON thf_top_level_type [ RIGHT_BRACKET COMMA ]
+## thf_variable -> variable . [ RIGHT_BRACKET COMMA ]
+##
+## The known suffix of the stack is as follows:
+## variable
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LAMBDA LEFT_BRACKET XOR
+##
+## Ends in an error in state: 315.
+##
+## thf_quantified_formula -> thf_quantifier LEFT_BRACKET . thf_variable_list RIGHT_BRACKET COLON thf_unitary_formula [ XOR VLINE STAR RIGHT_PAREN RIGHT_BRACKET PLUS NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA ARROW APPLY AND ]
+##
+## The known suffix of the stack is as follows:
+## thf_quantifier LEFT_BRACKET
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LAMBDA XOR
+##
+## Ends in an error in state: 314.
+##
+## thf_quantified_formula -> thf_quantifier . LEFT_BRACKET thf_variable_list RIGHT_BRACKET COLON thf_unitary_formula [ XOR VLINE STAR RIGHT_PAREN RIGHT_BRACKET PLUS NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA ARROW APPLY AND ]
+##
+## The known suffix of the stack is as follows:
+## thf_quantifier
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LEFT_BRACKET LEFT_PAREN TPI
+##
+## Ends in an error in state: 326.
+##
+## thf_typeable_formula -> LEFT_PAREN . thf_logic_formula RIGHT_PAREN [ COLON ]
+## thf_unitary_formula -> LEFT_PAREN . thf_logic_formula RIGHT_PAREN [ XOR VLINE STAR RIGHT_PAREN RIGHT_BRACKET PLUS NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA ARROW APPLY AND ]
+##
+## The known suffix of the stack is as follows:
+## LEFT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LEFT_BRACKET RIGHT_BRACKET GENTZEN_ARROW XOR
+##
+## Ends in an error in state: 416.
+##
+## thf_sequent -> thf_tuple GENTZEN_ARROW . thf_tuple [ RIGHT_PAREN COMMA ]
+##
+## The known suffix of the stack is as follows:
+## thf_tuple GENTZEN_ARROW
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LEFT_BRACKET RIGHT_BRACKET XOR
+##
+## Ends in an error in state: 415.
+##
+## thf_sequent -> thf_tuple . GENTZEN_ARROW thf_tuple [ RIGHT_PAREN COMMA ]
+##
+## The known suffix of the stack is as follows:
+## thf_tuple
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LEFT_BRACKET TPI
+##
+## Ends in an error in state: 324.
+##
+## thf_tuple -> LEFT_BRACKET . RIGHT_BRACKET [ RIGHT_PAREN GENTZEN_ARROW COMMA ]
+## thf_tuple -> LEFT_BRACKET . thf_tuple_list RIGHT_BRACKET [ RIGHT_PAREN GENTZEN_ARROW COMMA ]
+##
+## The known suffix of the stack is as follows:
+## LEFT_BRACKET
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LEFT_BRACKET XOR COMMA TPI
+##
+## Ends in an error in state: 413.
+##
+## thf_tuple_list -> thf_logic_formula COMMA . thf_tuple_list [ RIGHT_BRACKET ]
+##
+## The known suffix of the stack is as follows:
+## thf_logic_formula COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LEFT_BRACKET XOR RIGHT_PAREN
+##
+## Ends in an error in state: 412.
+##
+## thf_tuple_list -> thf_logic_formula . [ RIGHT_BRACKET ]
+## thf_tuple_list -> thf_logic_formula . COMMA thf_tuple_list [ RIGHT_BRACKET ]
+##
+## The known suffix of the stack is as follows:
+## thf_logic_formula
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 379, spurious reduction of production thf_unitary_formula -> thf_atom 
+## In state 341, spurious reduction of production thf_logic_formula -> thf_unitary_formula 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LEFT_PAREN LEFT_BRACKET RIGHT_BRACKET GENTZEN_ARROW LEFT_BRACKET RIGHT_BRACKET XOR
+##
+## Ends in an error in state: 418.
+##
+## thf_sequent -> LEFT_PAREN thf_sequent . RIGHT_PAREN [ RIGHT_PAREN COMMA ]
+##
+## The known suffix of the stack is as follows:
+## LEFT_PAREN thf_sequent
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LEFT_PAREN TPI
+##
+## Ends in an error in state: 323.
+##
+## thf_sequent -> LEFT_PAREN . thf_sequent RIGHT_PAREN [ RIGHT_PAREN COMMA ]
+## thf_typeable_formula -> LEFT_PAREN . thf_logic_formula RIGHT_PAREN [ COLON ]
+## thf_unitary_formula -> LEFT_PAREN . thf_logic_formula RIGHT_PAREN [ XOR VLINE STAR RIGHT_PAREN PLUS NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA ARROW APPLY AND ]
+##
+## The known suffix of the stack is as follows:
+## LEFT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LEFT_PAREN XOR RIGHT_BRACKET
+##
+## Ends in an error in state: 408.
+##
+## thf_typeable_formula -> LEFT_PAREN thf_logic_formula . RIGHT_PAREN [ COLON ]
+## thf_unitary_formula -> LEFT_PAREN thf_logic_formula . RIGHT_PAREN [ XOR VLINE STAR RIGHT_PAREN RIGHT_BRACKET PLUS NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA ARROW APPLY AND ]
+##
+## The known suffix of the stack is as follows:
+## LEFT_PAREN thf_logic_formula
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 379, spurious reduction of production thf_unitary_formula -> thf_atom 
+## In state 341, spurious reduction of production thf_logic_formula -> thf_unitary_formula 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LEFT_PAREN XOR RIGHT_PAREN UPPER_WORD
+##
+## Ends in an error in state: 409.
+##
+## thf_typeable_formula -> LEFT_PAREN thf_logic_formula RIGHT_PAREN . [ COLON ]
+## thf_unitary_formula -> LEFT_PAREN thf_logic_formula RIGHT_PAREN . [ XOR VLINE STAR RIGHT_PAREN RIGHT_BRACKET PLUS NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA ARROW APPLY AND ]
+##
+## The known suffix of the stack is as follows:
+## LEFT_PAREN thf_logic_formula RIGHT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LET_FF LEFT_PAREN LAMBDA LEFT_BRACKET UPPER_WORD RIGHT_BRACKET COLON AND COMMA TPI
+##
+## Ends in an error in state: 322.
+##
+## thf_let -> LET_FF LEFT_PAREN thf_let_formula_defn COMMA . thf_formula RIGHT_PAREN [ XOR VLINE STAR RIGHT_PAREN RIGHT_BRACKET PLUS NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA ARROW APPLY AND ]
+##
+## The known suffix of the stack is as follows:
+## LET_FF LEFT_PAREN thf_let_formula_defn COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LET_FF LEFT_PAREN LAMBDA LEFT_BRACKET UPPER_WORD RIGHT_BRACKET COLON AND COMMA XOR RIGHT_BRACKET
+##
+## Ends in an error in state: 422.
+##
+## thf_let -> LET_FF LEFT_PAREN thf_let_formula_defn COMMA thf_formula . RIGHT_PAREN [ XOR VLINE STAR RIGHT_PAREN RIGHT_BRACKET PLUS NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA ARROW APPLY AND ]
+##
+## The known suffix of the stack is as follows:
+## LET_FF LEFT_PAREN thf_let_formula_defn COMMA thf_formula
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 379, spurious reduction of production thf_unitary_formula -> thf_atom 
+## In state 341, spurious reduction of production thf_logic_formula -> thf_unitary_formula 
+## In state 421, spurious reduction of production thf_formula -> thf_logic_formula 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LET_FF LEFT_PAREN LAMBDA LEFT_BRACKET UPPER_WORD RIGHT_BRACKET COLON AND XOR
+##
+## Ends in an error in state: 321.
+##
+## thf_let -> LET_FF LEFT_PAREN thf_let_formula_defn . COMMA thf_formula RIGHT_PAREN [ XOR VLINE STAR RIGHT_PAREN RIGHT_BRACKET PLUS NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA ARROW APPLY AND ]
+##
+## The known suffix of the stack is as follows:
+## LET_FF LEFT_PAREN thf_let_formula_defn
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LET_FF LEFT_PAREN XOR
+##
+## Ends in an error in state: 319.
+##
+## thf_let -> LET_FF LEFT_PAREN . thf_let_formula_defn COMMA thf_formula RIGHT_PAREN [ XOR VLINE STAR RIGHT_PAREN RIGHT_BRACKET PLUS NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA ARROW APPLY AND ]
+##
+## The known suffix of the stack is as follows:
+## LET_FF LEFT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LET_FF XOR
+##
+## Ends in an error in state: 318.
+##
+## thf_let -> LET_FF . LEFT_PAREN thf_let_formula_defn COMMA thf_formula RIGHT_PAREN [ XOR VLINE STAR RIGHT_PAREN RIGHT_BRACKET PLUS NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA ARROW APPLY AND ]
+##
+## The known suffix of the stack is as follows:
+## LET_FF
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LET_TF LEFT_PAREN LAMBDA LEFT_BRACKET UPPER_WORD RIGHT_BRACKET COLON AND COMMA TPI
+##
+## Ends in an error in state: 435.
+##
+## thf_let -> LET_TF LEFT_PAREN thf_let_term_defn COMMA . thf_formula RIGHT_PAREN [ XOR VLINE STAR RIGHT_PAREN RIGHT_BRACKET PLUS NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA ARROW APPLY AND ]
+##
+## The known suffix of the stack is as follows:
+## LET_TF LEFT_PAREN thf_let_term_defn COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LET_TF LEFT_PAREN LAMBDA LEFT_BRACKET UPPER_WORD RIGHT_BRACKET COLON AND COMMA XOR RIGHT_BRACKET
+##
+## Ends in an error in state: 436.
+##
+## thf_let -> LET_TF LEFT_PAREN thf_let_term_defn COMMA thf_formula . RIGHT_PAREN [ XOR VLINE STAR RIGHT_PAREN RIGHT_BRACKET PLUS NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA ARROW APPLY AND ]
+##
+## The known suffix of the stack is as follows:
+## LET_TF LEFT_PAREN thf_let_term_defn COMMA thf_formula
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 379, spurious reduction of production thf_unitary_formula -> thf_atom 
+## In state 341, spurious reduction of production thf_logic_formula -> thf_unitary_formula 
+## In state 421, spurious reduction of production thf_formula -> thf_logic_formula 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LET_TF LEFT_PAREN LAMBDA LEFT_BRACKET UPPER_WORD RIGHT_BRACKET COLON AND XOR
+##
+## Ends in an error in state: 434.
+##
+## thf_let -> LET_TF LEFT_PAREN thf_let_term_defn . COMMA thf_formula RIGHT_PAREN [ XOR VLINE STAR RIGHT_PAREN RIGHT_BRACKET PLUS NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA ARROW APPLY AND ]
+##
+## The known suffix of the stack is as follows:
+## LET_TF LEFT_PAREN thf_let_term_defn
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LET_TF LEFT_PAREN XOR
+##
+## Ends in an error in state: 308.
+##
+## thf_let -> LET_TF LEFT_PAREN . thf_let_term_defn COMMA thf_formula RIGHT_PAREN [ XOR VLINE STAR RIGHT_PAREN RIGHT_BRACKET PLUS NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA ARROW APPLY AND ]
+##
+## The known suffix of the stack is as follows:
+## LET_TF LEFT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LET_TF XOR
+##
+## Ends in an error in state: 307.
+##
+## thf_let -> LET_TF . LEFT_PAREN thf_let_term_defn COMMA thf_formula RIGHT_PAREN [ XOR VLINE STAR RIGHT_PAREN RIGHT_BRACKET PLUS NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA ARROW APPLY AND ]
+##
+## The known suffix of the stack is as follows:
+## LET_TF
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SIGMA LEFT_PAREN AND RIGHT_PAREN UPPER_WORD
+##
+## Ends in an error in state: 341.
+##
+## thf_and_formula -> thf_unitary_formula . AND thf_unitary_formula [ RIGHT_PAREN RIGHT_BRACKET COMMA AND ]
+## thf_apply_formula -> thf_unitary_formula . APPLY thf_unitary_formula [ RIGHT_PAREN RIGHT_BRACKET COMMA APPLY ]
+## thf_binary_pair -> thf_unitary_formula . thf_pair_connective thf_unitary_formula [ RIGHT_PAREN RIGHT_BRACKET COMMA ]
+## thf_logic_formula -> thf_unitary_formula . [ RIGHT_PAREN RIGHT_BRACKET COMMA ]
+## thf_or_formula -> thf_unitary_formula . VLINE thf_unitary_formula [ VLINE RIGHT_PAREN RIGHT_BRACKET COMMA ]
+## thf_unitary_type -> thf_unitary_formula . [ STAR PLUS ARROW ]
+##
+## The known suffix of the stack is as follows:
+## thf_unitary_formula
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SIGMA LEFT_PAREN TPI
+##
+## Ends in an error in state: 340.
+##
+## thf_unary_formula -> thf_unary_connective LEFT_PAREN . thf_logic_formula RIGHT_PAREN [ XOR VLINE STAR RIGHT_PAREN RIGHT_BRACKET PLUS NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA ARROW APPLY AND ]
+##
+## The known suffix of the stack is as follows:
+## thf_unary_connective LEFT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SIGMA LEFT_PAREN XOR RIGHT_BRACKET
+##
+## Ends in an error in state: 392.
+##
+## thf_unary_formula -> thf_unary_connective LEFT_PAREN thf_logic_formula . RIGHT_PAREN [ XOR VLINE STAR RIGHT_PAREN RIGHT_BRACKET PLUS NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA ARROW APPLY AND ]
+##
+## The known suffix of the stack is as follows:
+## thf_unary_connective LEFT_PAREN thf_logic_formula
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 379, spurious reduction of production thf_unitary_formula -> thf_atom 
+## In state 341, spurious reduction of production thf_logic_formula -> thf_unitary_formula 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SIGMA UPPER_WORD
+##
+## Ends in an error in state: 339.
+##
+## thf_conn_term -> thf_unary_connective . [ XOR VLINE STAR RIGHT_PAREN RIGHT_BRACKET PLUS NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA COLON ARROW APPLY AND ]
+## thf_unary_formula -> thf_unary_connective . LEFT_PAREN thf_logic_formula RIGHT_PAREN [ XOR VLINE STAR RIGHT_PAREN RIGHT_BRACKET PLUS NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA ARROW APPLY AND ]
+##
+## The known suffix of the stack is as follows:
+## thf_unary_connective
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED LESS LESS XOR
+##
+## Ends in an error in state: 389.
+##
+## thf_subtype -> constant subtype_sign . constant [ RIGHT_PAREN RIGHT_BRACKET COMMA ]
+##
+## The known suffix of the stack is as follows:
+## constant subtype_sign
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED LESS XOR
+##
+## Ends in an error in state: 387.
+##
+## subtype_sign -> LESS . LESS [ SINGLE_QUOTED LOWER_WORD ]
+##
+## The known suffix of the stack is as follows:
+## LESS
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA TPI
+##
+## Ends in an error in state: 502.
+##
+## thf_annotated -> THF LEFT_PAREN name COMMA formula_role COMMA . thf_formula annotations RIGHT_PAREN DOT [ TPI THF TFF INCLUDE FOF EOF CNF ]
+##
+## The known suffix of the stack is as follows:
+## THF LEFT_PAREN name COMMA formula_role COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA XOR AND AND AND TPI
+##
+## Ends in an error in state: 384.
+##
+## thf_and_formula -> thf_and_formula AND . thf_unitary_formula [ RIGHT_PAREN RIGHT_BRACKET COMMA AND ]
+##
+## The known suffix of the stack is as follows:
+## thf_and_formula AND
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA XOR AND AND XOR
+##
+## Ends in an error in state: 383.
+##
+## thf_and_formula -> thf_and_formula . AND thf_unitary_formula [ RIGHT_PAREN RIGHT_BRACKET COMMA AND ]
+## thf_binary_tuple -> thf_and_formula . [ RIGHT_PAREN RIGHT_BRACKET COMMA ]
+##
+## The known suffix of the stack is as follows:
+## thf_and_formula
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA XOR AND TPI
+##
+## Ends in an error in state: 358.
+##
+## thf_and_formula -> thf_unitary_formula AND . thf_unitary_formula [ RIGHT_PAREN RIGHT_BRACKET COMMA AND ]
+##
+## The known suffix of the stack is as follows:
+## thf_unitary_formula AND
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA XOR APPLY AND APPLY TPI
+##
+## Ends in an error in state: 381.
+##
+## thf_apply_formula -> thf_apply_formula APPLY . thf_unitary_formula [ RIGHT_PAREN RIGHT_BRACKET COMMA APPLY ]
+##
+## The known suffix of the stack is as follows:
+## thf_apply_formula APPLY
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA XOR APPLY AND XOR
+##
+## Ends in an error in state: 380.
+##
+## thf_apply_formula -> thf_apply_formula . APPLY thf_unitary_formula [ RIGHT_PAREN RIGHT_BRACKET COMMA APPLY ]
+## thf_binary_tuple -> thf_apply_formula . [ RIGHT_PAREN RIGHT_BRACKET COMMA ]
+##
+## The known suffix of the stack is as follows:
+## thf_apply_formula
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA XOR APPLY TPI
+##
+## Ends in an error in state: 356.
+##
+## thf_apply_formula -> thf_unitary_formula APPLY . thf_unitary_formula [ RIGHT_PAREN RIGHT_BRACKET COMMA APPLY ]
+##
+## The known suffix of the stack is as follows:
+## thf_unitary_formula APPLY
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA XOR ARROW TPI
+##
+## Ends in an error in state: 396.
+##
+## thf_mapping_type -> thf_unitary_type ARROW . thf_unitary_type [ RIGHT_PAREN RIGHT_BRACKET COMMA ]
+## thf_mapping_type -> thf_unitary_type ARROW . thf_mapping_type [ RIGHT_PAREN RIGHT_BRACKET COMMA ]
+##
+## The known suffix of the stack is as follows:
+## thf_unitary_type ARROW
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA XOR ARROW XOR XOR
+##
+## Ends in an error in state: 397.
+##
+## thf_mapping_type -> thf_unitary_type . ARROW thf_unitary_type [ RIGHT_PAREN RIGHT_BRACKET COMMA ]
+## thf_mapping_type -> thf_unitary_type ARROW thf_unitary_type . [ RIGHT_PAREN RIGHT_BRACKET COMMA ]
+## thf_mapping_type -> thf_unitary_type . ARROW thf_mapping_type [ RIGHT_PAREN RIGHT_BRACKET COMMA ]
+##
+## The known suffix of the stack is as follows:
+## thf_unitary_type ARROW thf_unitary_type
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA XOR COLON TPI
+##
+## Ends in an error in state: 366.
+##
+## thf_type_formula -> thf_typeable_formula COLON . thf_top_level_type [ RIGHT_PAREN RIGHT_BRACKET COMMA ]
+##
+## The known suffix of the stack is as follows:
+## thf_typeable_formula COLON
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA XOR COMMA DISTINCT_OBJECT COMMA LEFT_BRACKET RIGHT_BRACKET XOR
+##
+## Ends in an error in state: 504.
+##
+## thf_annotated -> THF LEFT_PAREN name COMMA formula_role COMMA thf_formula annotations . RIGHT_PAREN DOT [ TPI THF TFF INCLUDE FOF EOF CNF ]
+##
+## The known suffix of the stack is as follows:
+## THF LEFT_PAREN name COMMA formula_role COMMA thf_formula annotations
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA XOR PLUS AND PLUS TPI
+##
+## Ends in an error in state: 363.
+##
+## thf_union_type -> thf_union_type PLUS . thf_unitary_type [ RIGHT_PAREN RIGHT_BRACKET PLUS COMMA ]
+##
+## The known suffix of the stack is as follows:
+## thf_union_type PLUS
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA XOR PLUS AND XOR
+##
+## Ends in an error in state: 362.
+##
+## thf_binary_type -> thf_union_type . [ RIGHT_PAREN RIGHT_BRACKET COMMA ]
+## thf_union_type -> thf_union_type . PLUS thf_unitary_type [ RIGHT_PAREN RIGHT_BRACKET PLUS COMMA ]
+##
+## The known suffix of the stack is as follows:
+## thf_union_type
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA XOR PLUS TPI
+##
+## Ends in an error in state: 394.
+##
+## thf_union_type -> thf_unitary_type PLUS . thf_unitary_type [ RIGHT_PAREN RIGHT_BRACKET PLUS COMMA ]
+##
+## The known suffix of the stack is as follows:
+## thf_unitary_type PLUS
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA XOR RIGHT_BRACKET
+##
+## Ends in an error in state: 503.
+##
+## thf_annotated -> THF LEFT_PAREN name COMMA formula_role COMMA thf_formula . annotations RIGHT_PAREN DOT [ TPI THF TFF INCLUDE FOF EOF CNF ]
+##
+## The known suffix of the stack is as follows:
+## THF LEFT_PAREN name COMMA formula_role COMMA thf_formula
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 379, spurious reduction of production thf_unitary_formula -> thf_atom 
+## In state 341, spurious reduction of production thf_logic_formula -> thf_unitary_formula 
+## In state 421, spurious reduction of production thf_formula -> thf_logic_formula 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA XOR RIGHT_PAREN XOR
+##
+## Ends in an error in state: 505.
+##
+## thf_annotated -> THF LEFT_PAREN name COMMA formula_role COMMA thf_formula annotations RIGHT_PAREN . DOT [ TPI THF TFF INCLUDE FOF EOF CNF ]
+##
+## The known suffix of the stack is as follows:
+## THF LEFT_PAREN name COMMA formula_role COMMA thf_formula annotations RIGHT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA XOR STAR AND STAR TPI
+##
+## Ends in an error in state: 332.
+##
+## thf_xprod_type -> thf_xprod_type STAR . thf_unitary_type [ STAR RIGHT_PAREN RIGHT_BRACKET COMMA ]
+##
+## The known suffix of the stack is as follows:
+## thf_xprod_type STAR
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA XOR STAR AND XOR
+##
+## Ends in an error in state: 331.
+##
+## thf_binary_type -> thf_xprod_type . [ RIGHT_PAREN RIGHT_BRACKET COMMA ]
+## thf_xprod_type -> thf_xprod_type . STAR thf_unitary_type [ STAR RIGHT_PAREN RIGHT_BRACKET COMMA ]
+##
+## The known suffix of the stack is as follows:
+## thf_xprod_type
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA XOR STAR LEFT_PAREN TPI
+##
+## Ends in an error in state: 333.
+##
+## thf_unitary_formula -> LEFT_PAREN . thf_logic_formula RIGHT_PAREN [ XOR VLINE STAR RIGHT_PAREN RIGHT_BRACKET PLUS NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA ARROW APPLY AND ]
+##
+## The known suffix of the stack is as follows:
+## LEFT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA XOR STAR LEFT_PAREN XOR RIGHT_BRACKET
+##
+## Ends in an error in state: 399.
+##
+## thf_unitary_formula -> LEFT_PAREN thf_logic_formula . RIGHT_PAREN [ XOR VLINE STAR RIGHT_PAREN RIGHT_BRACKET PLUS NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA ARROW APPLY AND ]
+##
+## The known suffix of the stack is as follows:
+## LEFT_PAREN thf_logic_formula
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 379, spurious reduction of production thf_unitary_formula -> thf_atom 
+## In state 341, spurious reduction of production thf_logic_formula -> thf_unitary_formula 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA XOR STAR TPI
+##
+## Ends in an error in state: 335.
+##
+## thf_xprod_type -> thf_unitary_type STAR . thf_unitary_type [ STAR RIGHT_PAREN RIGHT_BRACKET COMMA ]
+##
+## The known suffix of the stack is as follows:
+## thf_unitary_type STAR
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA XOR UPPER_WORD
+##
+## Ends in an error in state: 379.
+##
+## thf_typeable_formula -> thf_atom . [ COLON ]
+## thf_unitary_formula -> thf_atom . [ XOR VLINE STAR RIGHT_PAREN RIGHT_BRACKET PLUS NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA ARROW APPLY AND ]
+##
+## The known suffix of the stack is as follows:
+## thf_atom
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA XOR VLINE AND VLINE TPI
+##
+## Ends in an error in state: 371.
+##
+## thf_or_formula -> thf_or_formula VLINE . thf_unitary_formula [ VLINE RIGHT_PAREN RIGHT_BRACKET COMMA ]
+##
+## The known suffix of the stack is as follows:
+## thf_or_formula VLINE
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA XOR VLINE AND XOR
+##
+## Ends in an error in state: 370.
+##
+## thf_binary_tuple -> thf_or_formula . [ RIGHT_PAREN RIGHT_BRACKET COMMA ]
+## thf_or_formula -> thf_or_formula . VLINE thf_unitary_formula [ VLINE RIGHT_PAREN RIGHT_BRACKET COMMA ]
+##
+## The known suffix of the stack is as follows:
+## thf_or_formula
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA XOR VLINE TPI
+##
+## Ends in an error in state: 342.
+##
+## thf_or_formula -> thf_unitary_formula VLINE . thf_unitary_formula [ VLINE RIGHT_PAREN RIGHT_BRACKET COMMA ]
+##
+## The known suffix of the stack is as follows:
+## thf_unitary_formula VLINE
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA XOR XOR TPI
+##
+## Ends in an error in state: 360.
+##
+## thf_binary_pair -> thf_unitary_formula thf_pair_connective . thf_unitary_formula [ RIGHT_PAREN RIGHT_BRACKET COMMA ]
+##
+## The known suffix of the stack is as follows:
+## thf_unitary_formula thf_pair_connective
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD XOR
+##
+## Ends in an error in state: 501.
+##
+## thf_annotated -> THF LEFT_PAREN name COMMA formula_role . COMMA thf_formula annotations RIGHT_PAREN DOT [ TPI THF TFF INCLUDE FOF EOF CNF ]
+##
+## The known suffix of the stack is as follows:
+## THF LEFT_PAREN name COMMA formula_role
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED COMMA XOR
+##
+## Ends in an error in state: 500.
+##
+## thf_annotated -> THF LEFT_PAREN name COMMA . formula_role COMMA thf_formula annotations RIGHT_PAREN DOT [ TPI THF TFF INCLUDE FOF EOF CNF ]
+##
+## The known suffix of the stack is as follows:
+## THF LEFT_PAREN name COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN SINGLE_QUOTED XOR
+##
+## Ends in an error in state: 499.
+##
+## thf_annotated -> THF LEFT_PAREN name . COMMA formula_role COMMA thf_formula annotations RIGHT_PAREN DOT [ TPI THF TFF INCLUDE FOF EOF CNF ]
+##
+## The known suffix of the stack is as follows:
+## THF LEFT_PAREN name
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF LEFT_PAREN XOR
+##
+## Ends in an error in state: 498.
+##
+## thf_annotated -> THF LEFT_PAREN . name COMMA formula_role COMMA thf_formula annotations RIGHT_PAREN DOT [ TPI THF TFF INCLUDE FOF EOF CNF ]
+##
+## The known suffix of the stack is as follows:
+## THF LEFT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: THF XOR
+##
+## Ends in an error in state: 497.
+##
+## thf_annotated -> THF . LEFT_PAREN name COMMA formula_role COMMA thf_formula annotations RIGHT_PAREN DOT [ TPI THF TFF INCLUDE FOF EOF CNF ]
+##
+## The known suffix of the stack is as follows:
+## THF
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA DOLLAR_DOLLAR_WORD LEFT_PAREN XOR
+##
+## Ends in an error in state: 38.
+##
+## system_term -> system_functor LEFT_PAREN . arguments RIGHT_PAREN [ XOR VLINE STAR RIGHT_PAREN RIGHT_BRACKET PLUS NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA COLON ARROW APPLY AND ]
+##
+## The known suffix of the stack is as follows:
+## system_functor LEFT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA DOLLAR_DOLLAR_WORD STAR
+##
+## Ends in an error in state: 112.
+##
+## function_term -> system_term . [ NOT_EQUAL EQUAL ]
+## system_atomic_formula -> system_term . [ XOR VLINE RIGHT_PAREN RIGHT_BRACKET NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV COMMA AND ]
+##
+## The known suffix of the stack is as follows:
+## system_term
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 37, spurious reduction of production system_constant -> system_functor 
+## In state 39, spurious reduction of production system_term -> system_constant 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA DOLLAR_DOLLAR_WORD UPPER_WORD
+##
+## Ends in an error in state: 37.
+##
+## system_constant -> system_functor . [ XOR VLINE STAR RIGHT_PAREN RIGHT_BRACKET PLUS NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA COLON ARROW APPLY AND ]
+## system_term -> system_functor . LEFT_PAREN arguments RIGHT_PAREN [ XOR VLINE STAR RIGHT_PAREN RIGHT_BRACKET PLUS NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA COLON ARROW APPLY AND ]
+##
+## The known suffix of the stack is as follows:
+## system_functor
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA DOLLAR_WORD LEFT_PAREN XOR
+##
+## Ends in an error in state: 51.
+##
+## defined_plain_term -> defined_functor LEFT_PAREN . arguments RIGHT_PAREN [ XOR VLINE STAR RIGHT_PAREN RIGHT_BRACKET PLUS NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA COLON ARROW APPLY AND ]
+##
+## The known suffix of the stack is as follows:
+## defined_functor LEFT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA DOLLAR_WORD STAR
+##
+## Ends in an error in state: 116.
+##
+## defined_atomic_term -> defined_plain_term . [ NOT_EQUAL EQUAL ]
+## defined_plain_formula -> defined_plain_term . [ XOR VLINE RIGHT_PAREN RIGHT_BRACKET NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV COMMA AND ]
+##
+## The known suffix of the stack is as follows:
+## defined_plain_term
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 50, spurious reduction of production defined_constant -> defined_functor 
+## In state 52, spurious reduction of production defined_plain_term -> defined_constant 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA DOLLAR_WORD UPPER_WORD
+##
+## Ends in an error in state: 50.
+##
+## defined_constant -> defined_functor . [ XOR VLINE STAR RIGHT_PAREN RIGHT_BRACKET PLUS NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA COLON ARROW APPLY AND ]
+## defined_plain_term -> defined_functor . LEFT_PAREN arguments RIGHT_PAREN [ XOR VLINE STAR RIGHT_PAREN RIGHT_BRACKET PLUS NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA COLON ARROW APPLY AND ]
+##
+## The known suffix of the stack is as follows:
+## defined_functor
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA FORALL LEFT_BRACKET UPPER_WORD COMMA XOR
+##
+## Ends in an error in state: 259.
+##
+## fof_variable_list -> variable COMMA . fof_variable_list [ RIGHT_BRACKET ]
+##
+## The known suffix of the stack is as follows:
+## variable COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA FORALL LEFT_BRACKET UPPER_WORD RIGHT_BRACKET COLON XOR
+##
+## Ends in an error in state: 263.
+##
+## fof_quantified_formula -> fol_quantifier LEFT_BRACKET fof_variable_list RIGHT_BRACKET COLON . fof_unitary_formula [ XOR VLINE RIGHT_PAREN RIGHT_BRACKET NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV COMMA AND ]
+##
+## The known suffix of the stack is as follows:
+## fol_quantifier LEFT_BRACKET fof_variable_list RIGHT_BRACKET COLON
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA FORALL LEFT_BRACKET UPPER_WORD RIGHT_BRACKET XOR
+##
+## Ends in an error in state: 262.
+##
+## fof_quantified_formula -> fol_quantifier LEFT_BRACKET fof_variable_list RIGHT_BRACKET . COLON fof_unitary_formula [ XOR VLINE RIGHT_PAREN RIGHT_BRACKET NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV COMMA AND ]
+##
+## The known suffix of the stack is as follows:
+## fol_quantifier LEFT_BRACKET fof_variable_list RIGHT_BRACKET
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA FORALL LEFT_BRACKET UPPER_WORD XOR
+##
+## Ends in an error in state: 258.
+##
+## fof_variable_list -> variable . [ RIGHT_BRACKET ]
+## fof_variable_list -> variable . COMMA fof_variable_list [ RIGHT_BRACKET ]
+##
+## The known suffix of the stack is as follows:
+## variable
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA FORALL LEFT_BRACKET XOR
+##
+## Ends in an error in state: 257.
+##
+## fof_quantified_formula -> fol_quantifier LEFT_BRACKET . fof_variable_list RIGHT_BRACKET COLON fof_unitary_formula [ XOR VLINE RIGHT_PAREN RIGHT_BRACKET NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV COMMA AND ]
+##
+## The known suffix of the stack is as follows:
+## fol_quantifier LEFT_BRACKET
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA FORALL XOR
+##
+## Ends in an error in state: 256.
+##
+## fof_quantified_formula -> fol_quantifier . LEFT_BRACKET fof_variable_list RIGHT_BRACKET COLON fof_unitary_formula [ XOR VLINE RIGHT_PAREN RIGHT_BRACKET NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV COMMA AND ]
+##
+## The known suffix of the stack is as follows:
+## fol_quantifier
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA ITE_T LEFT_PAREN SINGLE_QUOTED COMMA UPPER_WORD COMMA UPPER_WORD XOR
+##
+## Ends in an error in state: 239.
+##
+## conditional_term -> ITE_T LEFT_PAREN tff_logic_formula COMMA term COMMA term . RIGHT_PAREN [ XOR VLINE STAR RIGHT_PAREN RIGHT_BRACKET PLUS NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA COLON ARROW APPLY AND ]
+##
+## The known suffix of the stack is as follows:
+## ITE_T LEFT_PAREN tff_logic_formula COMMA term COMMA term
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA ITE_T LEFT_PAREN SINGLE_QUOTED COMMA UPPER_WORD COMMA XOR
+##
+## Ends in an error in state: 238.
+##
+## conditional_term -> ITE_T LEFT_PAREN tff_logic_formula COMMA term COMMA . term RIGHT_PAREN [ XOR VLINE STAR RIGHT_PAREN RIGHT_BRACKET PLUS NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA COLON ARROW APPLY AND ]
+##
+## The known suffix of the stack is as follows:
+## ITE_T LEFT_PAREN tff_logic_formula COMMA term COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA ITE_T LEFT_PAREN SINGLE_QUOTED COMMA UPPER_WORD XOR
+##
+## Ends in an error in state: 237.
+##
+## conditional_term -> ITE_T LEFT_PAREN tff_logic_formula COMMA term . COMMA term RIGHT_PAREN [ XOR VLINE STAR RIGHT_PAREN RIGHT_BRACKET PLUS NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA COLON ARROW APPLY AND ]
+##
+## The known suffix of the stack is as follows:
+## ITE_T LEFT_PAREN tff_logic_formula COMMA term
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA ITE_T LEFT_PAREN SINGLE_QUOTED COMMA XOR
+##
+## Ends in an error in state: 236.
+##
+## conditional_term -> ITE_T LEFT_PAREN tff_logic_formula COMMA . term COMMA term RIGHT_PAREN [ XOR VLINE STAR RIGHT_PAREN RIGHT_BRACKET PLUS NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA COLON ARROW APPLY AND ]
+##
+## The known suffix of the stack is as follows:
+## ITE_T LEFT_PAREN tff_logic_formula COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA ITE_T LEFT_PAREN SINGLE_QUOTED RIGHT_PAREN
+##
+## Ends in an error in state: 235.
+##
+## conditional_term -> ITE_T LEFT_PAREN tff_logic_formula . COMMA term COMMA term RIGHT_PAREN [ XOR VLINE STAR RIGHT_PAREN RIGHT_BRACKET PLUS NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA COLON ARROW APPLY AND ]
+##
+## The known suffix of the stack is as follows:
+## ITE_T LEFT_PAREN tff_logic_formula
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 32, spurious reduction of production constant -> tptp_functor 
+## In state 55, spurious reduction of production plain_term -> constant 
+## In state 114, spurious reduction of production plain_atomic_formula -> plain_term 
+## In state 115, spurious reduction of production atomic_formula -> plain_atomic_formula 
+## In state 145, spurious reduction of production tff_unitary_formula -> atomic_formula 
+## In state 146, spurious reduction of production tff_logic_formula -> tff_unitary_formula 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA ITE_T LEFT_PAREN XOR
+##
+## Ends in an error in state: 23.
+##
+## conditional_term -> ITE_T LEFT_PAREN . tff_logic_formula COMMA term COMMA term RIGHT_PAREN [ XOR VLINE STAR RIGHT_PAREN RIGHT_BRACKET PLUS NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA COLON ARROW APPLY AND ]
+##
+## The known suffix of the stack is as follows:
+## ITE_T LEFT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA ITE_T XOR
+##
+## Ends in an error in state: 22.
+##
+## conditional_term -> ITE_T . LEFT_PAREN tff_logic_formula COMMA term COMMA term RIGHT_PAREN [ XOR VLINE STAR RIGHT_PAREN RIGHT_BRACKET PLUS NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA COLON ARROW APPLY AND ]
+##
+## The known suffix of the stack is as follows:
+## ITE_T
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LEFT_BRACKET RIGHT_BRACKET GENTZEN_ARROW XOR
+##
+## Ends in an error in state: 294.
+##
+## fof_sequent -> fof_tuple GENTZEN_ARROW . fof_tuple [ RIGHT_PAREN COMMA ]
+##
+## The known suffix of the stack is as follows:
+## fof_tuple GENTZEN_ARROW
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LEFT_BRACKET RIGHT_BRACKET XOR
+##
+## Ends in an error in state: 293.
+##
+## fof_sequent -> fof_tuple . GENTZEN_ARROW fof_tuple [ RIGHT_PAREN COMMA ]
+##
+## The known suffix of the stack is as follows:
+## fof_tuple
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LEFT_BRACKET SINGLE_QUOTED COMMA XOR
+##
+## Ends in an error in state: 291.
+##
+## fof_tuple_list -> fof_logic_formula COMMA . fof_tuple_list [ RIGHT_BRACKET ]
+##
+## The known suffix of the stack is as follows:
+## fof_logic_formula COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LEFT_BRACKET SINGLE_QUOTED RIGHT_PAREN
+##
+## Ends in an error in state: 290.
+##
+## fof_tuple_list -> fof_logic_formula . [ RIGHT_BRACKET ]
+## fof_tuple_list -> fof_logic_formula . COMMA fof_tuple_list [ RIGHT_BRACKET ]
+##
+## The known suffix of the stack is as follows:
+## fof_logic_formula
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 32, spurious reduction of production constant -> tptp_functor 
+## In state 55, spurious reduction of production plain_term -> constant 
+## In state 114, spurious reduction of production plain_atomic_formula -> plain_term 
+## In state 115, spurious reduction of production atomic_formula -> plain_atomic_formula 
+## In state 268, spurious reduction of production fof_unitary_formula -> atomic_formula 
+## In state 270, spurious reduction of production fof_logic_formula -> fof_unitary_formula 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LEFT_BRACKET XOR
+##
+## Ends in an error in state: 252.
+##
+## fof_tuple -> LEFT_BRACKET . RIGHT_BRACKET [ RIGHT_PAREN GENTZEN_ARROW COMMA ]
+## fof_tuple -> LEFT_BRACKET . fof_tuple_list RIGHT_BRACKET [ RIGHT_PAREN GENTZEN_ARROW COMMA ]
+##
+## The known suffix of the stack is as follows:
+## LEFT_BRACKET
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LEFT_PAREN LEFT_BRACKET RIGHT_BRACKET GENTZEN_ARROW LEFT_BRACKET RIGHT_BRACKET XOR
+##
+## Ends in an error in state: 296.
+##
+## fof_sequent -> LEFT_PAREN fof_sequent . RIGHT_PAREN [ RIGHT_PAREN COMMA ]
+##
+## The known suffix of the stack is as follows:
+## LEFT_PAREN fof_sequent
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LEFT_PAREN SINGLE_QUOTED RIGHT_BRACKET
+##
+## Ends in an error in state: 280.
+##
+## fof_unitary_formula -> LEFT_PAREN fof_logic_formula . RIGHT_PAREN [ XOR VLINE RIGHT_PAREN RIGHT_BRACKET NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV COMMA AND ]
+##
+## The known suffix of the stack is as follows:
+## LEFT_PAREN fof_logic_formula
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 32, spurious reduction of production constant -> tptp_functor 
+## In state 55, spurious reduction of production plain_term -> constant 
+## In state 114, spurious reduction of production plain_atomic_formula -> plain_term 
+## In state 115, spurious reduction of production atomic_formula -> plain_atomic_formula 
+## In state 268, spurious reduction of production fof_unitary_formula -> atomic_formula 
+## In state 270, spurious reduction of production fof_logic_formula -> fof_unitary_formula 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LEFT_PAREN XOR
+##
+## Ends in an error in state: 251.
+##
+## fof_sequent -> LEFT_PAREN . fof_sequent RIGHT_PAREN [ RIGHT_PAREN COMMA ]
+## fof_unitary_formula -> LEFT_PAREN . fof_logic_formula RIGHT_PAREN [ XOR VLINE RIGHT_PAREN NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV COMMA AND ]
+##
+## The known suffix of the stack is as follows:
+## LEFT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LET_FT LEFT_PAREN FORALL LEFT_BRACKET UPPER_WORD RIGHT_BRACKET COLON XOR
+##
+## Ends in an error in state: 104.
+##
+## tff_let_formula_defn -> FORALL LEFT_BRACKET tff_variable_list RIGHT_BRACKET COLON . tff_let_formula_defn [ COMMA ]
+##
+## The known suffix of the stack is as follows:
+## FORALL LEFT_BRACKET tff_variable_list RIGHT_BRACKET COLON
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LET_FT LEFT_PAREN FORALL LEFT_BRACKET UPPER_WORD RIGHT_BRACKET XOR
+##
+## Ends in an error in state: 103.
+##
+## tff_let_formula_defn -> FORALL LEFT_BRACKET tff_variable_list RIGHT_BRACKET . COLON tff_let_formula_defn [ COMMA ]
+##
+## The known suffix of the stack is as follows:
+## FORALL LEFT_BRACKET tff_variable_list RIGHT_BRACKET
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LET_FT LEFT_PAREN FORALL LEFT_BRACKET XOR
+##
+## Ends in an error in state: 101.
+##
+## tff_let_formula_defn -> FORALL LEFT_BRACKET . tff_variable_list RIGHT_BRACKET COLON tff_let_formula_defn [ COMMA ]
+##
+## The known suffix of the stack is as follows:
+## FORALL LEFT_BRACKET
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LET_FT LEFT_PAREN FORALL XOR
+##
+## Ends in an error in state: 100.
+##
+## tff_let_formula_defn -> FORALL . LEFT_BRACKET tff_variable_list RIGHT_BRACKET COLON tff_let_formula_defn [ COMMA ]
+##
+## The known suffix of the stack is as follows:
+## FORALL
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LET_FT LEFT_PAREN LEFT_PAREN SINGLE_QUOTED EQUIV DOLLAR_DOLLAR_WORD XOR
+##
+## Ends in an error in state: 241.
+##
+## tff_let_formula_binding -> LEFT_PAREN tff_let_formula_binding . RIGHT_PAREN [ RIGHT_PAREN COMMA ]
+##
+## The known suffix of the stack is as follows:
+## LEFT_PAREN tff_let_formula_binding
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 37, spurious reduction of production system_constant -> system_functor 
+## In state 39, spurious reduction of production system_term -> system_constant 
+## In state 112, spurious reduction of production system_atomic_formula -> system_term 
+## In state 113, spurious reduction of production atomic_formula -> system_atomic_formula 
+## In state 145, spurious reduction of production tff_unitary_formula -> atomic_formula 
+## In state 176, spurious reduction of production tff_let_formula_binding -> atomic_formula EQUIV tff_unitary_formula 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LET_FT LEFT_PAREN LEFT_PAREN XOR
+##
+## Ends in an error in state: 21.
+##
+## tff_let_formula_binding -> LEFT_PAREN . tff_let_formula_binding RIGHT_PAREN [ RIGHT_PAREN COMMA ]
+##
+## The known suffix of the stack is as follows:
+## LEFT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LET_FT LEFT_PAREN SINGLE_QUOTED EQUIV DOLLAR_DOLLAR_WORD COMMA UPPER_WORD XOR
+##
+## Ends in an error in state: 245.
+##
+## let_term -> LET_FT LEFT_PAREN tff_let_formula_defn COMMA term . RIGHT_PAREN [ XOR VLINE STAR RIGHT_PAREN RIGHT_BRACKET PLUS NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA COLON ARROW APPLY AND ]
+##
+## The known suffix of the stack is as follows:
+## LET_FT LEFT_PAREN tff_let_formula_defn COMMA term
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LET_FT LEFT_PAREN SINGLE_QUOTED EQUIV DOLLAR_DOLLAR_WORD COMMA XOR
+##
+## Ends in an error in state: 244.
+##
+## let_term -> LET_FT LEFT_PAREN tff_let_formula_defn COMMA . term RIGHT_PAREN [ XOR VLINE STAR RIGHT_PAREN RIGHT_BRACKET PLUS NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA COLON ARROW APPLY AND ]
+##
+## The known suffix of the stack is as follows:
+## LET_FT LEFT_PAREN tff_let_formula_defn COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LET_FT LEFT_PAREN SINGLE_QUOTED EQUIV DOLLAR_DOLLAR_WORD XOR
+##
+## Ends in an error in state: 243.
+##
+## let_term -> LET_FT LEFT_PAREN tff_let_formula_defn . COMMA term RIGHT_PAREN [ XOR VLINE STAR RIGHT_PAREN RIGHT_BRACKET PLUS NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA COLON ARROW APPLY AND ]
+##
+## The known suffix of the stack is as follows:
+## LET_FT LEFT_PAREN tff_let_formula_defn
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 37, spurious reduction of production system_constant -> system_functor 
+## In state 39, spurious reduction of production system_term -> system_constant 
+## In state 112, spurious reduction of production system_atomic_formula -> system_term 
+## In state 113, spurious reduction of production atomic_formula -> system_atomic_formula 
+## In state 145, spurious reduction of production tff_unitary_formula -> atomic_formula 
+## In state 176, spurious reduction of production tff_let_formula_binding -> atomic_formula EQUIV tff_unitary_formula 
+## In state 106, spurious reduction of production tff_let_formula_defn -> tff_let_formula_binding 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LET_FT LEFT_PAREN SINGLE_QUOTED EQUIV XOR
+##
+## Ends in an error in state: 121.
+##
+## tff_let_formula_binding -> atomic_formula EQUIV . tff_unitary_formula [ RIGHT_PAREN COMMA ]
+##
+## The known suffix of the stack is as follows:
+## atomic_formula EQUIV
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LET_FT LEFT_PAREN SINGLE_QUOTED XOR
+##
+## Ends in an error in state: 120.
+##
+## tff_let_formula_binding -> atomic_formula . EQUIV tff_unitary_formula [ RIGHT_PAREN COMMA ]
+##
+## The known suffix of the stack is as follows:
+## atomic_formula
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 32, spurious reduction of production constant -> tptp_functor 
+## In state 55, spurious reduction of production plain_term -> constant 
+## In state 114, spurious reduction of production plain_atomic_formula -> plain_term 
+## In state 115, spurious reduction of production atomic_formula -> plain_atomic_formula 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LET_FT LEFT_PAREN XOR
+##
+## Ends in an error in state: 20.
+##
+## let_term -> LET_FT LEFT_PAREN . tff_let_formula_defn COMMA term RIGHT_PAREN [ XOR VLINE STAR RIGHT_PAREN RIGHT_BRACKET PLUS NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA COLON ARROW APPLY AND ]
+##
+## The known suffix of the stack is as follows:
+## LET_FT LEFT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LET_FT XOR
+##
+## Ends in an error in state: 19.
+##
+## let_term -> LET_FT . LEFT_PAREN tff_let_formula_defn COMMA term RIGHT_PAREN [ XOR VLINE STAR RIGHT_PAREN RIGHT_BRACKET PLUS NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA COLON ARROW APPLY AND ]
+##
+## The known suffix of the stack is as follows:
+## LET_FT
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LET_TT LEFT_PAREN FORALL LEFT_BRACKET UPPER_WORD RIGHT_BRACKET COLON XOR
+##
+## Ends in an error in state: 89.
+##
+## tff_let_term_defn -> FORALL LEFT_BRACKET tff_variable_list RIGHT_BRACKET COLON . tff_let_term_defn [ COMMA ]
+##
+## The known suffix of the stack is as follows:
+## FORALL LEFT_BRACKET tff_variable_list RIGHT_BRACKET COLON
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LET_TT LEFT_PAREN FORALL LEFT_BRACKET UPPER_WORD RIGHT_BRACKET XOR
+##
+## Ends in an error in state: 88.
+##
+## tff_let_term_defn -> FORALL LEFT_BRACKET tff_variable_list RIGHT_BRACKET . COLON tff_let_term_defn [ COMMA ]
+##
+## The known suffix of the stack is as follows:
+## FORALL LEFT_BRACKET tff_variable_list RIGHT_BRACKET
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LET_TT LEFT_PAREN FORALL LEFT_BRACKET XOR
+##
+## Ends in an error in state: 73.
+##
+## tff_let_term_defn -> FORALL LEFT_BRACKET . tff_variable_list RIGHT_BRACKET COLON tff_let_term_defn [ COMMA ]
+##
+## The known suffix of the stack is as follows:
+## FORALL LEFT_BRACKET
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LET_TT LEFT_PAREN FORALL XOR
+##
+## Ends in an error in state: 72.
+##
+## tff_let_term_defn -> FORALL . LEFT_BRACKET tff_variable_list RIGHT_BRACKET COLON tff_let_term_defn [ COMMA ]
+##
+## The known suffix of the stack is as follows:
+## FORALL
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LET_TT LEFT_PAREN LEFT_PAREN UPPER_WORD EQUAL DISTINCT_OBJECT XOR
+##
+## Ends in an error in state: 67.
+##
+## tff_let_term_binding -> LEFT_PAREN tff_let_term_binding . RIGHT_PAREN [ RIGHT_PAREN COMMA ]
+##
+## The known suffix of the stack is as follows:
+## LEFT_PAREN tff_let_term_binding
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LET_TT LEFT_PAREN LEFT_PAREN XOR
+##
+## Ends in an error in state: 26.
+##
+## tff_let_term_binding -> LEFT_PAREN . tff_let_term_binding RIGHT_PAREN [ RIGHT_PAREN COMMA ]
+##
+## The known suffix of the stack is as follows:
+## LEFT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LET_TT LEFT_PAREN UPPER_WORD EQUAL DISTINCT_OBJECT COMMA UPPER_WORD XOR
+##
+## Ends in an error in state: 249.
+##
+## let_term -> LET_TT LEFT_PAREN tff_let_term_defn COMMA term . RIGHT_PAREN [ XOR VLINE STAR RIGHT_PAREN RIGHT_BRACKET PLUS NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA COLON ARROW APPLY AND ]
+##
+## The known suffix of the stack is as follows:
+## LET_TT LEFT_PAREN tff_let_term_defn COMMA term
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LET_TT LEFT_PAREN UPPER_WORD EQUAL DISTINCT_OBJECT COMMA XOR
+##
+## Ends in an error in state: 248.
+##
+## let_term -> LET_TT LEFT_PAREN tff_let_term_defn COMMA . term RIGHT_PAREN [ XOR VLINE STAR RIGHT_PAREN RIGHT_BRACKET PLUS NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA COLON ARROW APPLY AND ]
+##
+## The known suffix of the stack is as follows:
+## LET_TT LEFT_PAREN tff_let_term_defn COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LET_TT LEFT_PAREN UPPER_WORD EQUAL DISTINCT_OBJECT XOR
+##
+## Ends in an error in state: 247.
+##
+## let_term -> LET_TT LEFT_PAREN tff_let_term_defn . COMMA term RIGHT_PAREN [ XOR VLINE STAR RIGHT_PAREN RIGHT_BRACKET PLUS NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA COLON ARROW APPLY AND ]
+##
+## The known suffix of the stack is as follows:
+## LET_TT LEFT_PAREN tff_let_term_defn
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LET_TT LEFT_PAREN UPPER_WORD EQUAL XOR
+##
+## Ends in an error in state: 70.
+##
+## tff_let_term_binding -> term EQUAL . term [ RIGHT_PAREN COMMA ]
+##
+## The known suffix of the stack is as follows:
+## term EQUAL
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LET_TT LEFT_PAREN UPPER_WORD XOR
+##
+## Ends in an error in state: 69.
+##
+## tff_let_term_binding -> term . EQUAL term [ RIGHT_PAREN COMMA ]
+##
+## The known suffix of the stack is as follows:
+## term
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LET_TT LEFT_PAREN XOR
+##
+## Ends in an error in state: 18.
+##
+## let_term -> LET_TT LEFT_PAREN . tff_let_term_defn COMMA term RIGHT_PAREN [ XOR VLINE STAR RIGHT_PAREN RIGHT_BRACKET PLUS NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA COLON ARROW APPLY AND ]
+##
+## The known suffix of the stack is as follows:
+## LET_TT LEFT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA LET_TT XOR
+##
+## Ends in an error in state: 17.
+##
+## let_term -> LET_TT . LEFT_PAREN tff_let_term_defn COMMA term RIGHT_PAREN [ XOR VLINE STAR RIGHT_PAREN RIGHT_BRACKET PLUS NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA COLON ARROW APPLY AND ]
+##
+## The known suffix of the stack is as follows:
+## LET_TT
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA NOT LEFT_PAREN XOR
+##
+## Ends in an error in state: 254.
+##
+## fof_unitary_formula -> LEFT_PAREN . fof_logic_formula RIGHT_PAREN [ XOR VLINE RIGHT_PAREN RIGHT_BRACKET NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV COMMA AND ]
+##
+## The known suffix of the stack is as follows:
+## LEFT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA NOT XOR
+##
+## Ends in an error in state: 255.
+##
+## fof_unary_formula -> unary_connective . fof_unitary_formula [ XOR VLINE RIGHT_PAREN RIGHT_BRACKET NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV COMMA AND ]
+##
+## The known suffix of the stack is as follows:
+## unary_connective
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED AND DOLLAR_DOLLAR_WORD AND XOR
+##
+## Ends in an error in state: 286.
+##
+## fof_and_formula -> fof_and_formula AND . fof_unitary_formula [ RIGHT_PAREN RIGHT_BRACKET COMMA AND ]
+##
+## The known suffix of the stack is as follows:
+## fof_and_formula AND
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED AND DOLLAR_DOLLAR_WORD XOR
+##
+## Ends in an error in state: 285.
+##
+## fof_and_formula -> fof_and_formula . AND fof_unitary_formula [ RIGHT_PAREN RIGHT_BRACKET COMMA AND ]
+## fof_binary_assoc -> fof_and_formula . [ RIGHT_PAREN RIGHT_BRACKET COMMA ]
+##
+## The known suffix of the stack is as follows:
+## fof_and_formula
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 37, spurious reduction of production system_constant -> system_functor 
+## In state 39, spurious reduction of production system_term -> system_constant 
+## In state 112, spurious reduction of production system_atomic_formula -> system_term 
+## In state 113, spurious reduction of production atomic_formula -> system_atomic_formula 
+## In state 268, spurious reduction of production fof_unitary_formula -> atomic_formula 
+## In state 274, spurious reduction of production fof_and_formula -> fof_unitary_formula AND fof_unitary_formula 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED AND XOR
+##
+## Ends in an error in state: 273.
+##
+## fof_and_formula -> fof_unitary_formula AND . fof_unitary_formula [ RIGHT_PAREN RIGHT_BRACKET COMMA AND ]
+##
+## The known suffix of the stack is as follows:
+## fof_unitary_formula AND
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED COMMA DOLLAR_CNF LEFT_PAREN SINGLE_QUOTED COMMA
+##
+## Ends in an error in state: 467.
+##
+## formula_data -> DOLLAR_CNF LEFT_PAREN cnf_formula . RIGHT_PAREN [ RIGHT_PAREN RIGHT_BRACKET COMMA COLON ]
+##
+## The known suffix of the stack is as follows:
+## DOLLAR_CNF LEFT_PAREN cnf_formula
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 32, spurious reduction of production constant -> tptp_functor 
+## In state 55, spurious reduction of production plain_term -> constant 
+## In state 114, spurious reduction of production plain_atomic_formula -> plain_term 
+## In state 115, spurious reduction of production atomic_formula -> plain_atomic_formula 
+## In state 464, spurious reduction of production literal -> atomic_formula 
+## In state 459, spurious reduction of production disjunction -> literal 
+## In state 466, spurious reduction of production cnf_formula -> disjunction 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED COMMA DOLLAR_CNF LEFT_PAREN XOR
+##
+## Ends in an error in state: 455.
+##
+## formula_data -> DOLLAR_CNF LEFT_PAREN . cnf_formula RIGHT_PAREN [ RIGHT_PAREN RIGHT_BRACKET COMMA COLON ]
+##
+## The known suffix of the stack is as follows:
+## DOLLAR_CNF LEFT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED COMMA DOLLAR_CNF XOR
+##
+## Ends in an error in state: 454.
+##
+## formula_data -> DOLLAR_CNF . LEFT_PAREN cnf_formula RIGHT_PAREN [ RIGHT_PAREN RIGHT_BRACKET COMMA COLON ]
+##
+## The known suffix of the stack is as follows:
+## DOLLAR_CNF
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED COMMA DOLLAR_FOF LEFT_PAREN SINGLE_QUOTED RIGHT_BRACKET
+##
+## Ends in an error in state: 452.
+##
+## formula_data -> DOLLAR_FOF LEFT_PAREN fof_formula . RIGHT_PAREN [ RIGHT_PAREN RIGHT_BRACKET COMMA COLON ]
+##
+## The known suffix of the stack is as follows:
+## DOLLAR_FOF LEFT_PAREN fof_formula
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 32, spurious reduction of production constant -> tptp_functor 
+## In state 55, spurious reduction of production plain_term -> constant 
+## In state 114, spurious reduction of production plain_atomic_formula -> plain_term 
+## In state 115, spurious reduction of production atomic_formula -> plain_atomic_formula 
+## In state 268, spurious reduction of production fof_unitary_formula -> atomic_formula 
+## In state 270, spurious reduction of production fof_logic_formula -> fof_unitary_formula 
+## In state 451, spurious reduction of production fof_formula -> fof_logic_formula 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED COMMA DOLLAR_FOF LEFT_PAREN XOR
+##
+## Ends in an error in state: 449.
+##
+## formula_data -> DOLLAR_FOF LEFT_PAREN . fof_formula RIGHT_PAREN [ RIGHT_PAREN RIGHT_BRACKET COMMA COLON ]
+##
+## The known suffix of the stack is as follows:
+## DOLLAR_FOF LEFT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED COMMA DOLLAR_FOF XOR
+##
+## Ends in an error in state: 448.
+##
+## formula_data -> DOLLAR_FOF . LEFT_PAREN fof_formula RIGHT_PAREN [ RIGHT_PAREN RIGHT_BRACKET COMMA COLON ]
+##
+## The known suffix of the stack is as follows:
+## DOLLAR_FOF
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED COMMA DOLLAR_FOT LEFT_PAREN UPPER_WORD XOR
+##
+## Ends in an error in state: 446.
+##
+## formula_data -> DOLLAR_FOT LEFT_PAREN term . RIGHT_PAREN [ RIGHT_PAREN RIGHT_BRACKET COMMA COLON ]
+##
+## The known suffix of the stack is as follows:
+## DOLLAR_FOT LEFT_PAREN term
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED COMMA DOLLAR_FOT LEFT_PAREN XOR
+##
+## Ends in an error in state: 445.
+##
+## formula_data -> DOLLAR_FOT LEFT_PAREN . term RIGHT_PAREN [ RIGHT_PAREN RIGHT_BRACKET COMMA COLON ]
+##
+## The known suffix of the stack is as follows:
+## DOLLAR_FOT LEFT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED COMMA DOLLAR_FOT XOR
+##
+## Ends in an error in state: 444.
+##
+## formula_data -> DOLLAR_FOT . LEFT_PAREN term RIGHT_PAREN [ RIGHT_PAREN RIGHT_BRACKET COMMA COLON ]
+##
+## The known suffix of the stack is as follows:
+## DOLLAR_FOT
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED COMMA DOLLAR_TFF LEFT_PAREN SINGLE_QUOTED COMMA
+##
+## Ends in an error in state: 442.
+##
+## formula_data -> DOLLAR_TFF LEFT_PAREN tff_formula . RIGHT_PAREN [ RIGHT_PAREN RIGHT_BRACKET COMMA COLON ]
+##
+## The known suffix of the stack is as follows:
+## DOLLAR_TFF LEFT_PAREN tff_formula
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 187, spurious reduction of production constant -> tptp_functor 
+## In state 55, spurious reduction of production plain_term -> constant 
+## In state 114, spurious reduction of production plain_atomic_formula -> plain_term 
+## In state 115, spurious reduction of production atomic_formula -> plain_atomic_formula 
+## In state 145, spurious reduction of production tff_unitary_formula -> atomic_formula 
+## In state 146, spurious reduction of production tff_logic_formula -> tff_unitary_formula 
+## In state 230, spurious reduction of production tff_formula -> tff_logic_formula 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED COMMA DOLLAR_TFF LEFT_PAREN XOR
+##
+## Ends in an error in state: 441.
+##
+## formula_data -> DOLLAR_TFF LEFT_PAREN . tff_formula RIGHT_PAREN [ RIGHT_PAREN RIGHT_BRACKET COMMA COLON ]
+##
+## The known suffix of the stack is as follows:
+## DOLLAR_TFF LEFT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED COMMA DOLLAR_TFF XOR
+##
+## Ends in an error in state: 440.
+##
+## formula_data -> DOLLAR_TFF . LEFT_PAREN tff_formula RIGHT_PAREN [ RIGHT_PAREN RIGHT_BRACKET COMMA COLON ]
+##
+## The known suffix of the stack is as follows:
+## DOLLAR_TFF
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED COMMA DOLLAR_THF LEFT_PAREN TPI
+##
+## Ends in an error in state: 303.
+##
+## formula_data -> DOLLAR_THF LEFT_PAREN . thf_formula RIGHT_PAREN [ RIGHT_PAREN RIGHT_BRACKET COMMA COLON ]
+##
+## The known suffix of the stack is as follows:
+## DOLLAR_THF LEFT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED COMMA DOLLAR_THF LEFT_PAREN XOR RIGHT_BRACKET
+##
+## Ends in an error in state: 438.
+##
+## formula_data -> DOLLAR_THF LEFT_PAREN thf_formula . RIGHT_PAREN [ RIGHT_PAREN RIGHT_BRACKET COMMA COLON ]
+##
+## The known suffix of the stack is as follows:
+## DOLLAR_THF LEFT_PAREN thf_formula
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 379, spurious reduction of production thf_unitary_formula -> thf_atom 
+## In state 341, spurious reduction of production thf_logic_formula -> thf_unitary_formula 
+## In state 421, spurious reduction of production thf_formula -> thf_logic_formula 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED COMMA DOLLAR_THF XOR
+##
+## Ends in an error in state: 302.
+##
+## formula_data -> DOLLAR_THF . LEFT_PAREN thf_formula RIGHT_PAREN [ RIGHT_PAREN RIGHT_BRACKET COMMA COLON ]
+##
+## The known suffix of the stack is as follows:
+## DOLLAR_THF
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED COMMA LEFT_BRACKET LEFT_BRACKET RIGHT_BRACKET XOR
+##
+## Ends in an error in state: 473.
+##
+## general_terms -> general_term . [ RIGHT_PAREN RIGHT_BRACKET ]
+## general_terms -> general_term . COMMA general_terms [ RIGHT_PAREN RIGHT_BRACKET ]
+##
+## The known suffix of the stack is as follows:
+## general_term
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED COMMA LEFT_BRACKET UPPER_WORD COMMA XOR
+##
+## Ends in an error in state: 474.
+##
+## general_terms -> general_term COMMA . general_terms [ RIGHT_PAREN RIGHT_BRACKET ]
+##
+## The known suffix of the stack is as follows:
+## general_term COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED COMMA LEFT_BRACKET UPPER_WORD RIGHT_PAREN
+##
+## Ends in an error in state: 471.
+##
+## general_list -> LEFT_BRACKET general_terms . RIGHT_BRACKET [ RIGHT_PAREN RIGHT_BRACKET COMMA ]
+##
+## The known suffix of the stack is as follows:
+## LEFT_BRACKET general_terms
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 478, spurious reduction of production general_term -> general_data 
+## In state 473, spurious reduction of production general_terms -> general_term 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED COMMA LEFT_BRACKET XOR
+##
+## Ends in an error in state: 300.
+##
+## general_list -> LEFT_BRACKET . RIGHT_BRACKET [ RIGHT_PAREN RIGHT_BRACKET COMMA ]
+## general_list -> LEFT_BRACKET . general_terms RIGHT_BRACKET [ RIGHT_PAREN RIGHT_BRACKET COMMA ]
+##
+## The known suffix of the stack is as follows:
+## LEFT_BRACKET
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED COMMA SINGLE_QUOTED LEFT_PAREN UPPER_WORD RIGHT_BRACKET
+##
+## Ends in an error in state: 485.
+##
+## general_function -> atomic_word LEFT_PAREN general_terms . RIGHT_PAREN [ RIGHT_PAREN RIGHT_BRACKET COMMA COLON ]
+##
+## The known suffix of the stack is as follows:
+## atomic_word LEFT_PAREN general_terms
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 478, spurious reduction of production general_term -> general_data 
+## In state 473, spurious reduction of production general_terms -> general_term 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED COMMA SINGLE_QUOTED LEFT_PAREN XOR
+##
+## Ends in an error in state: 484.
+##
+## general_function -> atomic_word LEFT_PAREN . general_terms RIGHT_PAREN [ RIGHT_PAREN RIGHT_BRACKET COMMA COLON ]
+##
+## The known suffix of the stack is as follows:
+## atomic_word LEFT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED COMMA SINGLE_QUOTED XOR
+##
+## Ends in an error in state: 483.
+##
+## general_data -> atomic_word . [ RIGHT_PAREN RIGHT_BRACKET COMMA COLON ]
+## general_function -> atomic_word . LEFT_PAREN general_terms RIGHT_PAREN [ RIGHT_PAREN RIGHT_BRACKET COMMA COLON ]
+##
+## The known suffix of the stack is as follows:
+## atomic_word
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED COMMA UPPER_WORD COLON XOR
+##
+## Ends in an error in state: 479.
+##
+## general_term -> general_data COLON . general_term [ RIGHT_PAREN RIGHT_BRACKET COMMA ]
+##
+## The known suffix of the stack is as follows:
+## general_data COLON
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED COMMA UPPER_WORD COMMA LEFT_BRACKET RIGHT_BRACKET XOR
+##
+## Ends in an error in state: 493.
+##
+## tpi_annotated -> TPI LEFT_PAREN name COMMA formula_role COMMA tpi_formula annotations . RIGHT_PAREN DOT [ TPI THF TFF INCLUDE FOF EOF CNF ]
+##
+## The known suffix of the stack is as follows:
+## TPI LEFT_PAREN name COMMA formula_role COMMA tpi_formula annotations
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED COMMA UPPER_WORD COMMA XOR
+##
+## Ends in an error in state: 488.
+##
+## optional_info -> COMMA . useful_info [ RIGHT_PAREN ]
+##
+## The known suffix of the stack is as follows:
+## COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED COMMA UPPER_WORD RIGHT_BRACKET
+##
+## Ends in an error in state: 487.
+##
+## annotations -> COMMA source . optional_info [ RIGHT_PAREN ]
+##
+## The known suffix of the stack is as follows:
+## COMMA source
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 478, spurious reduction of production general_term -> general_data 
+## In state 492, spurious reduction of production source -> general_term 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED COMMA UPPER_WORD XOR
+##
+## Ends in an error in state: 478.
+##
+## general_term -> general_data . [ RIGHT_PAREN RIGHT_BRACKET COMMA ]
+## general_term -> general_data . COLON general_term [ RIGHT_PAREN RIGHT_BRACKET COMMA ]
+##
+## The known suffix of the stack is as follows:
+## general_data
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED COMMA XOR
+##
+## Ends in an error in state: 299.
+##
+## annotations -> COMMA . source optional_info [ RIGHT_PAREN ]
+##
+## The known suffix of the stack is as follows:
+## COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED LEFT_PAREN UPPER_WORD COMMA XOR
+##
+## Ends in an error in state: 35.
+##
+## arguments -> term COMMA . arguments [ RIGHT_PAREN ]
+##
+## The known suffix of the stack is as follows:
+## term COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED LEFT_PAREN UPPER_WORD XOR
+##
+## Ends in an error in state: 34.
+##
+## arguments -> term . [ RIGHT_PAREN ]
+## arguments -> term . COMMA arguments [ RIGHT_PAREN ]
+##
+## The known suffix of the stack is as follows:
+## term
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED LEFT_PAREN XOR
+##
+## Ends in an error in state: 33.
+##
+## plain_term -> tptp_functor LEFT_PAREN . arguments RIGHT_PAREN [ XOR VLINE STAR RIGHT_PAREN RIGHT_BRACKET PLUS NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA COLON ARROW APPLY AND ]
+##
+## The known suffix of the stack is as follows:
+## tptp_functor LEFT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED RIGHT_BRACKET
+##
+## Ends in an error in state: 298.
+##
+## tpi_annotated -> TPI LEFT_PAREN name COMMA formula_role COMMA tpi_formula . annotations RIGHT_PAREN DOT [ TPI THF TFF INCLUDE FOF EOF CNF ]
+##
+## The known suffix of the stack is as follows:
+## TPI LEFT_PAREN name COMMA formula_role COMMA tpi_formula
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 32, spurious reduction of production constant -> tptp_functor 
+## In state 55, spurious reduction of production plain_term -> constant 
+## In state 114, spurious reduction of production plain_atomic_formula -> plain_term 
+## In state 115, spurious reduction of production atomic_formula -> plain_atomic_formula 
+## In state 268, spurious reduction of production fof_unitary_formula -> atomic_formula 
+## In state 270, spurious reduction of production fof_logic_formula -> fof_unitary_formula 
+## In state 451, spurious reduction of production fof_formula -> fof_logic_formula 
+## In state 496, spurious reduction of production tpi_formula -> fof_formula 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED RIGHT_PAREN XOR
+##
+## Ends in an error in state: 494.
+##
+## tpi_annotated -> TPI LEFT_PAREN name COMMA formula_role COMMA tpi_formula annotations RIGHT_PAREN . DOT [ TPI THF TFF INCLUDE FOF EOF CNF ]
+##
+## The known suffix of the stack is as follows:
+## TPI LEFT_PAREN name COMMA formula_role COMMA tpi_formula annotations RIGHT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED STAR
+##
+## Ends in an error in state: 114.
+##
+## function_term -> plain_term . [ NOT_EQUAL EQUAL ]
+## plain_atomic_formula -> plain_term . [ XOR VLINE RIGHT_PAREN RIGHT_BRACKET NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV COMMA AND ]
+##
+## The known suffix of the stack is as follows:
+## plain_term
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 32, spurious reduction of production constant -> tptp_functor 
+## In state 55, spurious reduction of production plain_term -> constant 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED UPPER_WORD
+##
+## Ends in an error in state: 32.
+##
+## constant -> tptp_functor . [ XOR VLINE STAR RIGHT_PAREN RIGHT_BRACKET PLUS NOT_EQUAL NOTVLINE NOTAND LESS LEFT_IMPLY IMPLY EQUIV EQUAL COMMA COLON ARROW APPLY AND ]
+## plain_term -> tptp_functor . LEFT_PAREN arguments RIGHT_PAREN [ XOR VLINE STAR RIGHT_PAREN RIGHT_BRACKET PLUS NOT_EQUAL NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV EQUAL COMMA COLON ARROW APPLY AND ]
+##
+## The known suffix of the stack is as follows:
+## tptp_functor
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED VLINE DOLLAR_DOLLAR_WORD VLINE XOR
+##
+## Ends in an error in state: 278.
+##
+## fof_or_formula -> fof_or_formula VLINE . fof_unitary_formula [ VLINE RIGHT_PAREN RIGHT_BRACKET COMMA ]
+##
+## The known suffix of the stack is as follows:
+## fof_or_formula VLINE
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED VLINE DOLLAR_DOLLAR_WORD XOR
+##
+## Ends in an error in state: 277.
+##
+## fof_binary_assoc -> fof_or_formula . [ RIGHT_PAREN RIGHT_BRACKET COMMA ]
+## fof_or_formula -> fof_or_formula . VLINE fof_unitary_formula [ VLINE RIGHT_PAREN RIGHT_BRACKET COMMA ]
+##
+## The known suffix of the stack is as follows:
+## fof_or_formula
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 37, spurious reduction of production system_constant -> system_functor 
+## In state 39, spurious reduction of production system_term -> system_constant 
+## In state 112, spurious reduction of production system_atomic_formula -> system_term 
+## In state 113, spurious reduction of production atomic_formula -> system_atomic_formula 
+## In state 268, spurious reduction of production fof_unitary_formula -> atomic_formula 
+## In state 272, spurious reduction of production fof_or_formula -> fof_unitary_formula VLINE fof_unitary_formula 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED VLINE XOR
+##
+## Ends in an error in state: 271.
+##
+## fof_or_formula -> fof_unitary_formula VLINE . fof_unitary_formula [ VLINE RIGHT_PAREN RIGHT_BRACKET COMMA ]
+##
+## The known suffix of the stack is as follows:
+## fof_unitary_formula VLINE
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA SINGLE_QUOTED XOR XOR
+##
+## Ends in an error in state: 275.
+##
+## fof_binary_nonassoc -> fof_unitary_formula binary_connective . fof_unitary_formula [ RIGHT_PAREN RIGHT_BRACKET COMMA ]
+##
+## The known suffix of the stack is as follows:
+## fof_unitary_formula binary_connective
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA UPPER_WORD EQUAL XOR
+##
+## Ends in an error in state: 110.
+##
+## defined_infix_formula -> term defined_infix_pred . term [ XOR VLINE RIGHT_PAREN RIGHT_BRACKET NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV COMMA AND ]
+##
+## The known suffix of the stack is as follows:
+## term defined_infix_pred
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA UPPER_WORD NOT_EQUAL UPPER_WORD UPPER_WORD
+##
+## Ends in an error in state: 270.
+##
+## fof_and_formula -> fof_unitary_formula . AND fof_unitary_formula [ RIGHT_PAREN RIGHT_BRACKET COMMA AND ]
+## fof_binary_nonassoc -> fof_unitary_formula . binary_connective fof_unitary_formula [ RIGHT_PAREN RIGHT_BRACKET COMMA ]
+## fof_logic_formula -> fof_unitary_formula . [ RIGHT_PAREN RIGHT_BRACKET COMMA ]
+## fof_or_formula -> fof_unitary_formula . VLINE fof_unitary_formula [ VLINE RIGHT_PAREN RIGHT_BRACKET COMMA ]
+##
+## The known suffix of the stack is as follows:
+## fof_unitary_formula
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA UPPER_WORD NOT_EQUAL XOR
+##
+## Ends in an error in state: 136.
+##
+## fol_infix_unary -> term infix_inequality . term [ XOR VLINE RIGHT_PAREN RIGHT_BRACKET NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV COMMA AND ]
+##
+## The known suffix of the stack is as follows:
+## term infix_inequality
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA UPPER_WORD XOR
+##
+## Ends in an error in state: 134.
+##
+## defined_infix_formula -> term . defined_infix_pred term [ XOR VLINE RIGHT_PAREN RIGHT_BRACKET NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV COMMA AND ]
+## fol_infix_unary -> term . infix_inequality term [ XOR VLINE RIGHT_PAREN RIGHT_BRACKET NOTVLINE NOTAND LEFT_IMPLY IMPLY EQUIV COMMA AND ]
+##
+## The known suffix of the stack is as follows:
+## term
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD COMMA XOR
+##
+## Ends in an error in state: 10.
+##
+## tpi_annotated -> TPI LEFT_PAREN name COMMA formula_role COMMA . tpi_formula annotations RIGHT_PAREN DOT [ TPI THF TFF INCLUDE FOF EOF CNF ]
+##
+## The known suffix of the stack is as follows:
+## TPI LEFT_PAREN name COMMA formula_role COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA LOWER_WORD XOR
+##
+## Ends in an error in state: 9.
+##
+## tpi_annotated -> TPI LEFT_PAREN name COMMA formula_role . COMMA tpi_formula annotations RIGHT_PAREN DOT [ TPI THF TFF INCLUDE FOF EOF CNF ]
+##
+## The known suffix of the stack is as follows:
+## TPI LEFT_PAREN name COMMA formula_role
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED COMMA XOR
+##
+## Ends in an error in state: 7.
+##
+## tpi_annotated -> TPI LEFT_PAREN name COMMA . formula_role COMMA tpi_formula annotations RIGHT_PAREN DOT [ TPI THF TFF INCLUDE FOF EOF CNF ]
+##
+## The known suffix of the stack is as follows:
+## TPI LEFT_PAREN name COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN SINGLE_QUOTED XOR
+##
+## Ends in an error in state: 6.
+##
+## tpi_annotated -> TPI LEFT_PAREN name . COMMA formula_role COMMA tpi_formula annotations RIGHT_PAREN DOT [ TPI THF TFF INCLUDE FOF EOF CNF ]
+##
+## The known suffix of the stack is as follows:
+## TPI LEFT_PAREN name
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI LEFT_PAREN XOR
+##
+## Ends in an error in state: 2.
+##
+## tpi_annotated -> TPI LEFT_PAREN . name COMMA formula_role COMMA tpi_formula annotations RIGHT_PAREN DOT [ TPI THF TFF INCLUDE FOF EOF CNF ]
+##
+## The known suffix of the stack is as follows:
+## TPI LEFT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: TPI XOR
+##
+## Ends in an error in state: 1.
+##
+## tpi_annotated -> TPI . LEFT_PAREN name COMMA formula_role COMMA tpi_formula annotations RIGHT_PAREN DOT [ TPI THF TFF INCLUDE FOF EOF CNF ]
+##
+## The known suffix of the stack is as follows:
+## TPI
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: XOR
+##
+## Ends in an error in state: 0.
+##
+## file' -> . file [ # ]
+##
+## The known suffix of the stack is as follows:
+##
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/zf/dolmen_zf.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/zf/dolmen_zf.ml
index 970164d2346b672c9863739368d912fec5283337..9896c38bdc1a156982fbf7d4b01300ee128fd335 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/zf/dolmen_zf.ml
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/zf/dolmen_zf.ml
@@ -15,6 +15,6 @@ module Make
     type statement = S.t
     let env = []
     let incremental = true
-    let error _ = ""
+    let error s = Syntax_messages.message s
   end)(LexZf)(ParseZf.Make(L)(I)(T)(S))
 
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/zf/dune b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/zf/dune
index 9bb8a4e25f7da3025790d133592b55d310f2e31c..e5f9a895d63af7c4be23547101e2266ce9e3067b 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/zf/dune
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/zf/dune
@@ -12,10 +12,53 @@
  (merge_into parseZf)
 )
 
+(rule
+  (target syntax_messages.ml)
+  (deps   (:tokens tokens_zf.mly)
+          (:parser parseZf.mly)
+          (:msg syntax.messages))
+  (action (with-stdout-to %{target}
+          (run menhir --external-tokens Tokens_zf %{tokens}
+                      %{parser} --base %{parser} --compile-errors %{msg})))
+)
 
 (library
   (name           dolmen_zf)
   (public_name    dolmen.zf)
-  (libraries      dolmen_std menhirLib)
-  (modules        Tokens_zf LexZf ParseZf Ast_zf Dolmen_zf)
+  (libraries      dolmen_std dolmen_intf menhirLib)
+  (modules        Tokens_zf LexZf ParseZf Ast_zf Syntax_messages Dolmen_zf)
+)
+
+; Convenience rule to generate a fresh messages file,
+; and update an already existing one.
+(rule
+  (target new.messages)
+  (mode   promote-until-clean)
+  (deps   (:tokens tokens_zf.mly)
+          (:parser parseZf.mly))
+  (action (with-stdout-to %{target}
+          (run menhir --external-tokens Tokens_zf %{tokens}
+                      %{parser} --base %{parser} --list-errors)))
+)
+
+(rule
+  (target updated.messages)
+  (mode   promote-until-clean)
+  (deps   (:tokens tokens_zf.mly)
+          (:parser parseZf.mly)
+          (:msg syntax.messages))
+  (action (with-stdout-to %{target}
+          (run menhir --external-tokens Tokens_zf %{tokens}
+                      %{parser} --base %{parser} --update-errors %{msg})))
+)
+
+; Additional rule to add to runtest a check that the messages file is up-to-date
+(rule
+  (alias runtest)
+  (deps   (:tokens tokens_zf.mly)
+          (:parser parseZf.mly)
+          (:new new.messages)
+          (:msg syntax.messages))
+  (action (run menhir --external-tokens Tokens_zf %{tokens}
+                      %{parser} --base %{parser} --compare-errors %{new} --compare-errors %{msg}))
 )
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/zf/lexZf.mll b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/zf/lexZf.mll
index 9c219e77ec0f7b8a6e34f9f7c1738e620a0871e9..562bc5572a18fdff589087ed8d65d776966a4de1 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/zf/lexZf.mll
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/zf/lexZf.mll
@@ -4,9 +4,11 @@
 (** {1 Lexer for Zipperposition Formulas} *)
 
 {
+  exception Error
+
   open Tokens_zf
 
-  exception Error
+  let descr _ = assert false
 }
 
 let printable_char = [^ '\n']
@@ -34,11 +36,11 @@ let unsigned_integer = decimal
 let signed_integer = sign unsigned_integer
 let integer = signed_integer | unsigned_integer
 
-rule token = parse
+rule token newline = parse
   | eof { EOF }
-  | '\n' { Lexing.new_line lexbuf; token lexbuf }
-  | [' ' '\t' '\r'] { token lexbuf }
-  | comment_line { token lexbuf }
+  | '\n' { newline lexbuf; token newline lexbuf }
+  | [' ' '\t' '\r'] { token newline lexbuf }
+  | comment_line { token newline lexbuf }
   | '(' { LEFT_PAREN }
   | ')' { RIGHT_PAREN }
   | '[' { LEFT_BRACKET }
@@ -93,13 +95,13 @@ rule token = parse
   | lower_word { LOWER_WORD(Lexing.lexeme lexbuf) }
   | upper_word { UPPER_WORD(Lexing.lexeme lexbuf) }
   | integer { INTEGER(Lexing.lexeme lexbuf) }
-  | '"' { quoted (Buffer.create 42) lexbuf }
+  | '"' { quoted newline (Buffer.create 42) lexbuf }
   | _ { raise Error }
 
 (* we unquote during lexing rather then during the parsing *)
-and quoted b = parse
+and quoted newline b = parse
   | '"'       { QUOTED(Buffer.contents b) }
-  | '\\' '"'  { Buffer.add_char b '"'; quoted b lexbuf }
-  | _ as c    { if c = '\n' then Lexing.new_line lexbuf;
-                Buffer.add_char b c; quoted b lexbuf }
+  | '\\' '"'  { Buffer.add_char b '"'; quoted newline b lexbuf }
+  | _ as c    { if c = '\n' then newline lexbuf;
+                Buffer.add_char b c; quoted newline b lexbuf }
 
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/zf/parseZf.mly b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/zf/parseZf.mly
index cf43752cf12f0ea7b296ab05abc3c8b47121cdd6..513ce3987c62642d4d4f7da0461e4575e1e66768 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/zf/parseZf.mly
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/zf/parseZf.mly
@@ -192,8 +192,12 @@ term:
     { let loc = L.mk_pos $startpos $endpos in T.pi ~loc vars t }
   | IF a=term THEN b=term ELSE c=term
     { let loc = L.mk_pos $startpos $endpos in T.ite ~loc a b c }
+  /*
   | error
-    { let loc = L.mk_pos $startpos $endpos in raise (L.Syntax_error (loc, "expected term")) }
+    { let loc = L.mk_pos $startpos $endpos in
+      let msg = Format.dprintf ": expected a term" in
+      raise (L.Syntax_error (loc, msg)) }
+  */
 
 constructor:
   | v=name l=atomic_term*
@@ -260,8 +264,12 @@ statement:
     { let loc = L.mk_pos $startpos $endpos in S.goal ~loc ~attrs t }
   | DATA attrs=attrs l=mutual_types DOT
     { let loc = L.mk_pos $startpos $endpos in S.data ~loc ~attrs l }
+  /*
   | error
-    { let loc = L.mk_pos $startpos $endpos in raise (L.Syntax_error (loc, "expected statement")) }
+    { let loc = L.mk_pos $startpos $endpos in
+      let msg = Format.dprintf ": expected a statement" in
+      raise (L.Syntax_error (loc, msg)) }
+  */
 
 input:
   | EOF         { None }
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/zf/syntax.messages b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/zf/syntax.messages
new file mode 100644
index 0000000000000000000000000000000000000000..8a2109ea1beb146fceafe40dd19a92961ba79b4c
--- /dev/null
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/languages/zf/syntax.messages
@@ -0,0 +1,1864 @@
+input: ASSERT LEFT_BRACKET LOWER_WORD RIGHT_BRACKET ARITH_LT
+##
+## Ends in an error in state: 242.
+##
+## statement -> ASSERT attrs . term DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## ASSERT attrs
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: ASSERT WILDCARD WITH
+##
+## Ends in an error in state: 243.
+##
+## statement -> ASSERT attrs term . DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## ASSERT attrs term
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 62, spurious reduction of production apply_term -> atomic_term 
+## In state 95, spurious reduction of production mult_term -> apply_term 
+## In state 71, spurious reduction of production plus_term -> mult_term 
+## In state 68, spurious reduction of production arith_op_term -> plus_term 
+## In state 89, spurious reduction of production not_term -> arith_op_term 
+## In state 86, spurious reduction of production eq_term -> not_term 
+## In state 92, spurious reduction of production and_term -> eq_term 
+## In state 98, spurious reduction of production or_term -> and_term 
+## In state 85, spurious reduction of production term -> or_term 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: ASSERT WITH
+##
+## Ends in an error in state: 241.
+##
+## statement -> ASSERT . attrs term DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## ASSERT
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: DATA LEFT_BRACKET LOWER_WORD RIGHT_BRACKET WITH
+##
+## Ends in an error in state: 238.
+##
+## statement -> DATA attrs . mutual_types DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## DATA attrs
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: DATA WITH
+##
+## Ends in an error in state: 237.
+##
+## statement -> DATA . attrs mutual_types DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## DATA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: DEF LEFT_BRACKET LOWER_WORD RIGHT_BRACKET WITH
+##
+## Ends in an error in state: 234.
+##
+## statement -> DEF attrs . separated_nonempty_list(AND,def) DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## DEF attrs
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: DEF WITH
+##
+## Ends in an error in state: 233.
+##
+## statement -> DEF . attrs separated_nonempty_list(AND,def) DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## DEF
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: GOAL LEFT_BRACKET LOWER_WORD RIGHT_BRACKET ARITH_LT
+##
+## Ends in an error in state: 229.
+##
+## statement -> GOAL attrs . term DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## GOAL attrs
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: GOAL WILDCARD WITH
+##
+## Ends in an error in state: 230.
+##
+## statement -> GOAL attrs term . DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## GOAL attrs term
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 62, spurious reduction of production apply_term -> atomic_term 
+## In state 95, spurious reduction of production mult_term -> apply_term 
+## In state 71, spurious reduction of production plus_term -> mult_term 
+## In state 68, spurious reduction of production arith_op_term -> plus_term 
+## In state 89, spurious reduction of production not_term -> arith_op_term 
+## In state 86, spurious reduction of production eq_term -> not_term 
+## In state 92, spurious reduction of production and_term -> eq_term 
+## In state 98, spurious reduction of production or_term -> and_term 
+## In state 85, spurious reduction of production term -> or_term 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: GOAL WITH
+##
+## Ends in an error in state: 228.
+##
+## statement -> GOAL . attrs term DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## GOAL
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: INCLUDE QUOTED WITH
+##
+## Ends in an error in state: 226.
+##
+## statement -> INCLUDE QUOTED . DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## INCLUDE QUOTED
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: INCLUDE WITH
+##
+## Ends in an error in state: 225.
+##
+## statement -> INCLUDE . QUOTED DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## INCLUDE
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: LEMMA LEFT_BRACKET LOWER_WORD RIGHT_BRACKET ARITH_LT
+##
+## Ends in an error in state: 222.
+##
+## statement -> LEMMA attrs . term DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## LEMMA attrs
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: LEMMA WILDCARD WITH
+##
+## Ends in an error in state: 223.
+##
+## statement -> LEMMA attrs term . DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## LEMMA attrs term
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 62, spurious reduction of production apply_term -> atomic_term 
+## In state 95, spurious reduction of production mult_term -> apply_term 
+## In state 71, spurious reduction of production plus_term -> mult_term 
+## In state 68, spurious reduction of production arith_op_term -> plus_term 
+## In state 89, spurious reduction of production not_term -> arith_op_term 
+## In state 86, spurious reduction of production eq_term -> not_term 
+## In state 92, spurious reduction of production and_term -> eq_term 
+## In state 98, spurious reduction of production or_term -> and_term 
+## In state 85, spurious reduction of production term -> or_term 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: LEMMA WITH
+##
+## Ends in an error in state: 221.
+##
+## statement -> LEMMA . attrs term DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## LEMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: REWRITE LEFT_BRACKET LOWER_WORD RIGHT_BRACKET ARITH_LT
+##
+## Ends in an error in state: 218.
+##
+## statement -> REWRITE attrs . term DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## REWRITE attrs
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: REWRITE WILDCARD WITH
+##
+## Ends in an error in state: 219.
+##
+## statement -> REWRITE attrs term . DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## REWRITE attrs term
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 62, spurious reduction of production apply_term -> atomic_term 
+## In state 95, spurious reduction of production mult_term -> apply_term 
+## In state 71, spurious reduction of production plus_term -> mult_term 
+## In state 68, spurious reduction of production arith_op_term -> plus_term 
+## In state 89, spurious reduction of production not_term -> arith_op_term 
+## In state 86, spurious reduction of production eq_term -> not_term 
+## In state 92, spurious reduction of production and_term -> eq_term 
+## In state 98, spurious reduction of production or_term -> and_term 
+## In state 85, spurious reduction of production term -> or_term 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: REWRITE WITH
+##
+## Ends in an error in state: 217.
+##
+## statement -> REWRITE . attrs term DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## REWRITE
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: VAL LEFT_BRACKET LOWER_WORD RIGHT_BRACKET WITH
+##
+## Ends in an error in state: 212.
+##
+## statement -> VAL attrs . name COLON term DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## VAL attrs
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: VAL UPPER_WORD COLON WILDCARD WITH
+##
+## Ends in an error in state: 215.
+##
+## statement -> VAL attrs name COLON term . DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## VAL attrs name COLON term
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 62, spurious reduction of production apply_term -> atomic_term 
+## In state 95, spurious reduction of production mult_term -> apply_term 
+## In state 71, spurious reduction of production plus_term -> mult_term 
+## In state 68, spurious reduction of production arith_op_term -> plus_term 
+## In state 89, spurious reduction of production not_term -> arith_op_term 
+## In state 86, spurious reduction of production eq_term -> not_term 
+## In state 92, spurious reduction of production and_term -> eq_term 
+## In state 98, spurious reduction of production or_term -> and_term 
+## In state 85, spurious reduction of production term -> or_term 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: VAL UPPER_WORD COLON WITH
+##
+## Ends in an error in state: 214.
+##
+## statement -> VAL attrs name COLON . term DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## VAL attrs name COLON
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: VAL UPPER_WORD WITH
+##
+## Ends in an error in state: 213.
+##
+## statement -> VAL attrs name . COLON term DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## VAL attrs name
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: VAL WITH
+##
+## Ends in an error in state: 211.
+##
+## statement -> VAL . attrs name COLON term DOT [ # ]
+##
+## The known suffix of the stack is as follows:
+## VAL
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+input: WITH
+##
+## Ends in an error in state: 210.
+##
+## input' -> . input [ # ]
+##
+## The known suffix of the stack is as follows:
+##
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: ASSERT LEFT_BRACKET LOWER_WORD RIGHT_BRACKET ARITH_LT
+##
+## Ends in an error in state: 202.
+##
+## statement -> ASSERT attrs . term DOT [ VAL REWRITE LEMMA INCLUDE GOAL EOF DEF DATA ASSERT ]
+##
+## The known suffix of the stack is as follows:
+## ASSERT attrs
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: ASSERT WILDCARD WITH
+##
+## Ends in an error in state: 203.
+##
+## statement -> ASSERT attrs term . DOT [ VAL REWRITE LEMMA INCLUDE GOAL EOF DEF DATA ASSERT ]
+##
+## The known suffix of the stack is as follows:
+## ASSERT attrs term
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 62, spurious reduction of production apply_term -> atomic_term 
+## In state 95, spurious reduction of production mult_term -> apply_term 
+## In state 71, spurious reduction of production plus_term -> mult_term 
+## In state 68, spurious reduction of production arith_op_term -> plus_term 
+## In state 89, spurious reduction of production not_term -> arith_op_term 
+## In state 86, spurious reduction of production eq_term -> not_term 
+## In state 92, spurious reduction of production and_term -> eq_term 
+## In state 98, spurious reduction of production or_term -> and_term 
+## In state 85, spurious reduction of production term -> or_term 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: ASSERT WITH
+##
+## Ends in an error in state: 201.
+##
+## statement -> ASSERT . attrs term DOT [ VAL REWRITE LEMMA INCLUDE GOAL EOF DEF DATA ASSERT ]
+##
+## The known suffix of the stack is as follows:
+## ASSERT
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: DATA LEFT_BRACKET LOWER_WORD RIGHT_BRACKET WITH
+##
+## Ends in an error in state: 178.
+##
+## statement -> DATA attrs . mutual_types DOT [ VAL REWRITE LEMMA INCLUDE GOAL EOF DEF DATA ASSERT ]
+##
+## The known suffix of the stack is as follows:
+## DATA attrs
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: DATA UPPER_WORD EQDEF LOWER_WORD AND WITH
+##
+## Ends in an error in state: 180.
+##
+## separated_nonempty_list(AND,type_def) -> type_def AND . separated_nonempty_list(AND,type_def) [ DOT ]
+##
+## The known suffix of the stack is as follows:
+## type_def AND
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: DATA UPPER_WORD EQDEF UPPER_WORD VERTICAL_BAR WITH
+##
+## Ends in an error in state: 195.
+##
+## separated_nonempty_list(VERTICAL_BAR,constructor) -> constructor VERTICAL_BAR . separated_nonempty_list(VERTICAL_BAR,constructor) [ DOT AND ]
+##
+## The known suffix of the stack is as follows:
+## constructor VERTICAL_BAR
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: DATA UPPER_WORD EQDEF UPPER_WORD WILDCARD WITH
+##
+## Ends in an error in state: 192.
+##
+## list(atomic_term) -> atomic_term . list(atomic_term) [ VERTICAL_BAR DOT AND ]
+##
+## The known suffix of the stack is as follows:
+## atomic_term
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: DATA UPPER_WORD EQDEF UPPER_WORD WITH
+##
+## Ends in an error in state: 190.
+##
+## constructor -> name . list(atomic_term) [ VERTICAL_BAR DOT AND ]
+##
+## The known suffix of the stack is as follows:
+## name
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: DATA UPPER_WORD EQDEF VERTICAL_BAR LOGIC_TRUE
+##
+## Ends in an error in state: 188.
+##
+## constructors -> option(VERTICAL_BAR) . separated_nonempty_list(VERTICAL_BAR,constructor) [ DOT AND ]
+##
+## The known suffix of the stack is as follows:
+## option(VERTICAL_BAR)
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: DATA UPPER_WORD EQDEF WITH
+##
+## Ends in an error in state: 186.
+##
+## type_def -> name list(raw_var) EQDEF . constructors [ DOT AND ]
+##
+## The known suffix of the stack is as follows:
+## name list(raw_var) EQDEF
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: DATA UPPER_WORD UPPER_WORD WITH
+##
+## Ends in an error in state: 183.
+##
+## list(raw_var) -> raw_var . list(raw_var) [ EQDEF ]
+##
+## The known suffix of the stack is as follows:
+## raw_var
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: DATA UPPER_WORD WITH
+##
+## Ends in an error in state: 182.
+##
+## type_def -> name . list(raw_var) EQDEF constructors [ DOT AND ]
+##
+## The known suffix of the stack is as follows:
+## name
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: DATA WITH
+##
+## Ends in an error in state: 177.
+##
+## statement -> DATA . attrs mutual_types DOT [ VAL REWRITE LEMMA INCLUDE GOAL EOF DEF DATA ASSERT ]
+##
+## The known suffix of the stack is as follows:
+## DATA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: DEF LEFT_BRACKET LOWER_WORD RIGHT_BRACKET WITH
+##
+## Ends in an error in state: 161.
+##
+## statement -> DEF attrs . separated_nonempty_list(AND,def) DOT [ VAL REWRITE LEMMA INCLUDE GOAL EOF DEF DATA ASSERT ]
+##
+## The known suffix of the stack is as follows:
+## DEF attrs
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: DEF UPPER_WORD COLON INT EQDEF INT AND WITH
+##
+## Ends in an error in state: 175.
+##
+## separated_nonempty_list(AND,def) -> def AND . separated_nonempty_list(AND,def) [ DOT ]
+##
+## The known suffix of the stack is as follows:
+## def AND
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: DEF UPPER_WORD COLON INT EQDEF INT WITH
+##
+## Ends in an error in state: 174.
+##
+## separated_nonempty_list(AND,def) -> def . [ DOT ]
+## separated_nonempty_list(AND,def) -> def . AND separated_nonempty_list(AND,def) [ DOT ]
+##
+## The known suffix of the stack is as follows:
+## def
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 62, spurious reduction of production apply_term -> atomic_term 
+## In state 95, spurious reduction of production mult_term -> apply_term 
+## In state 71, spurious reduction of production plus_term -> mult_term 
+## In state 68, spurious reduction of production arith_op_term -> plus_term 
+## In state 89, spurious reduction of production not_term -> arith_op_term 
+## In state 86, spurious reduction of production eq_term -> not_term 
+## In state 92, spurious reduction of production and_term -> eq_term 
+## In state 98, spurious reduction of production or_term -> and_term 
+## In state 85, spurious reduction of production term -> or_term 
+## In state 173, spurious reduction of production def -> name COLON term EQDEF term 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: DEF UPPER_WORD COLON WILDCARD EQDEF WITH
+##
+## Ends in an error in state: 172.
+##
+## def -> name COLON term EQDEF . term [ DOT AND ]
+##
+## The known suffix of the stack is as follows:
+## name COLON term EQDEF
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: DEF UPPER_WORD COLON WILDCARD WHERE WILDCARD SEMI_COLON WITH
+##
+## Ends in an error in state: 169.
+##
+## separated_nonempty_list(SEMI_COLON,term) -> term SEMI_COLON . separated_nonempty_list(SEMI_COLON,term) [ DOT AND ]
+##
+## The known suffix of the stack is as follows:
+## term SEMI_COLON
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: DEF UPPER_WORD COLON WILDCARD WHERE WILDCARD WITH
+##
+## Ends in an error in state: 168.
+##
+## separated_nonempty_list(SEMI_COLON,term) -> term . [ DOT AND ]
+## separated_nonempty_list(SEMI_COLON,term) -> term . SEMI_COLON separated_nonempty_list(SEMI_COLON,term) [ DOT AND ]
+##
+## The known suffix of the stack is as follows:
+## term
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 62, spurious reduction of production apply_term -> atomic_term 
+## In state 95, spurious reduction of production mult_term -> apply_term 
+## In state 71, spurious reduction of production plus_term -> mult_term 
+## In state 68, spurious reduction of production arith_op_term -> plus_term 
+## In state 89, spurious reduction of production not_term -> arith_op_term 
+## In state 86, spurious reduction of production eq_term -> not_term 
+## In state 92, spurious reduction of production and_term -> eq_term 
+## In state 98, spurious reduction of production or_term -> and_term 
+## In state 85, spurious reduction of production term -> or_term 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: DEF UPPER_WORD COLON WILDCARD WHERE WITH
+##
+## Ends in an error in state: 167.
+##
+## def -> name COLON term WHERE . separated_nonempty_list(SEMI_COLON,term) [ DOT AND ]
+##
+## The known suffix of the stack is as follows:
+## name COLON term WHERE
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: DEF UPPER_WORD COLON WILDCARD WITH
+##
+## Ends in an error in state: 166.
+##
+## def -> name COLON term . EQDEF term [ DOT AND ]
+## def -> name COLON term . WHERE separated_nonempty_list(SEMI_COLON,term) [ DOT AND ]
+##
+## The known suffix of the stack is as follows:
+## name COLON term
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 62, spurious reduction of production apply_term -> atomic_term 
+## In state 95, spurious reduction of production mult_term -> apply_term 
+## In state 71, spurious reduction of production plus_term -> mult_term 
+## In state 68, spurious reduction of production arith_op_term -> plus_term 
+## In state 89, spurious reduction of production not_term -> arith_op_term 
+## In state 86, spurious reduction of production eq_term -> not_term 
+## In state 92, spurious reduction of production and_term -> eq_term 
+## In state 98, spurious reduction of production or_term -> and_term 
+## In state 85, spurious reduction of production term -> or_term 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: DEF UPPER_WORD COLON WITH
+##
+## Ends in an error in state: 165.
+##
+## def -> name COLON . term EQDEF term [ DOT AND ]
+## def -> name COLON . term WHERE separated_nonempty_list(SEMI_COLON,term) [ DOT AND ]
+##
+## The known suffix of the stack is as follows:
+## name COLON
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: DEF UPPER_WORD WITH
+##
+## Ends in an error in state: 164.
+##
+## def -> name . COLON term EQDEF term [ DOT AND ]
+## def -> name . COLON term WHERE separated_nonempty_list(SEMI_COLON,term) [ DOT AND ]
+##
+## The known suffix of the stack is as follows:
+## name
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: DEF WITH
+##
+## Ends in an error in state: 160.
+##
+## statement -> DEF . attrs separated_nonempty_list(AND,def) DOT [ VAL REWRITE LEMMA INCLUDE GOAL EOF DEF DATA ASSERT ]
+##
+## The known suffix of the stack is as follows:
+## DEF
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: GOAL LEFT_BRACKET LOWER_WORD RIGHT_BRACKET ARITH_LT
+##
+## Ends in an error in state: 157.
+##
+## statement -> GOAL attrs . term DOT [ VAL REWRITE LEMMA INCLUDE GOAL EOF DEF DATA ASSERT ]
+##
+## The known suffix of the stack is as follows:
+## GOAL attrs
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: GOAL WILDCARD WITH
+##
+## Ends in an error in state: 158.
+##
+## statement -> GOAL attrs term . DOT [ VAL REWRITE LEMMA INCLUDE GOAL EOF DEF DATA ASSERT ]
+##
+## The known suffix of the stack is as follows:
+## GOAL attrs term
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 62, spurious reduction of production apply_term -> atomic_term 
+## In state 95, spurious reduction of production mult_term -> apply_term 
+## In state 71, spurious reduction of production plus_term -> mult_term 
+## In state 68, spurious reduction of production arith_op_term -> plus_term 
+## In state 89, spurious reduction of production not_term -> arith_op_term 
+## In state 86, spurious reduction of production eq_term -> not_term 
+## In state 92, spurious reduction of production and_term -> eq_term 
+## In state 98, spurious reduction of production or_term -> and_term 
+## In state 85, spurious reduction of production term -> or_term 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: GOAL WITH
+##
+## Ends in an error in state: 156.
+##
+## statement -> GOAL . attrs term DOT [ VAL REWRITE LEMMA INCLUDE GOAL EOF DEF DATA ASSERT ]
+##
+## The known suffix of the stack is as follows:
+## GOAL
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: INCLUDE QUOTED WITH
+##
+## Ends in an error in state: 154.
+##
+## statement -> INCLUDE QUOTED . DOT [ VAL REWRITE LEMMA INCLUDE GOAL EOF DEF DATA ASSERT ]
+##
+## The known suffix of the stack is as follows:
+## INCLUDE QUOTED
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: INCLUDE WITH
+##
+## Ends in an error in state: 153.
+##
+## statement -> INCLUDE . QUOTED DOT [ VAL REWRITE LEMMA INCLUDE GOAL EOF DEF DATA ASSERT ]
+##
+## The known suffix of the stack is as follows:
+## INCLUDE
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: LEMMA LEFT_BRACKET LOWER_WORD RIGHT_BRACKET ARITH_LT
+##
+## Ends in an error in state: 150.
+##
+## statement -> LEMMA attrs . term DOT [ VAL REWRITE LEMMA INCLUDE GOAL EOF DEF DATA ASSERT ]
+##
+## The known suffix of the stack is as follows:
+## LEMMA attrs
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: LEMMA WILDCARD WITH
+##
+## Ends in an error in state: 151.
+##
+## statement -> LEMMA attrs term . DOT [ VAL REWRITE LEMMA INCLUDE GOAL EOF DEF DATA ASSERT ]
+##
+## The known suffix of the stack is as follows:
+## LEMMA attrs term
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 62, spurious reduction of production apply_term -> atomic_term 
+## In state 95, spurious reduction of production mult_term -> apply_term 
+## In state 71, spurious reduction of production plus_term -> mult_term 
+## In state 68, spurious reduction of production arith_op_term -> plus_term 
+## In state 89, spurious reduction of production not_term -> arith_op_term 
+## In state 86, spurious reduction of production eq_term -> not_term 
+## In state 92, spurious reduction of production and_term -> eq_term 
+## In state 98, spurious reduction of production or_term -> and_term 
+## In state 85, spurious reduction of production term -> or_term 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: LEMMA WITH
+##
+## Ends in an error in state: 149.
+##
+## statement -> LEMMA . attrs term DOT [ VAL REWRITE LEMMA INCLUDE GOAL EOF DEF DATA ASSERT ]
+##
+## The known suffix of the stack is as follows:
+## LEMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE ARITH_MINUS WITH
+##
+## Ends in an error in state: 57.
+##
+## apply_term -> ARITH_MINUS . apply_term [ WITH WHERE VERTICAL_BAR THEN SEMI_COLON RIGHT_PAREN LOGIC_OR LOGIC_NEQ LOGIC_IMPLY LOGIC_EQUIV LOGIC_EQ LOGIC_AND EQDEF END ELSE DOT ARROW ARITH_PRODUCT ARITH_PLUS ARITH_MINUS ARITH_LT ARITH_LEQ ARITH_GT ARITH_GEQ AND ]
+##
+## The known suffix of the stack is as follows:
+## ARITH_MINUS
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE FUN WILDCARD DOT WITH
+##
+## Ends in an error in state: 56.
+##
+## term -> FUN typed_var_list DOT . term [ WITH WHERE VERTICAL_BAR THEN SEMI_COLON RIGHT_PAREN EQDEF END ELSE DOT AND ]
+##
+## The known suffix of the stack is as follows:
+## FUN typed_var_list DOT
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE FUN WITH
+##
+## Ends in an error in state: 54.
+##
+## term -> FUN . typed_var_list DOT term [ WITH WHERE VERTICAL_BAR THEN SEMI_COLON RIGHT_PAREN EQDEF END ELSE DOT AND ]
+##
+## The known suffix of the stack is as follows:
+## FUN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE IF WILDCARD THEN WILDCARD ELSE WITH
+##
+## Ends in an error in state: 111.
+##
+## term -> IF term THEN term ELSE . term [ WITH WHERE VERTICAL_BAR THEN SEMI_COLON RIGHT_PAREN EQDEF END ELSE DOT AND ]
+##
+## The known suffix of the stack is as follows:
+## IF term THEN term ELSE
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE IF WILDCARD THEN WILDCARD WITH
+##
+## Ends in an error in state: 110.
+##
+## term -> IF term THEN term . ELSE term [ WITH WHERE VERTICAL_BAR THEN SEMI_COLON RIGHT_PAREN EQDEF END ELSE DOT AND ]
+##
+## The known suffix of the stack is as follows:
+## IF term THEN term
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 62, spurious reduction of production apply_term -> atomic_term 
+## In state 95, spurious reduction of production mult_term -> apply_term 
+## In state 71, spurious reduction of production plus_term -> mult_term 
+## In state 68, spurious reduction of production arith_op_term -> plus_term 
+## In state 89, spurious reduction of production not_term -> arith_op_term 
+## In state 86, spurious reduction of production eq_term -> not_term 
+## In state 92, spurious reduction of production and_term -> eq_term 
+## In state 98, spurious reduction of production or_term -> and_term 
+## In state 85, spurious reduction of production term -> or_term 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE IF WILDCARD THEN WITH
+##
+## Ends in an error in state: 109.
+##
+## term -> IF term THEN . term ELSE term [ WITH WHERE VERTICAL_BAR THEN SEMI_COLON RIGHT_PAREN EQDEF END ELSE DOT AND ]
+##
+## The known suffix of the stack is as follows:
+## IF term THEN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE IF WILDCARD WITH
+##
+## Ends in an error in state: 108.
+##
+## term -> IF term . THEN term ELSE term [ WITH WHERE VERTICAL_BAR THEN SEMI_COLON RIGHT_PAREN EQDEF END ELSE DOT AND ]
+##
+## The known suffix of the stack is as follows:
+## IF term
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 62, spurious reduction of production apply_term -> atomic_term 
+## In state 95, spurious reduction of production mult_term -> apply_term 
+## In state 71, spurious reduction of production plus_term -> mult_term 
+## In state 68, spurious reduction of production arith_op_term -> plus_term 
+## In state 89, spurious reduction of production not_term -> arith_op_term 
+## In state 86, spurious reduction of production eq_term -> not_term 
+## In state 92, spurious reduction of production and_term -> eq_term 
+## In state 98, spurious reduction of production or_term -> and_term 
+## In state 85, spurious reduction of production term -> or_term 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE IF WITH
+##
+## Ends in an error in state: 53.
+##
+## term -> IF . term THEN term ELSE term [ WITH WHERE VERTICAL_BAR THEN SEMI_COLON RIGHT_PAREN EQDEF END ELSE DOT AND ]
+##
+## The known suffix of the stack is as follows:
+## IF
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE INT DOT WITH
+##
+## Ends in an error in state: 205.
+##
+## list(statement) -> statement . list(statement) [ EOF ]
+##
+## The known suffix of the stack is as follows:
+## statement
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE LEFT_BRACKET LOWER_WORD RIGHT_BRACKET ARITH_LT
+##
+## Ends in an error in state: 146.
+##
+## statement -> REWRITE attrs . term DOT [ VAL REWRITE LEMMA INCLUDE GOAL EOF DEF DATA ASSERT ]
+##
+## The known suffix of the stack is as follows:
+## REWRITE attrs
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE LEFT_PAREN WILDCARD WITH
+##
+## Ends in an error in state: 119.
+##
+## atomic_term -> LEFT_PAREN term . RIGHT_PAREN [ WITH WILDCARD WHERE VERTICAL_BAR UPPER_WORD TYPE THEN SEMI_COLON RIGHT_PAREN PROP MATCH LOWER_WORD LOGIC_TRUE LOGIC_OR LOGIC_NEQ LOGIC_IMPLY LOGIC_FALSE LOGIC_EQUIV LOGIC_EQ LOGIC_AND LEFT_PAREN INTEGER INT EQDEF END ELSE DOT ARROW ARITH_PRODUCT ARITH_PLUS ARITH_MINUS ARITH_LT ARITH_LEQ ARITH_GT ARITH_GEQ AND ]
+##
+## The known suffix of the stack is as follows:
+## LEFT_PAREN term
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 62, spurious reduction of production apply_term -> atomic_term 
+## In state 95, spurious reduction of production mult_term -> apply_term 
+## In state 71, spurious reduction of production plus_term -> mult_term 
+## In state 68, spurious reduction of production arith_op_term -> plus_term 
+## In state 89, spurious reduction of production not_term -> arith_op_term 
+## In state 86, spurious reduction of production eq_term -> not_term 
+## In state 92, spurious reduction of production and_term -> eq_term 
+## In state 98, spurious reduction of production or_term -> and_term 
+## In state 85, spurious reduction of production term -> or_term 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE LEFT_PAREN WITH
+##
+## Ends in an error in state: 42.
+##
+## atomic_term -> LEFT_PAREN . term RIGHT_PAREN [ WITH WILDCARD WHERE VERTICAL_BAR UPPER_WORD TYPE THEN SEMI_COLON RIGHT_PAREN PROP MATCH LOWER_WORD LOGIC_TRUE LOGIC_OR LOGIC_NEQ LOGIC_IMPLY LOGIC_FALSE LOGIC_EQUIV LOGIC_EQ LOGIC_AND LEFT_PAREN INTEGER INT EQDEF END ELSE DOT ARROW ARITH_PRODUCT ARITH_PLUS ARITH_MINUS ARITH_LT ARITH_LEQ ARITH_GT ARITH_GEQ AND ]
+##
+## The known suffix of the stack is as follows:
+## LEFT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE LOGIC_EXISTS WILDCARD DOT WITH
+##
+## Ends in an error in state: 50.
+##
+## term -> LOGIC_EXISTS typed_var_list DOT . term [ WITH WHERE VERTICAL_BAR THEN SEMI_COLON RIGHT_PAREN EQDEF END ELSE DOT AND ]
+##
+## The known suffix of the stack is as follows:
+## LOGIC_EXISTS typed_var_list DOT
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE LOGIC_EXISTS WITH
+##
+## Ends in an error in state: 47.
+##
+## term -> LOGIC_EXISTS . typed_var_list DOT term [ WITH WHERE VERTICAL_BAR THEN SEMI_COLON RIGHT_PAREN EQDEF END ELSE DOT AND ]
+##
+## The known suffix of the stack is as follows:
+## LOGIC_EXISTS
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE LOGIC_FORALL LEFT_PAREN UPPER_WORD COLON WILDCARD WITH
+##
+## Ends in an error in state: 114.
+##
+## typed_var_block -> LEFT_PAREN nonempty_list(raw_var) COLON term . RIGHT_PAREN [ WILDCARD UPPER_WORD LOWER_WORD LEFT_PAREN DOT ]
+##
+## The known suffix of the stack is as follows:
+## LEFT_PAREN nonempty_list(raw_var) COLON term
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 62, spurious reduction of production apply_term -> atomic_term 
+## In state 95, spurious reduction of production mult_term -> apply_term 
+## In state 71, spurious reduction of production plus_term -> mult_term 
+## In state 68, spurious reduction of production arith_op_term -> plus_term 
+## In state 89, spurious reduction of production not_term -> arith_op_term 
+## In state 86, spurious reduction of production eq_term -> not_term 
+## In state 92, spurious reduction of production and_term -> eq_term 
+## In state 98, spurious reduction of production or_term -> and_term 
+## In state 85, spurious reduction of production term -> or_term 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE LOGIC_FORALL LEFT_PAREN UPPER_WORD COLON WITH
+##
+## Ends in an error in state: 46.
+##
+## typed_var_block -> LEFT_PAREN nonempty_list(raw_var) COLON . term RIGHT_PAREN [ WILDCARD UPPER_WORD LOWER_WORD LEFT_PAREN DOT ]
+##
+## The known suffix of the stack is as follows:
+## LEFT_PAREN nonempty_list(raw_var) COLON
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE LOGIC_FORALL LEFT_PAREN WITH
+##
+## Ends in an error in state: 44.
+##
+## typed_var_block -> LEFT_PAREN . nonempty_list(raw_var) COLON term RIGHT_PAREN [ WILDCARD UPPER_WORD LOWER_WORD LEFT_PAREN DOT ]
+##
+## The known suffix of the stack is as follows:
+## LEFT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE LOGIC_FORALL WILDCARD DOT WITH
+##
+## Ends in an error in state: 117.
+##
+## term -> LOGIC_FORALL typed_var_list DOT . term [ WITH WHERE VERTICAL_BAR THEN SEMI_COLON RIGHT_PAREN EQDEF END ELSE DOT AND ]
+##
+## The known suffix of the stack is as follows:
+## LOGIC_FORALL typed_var_list DOT
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE LOGIC_FORALL WILDCARD WITH
+##
+## Ends in an error in state: 105.
+##
+## typed_var_list -> typed_var_block . [ DOT ]
+## typed_var_list -> typed_var_block . typed_var_list [ DOT ]
+##
+## The known suffix of the stack is as follows:
+## typed_var_block
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE LOGIC_FORALL WITH
+##
+## Ends in an error in state: 43.
+##
+## term -> LOGIC_FORALL . typed_var_list DOT term [ WITH WHERE VERTICAL_BAR THEN SEMI_COLON RIGHT_PAREN EQDEF END ELSE DOT AND ]
+##
+## The known suffix of the stack is as follows:
+## LOGIC_FORALL
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE LOGIC_NOT WILDCARD ARROW
+##
+## Ends in an error in state: 74.
+##
+## mult_term -> apply_term . [ WITH WHERE VERTICAL_BAR THEN SEMI_COLON RIGHT_PAREN LOGIC_OR LOGIC_NEQ LOGIC_IMPLY LOGIC_EQUIV LOGIC_EQ LOGIC_AND EQDEF END ELSE DOT ARITH_PLUS ARITH_MINUS ARITH_LT ARITH_LEQ ARITH_GT ARITH_GEQ AND ]
+## mult_term -> apply_term . ARITH_PRODUCT mult_term [ WITH WHERE VERTICAL_BAR THEN SEMI_COLON RIGHT_PAREN LOGIC_OR LOGIC_NEQ LOGIC_IMPLY LOGIC_EQUIV LOGIC_EQ LOGIC_AND EQDEF END ELSE DOT ARITH_PLUS ARITH_MINUS ARITH_LT ARITH_LEQ ARITH_GT ARITH_GEQ AND ]
+##
+## The known suffix of the stack is as follows:
+## apply_term
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 62, spurious reduction of production apply_term -> atomic_term 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE LOGIC_NOT WITH
+##
+## Ends in an error in state: 40.
+##
+## not_term -> LOGIC_NOT . arith_op_term [ WITH WHERE VERTICAL_BAR THEN SEMI_COLON RIGHT_PAREN LOGIC_OR LOGIC_NEQ LOGIC_IMPLY LOGIC_EQUIV LOGIC_EQ LOGIC_AND EQDEF END ELSE DOT AND ]
+##
+## The known suffix of the stack is as follows:
+## LOGIC_NOT
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE MATCH WILDCARD WHERE
+##
+## Ends in an error in state: 122.
+##
+## atomic_term -> MATCH term . WITH nonempty_list(match_branch) END [ WITH WILDCARD WHERE VERTICAL_BAR UPPER_WORD TYPE THEN SEMI_COLON RIGHT_PAREN PROP MATCH LOWER_WORD LOGIC_TRUE LOGIC_OR LOGIC_NEQ LOGIC_IMPLY LOGIC_FALSE LOGIC_EQUIV LOGIC_EQ LOGIC_AND LEFT_PAREN INTEGER INT EQDEF END ELSE DOT ARROW ARITH_PRODUCT ARITH_PLUS ARITH_MINUS ARITH_LT ARITH_LEQ ARITH_GT ARITH_GEQ AND ]
+##
+## The known suffix of the stack is as follows:
+## MATCH term
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 62, spurious reduction of production apply_term -> atomic_term 
+## In state 95, spurious reduction of production mult_term -> apply_term 
+## In state 71, spurious reduction of production plus_term -> mult_term 
+## In state 68, spurious reduction of production arith_op_term -> plus_term 
+## In state 89, spurious reduction of production not_term -> arith_op_term 
+## In state 86, spurious reduction of production eq_term -> not_term 
+## In state 92, spurious reduction of production and_term -> eq_term 
+## In state 98, spurious reduction of production or_term -> and_term 
+## In state 85, spurious reduction of production term -> or_term 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE MATCH WILDCARD WITH VERTICAL_BAR UPPER_WORD ARROW INT WITH
+##
+## Ends in an error in state: 135.
+##
+## nonempty_list(match_branch) -> match_branch . [ END ]
+## nonempty_list(match_branch) -> match_branch . nonempty_list(match_branch) [ END ]
+##
+## The known suffix of the stack is as follows:
+## match_branch
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 62, spurious reduction of production apply_term -> atomic_term 
+## In state 95, spurious reduction of production mult_term -> apply_term 
+## In state 71, spurious reduction of production plus_term -> mult_term 
+## In state 68, spurious reduction of production arith_op_term -> plus_term 
+## In state 89, spurious reduction of production not_term -> arith_op_term 
+## In state 86, spurious reduction of production eq_term -> not_term 
+## In state 92, spurious reduction of production and_term -> eq_term 
+## In state 98, spurious reduction of production or_term -> and_term 
+## In state 85, spurious reduction of production term -> or_term 
+## In state 132, spurious reduction of production match_branch -> VERTICAL_BAR raw_var list(var_or_wildcard) ARROW term 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE MATCH WILDCARD WITH VERTICAL_BAR UPPER_WORD ARROW WITH
+##
+## Ends in an error in state: 131.
+##
+## match_branch -> VERTICAL_BAR raw_var list(var_or_wildcard) ARROW . term [ VERTICAL_BAR END ]
+##
+## The known suffix of the stack is as follows:
+## VERTICAL_BAR raw_var list(var_or_wildcard) ARROW
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE MATCH WILDCARD WITH VERTICAL_BAR UPPER_WORD WILDCARD WITH
+##
+## Ends in an error in state: 127.
+##
+## list(var_or_wildcard) -> var_or_wildcard . list(var_or_wildcard) [ ARROW ]
+##
+## The known suffix of the stack is as follows:
+## var_or_wildcard
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE MATCH WILDCARD WITH VERTICAL_BAR UPPER_WORD WITH
+##
+## Ends in an error in state: 125.
+##
+## match_branch -> VERTICAL_BAR raw_var . list(var_or_wildcard) ARROW term [ VERTICAL_BAR END ]
+##
+## The known suffix of the stack is as follows:
+## VERTICAL_BAR raw_var
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE MATCH WILDCARD WITH VERTICAL_BAR WITH
+##
+## Ends in an error in state: 124.
+##
+## match_branch -> VERTICAL_BAR . raw_var list(var_or_wildcard) ARROW term [ VERTICAL_BAR END ]
+##
+## The known suffix of the stack is as follows:
+## VERTICAL_BAR
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE MATCH WILDCARD WITH WITH
+##
+## Ends in an error in state: 123.
+##
+## atomic_term -> MATCH term WITH . nonempty_list(match_branch) END [ WITH WILDCARD WHERE VERTICAL_BAR UPPER_WORD TYPE THEN SEMI_COLON RIGHT_PAREN PROP MATCH LOWER_WORD LOGIC_TRUE LOGIC_OR LOGIC_NEQ LOGIC_IMPLY LOGIC_FALSE LOGIC_EQUIV LOGIC_EQ LOGIC_AND LEFT_PAREN INTEGER INT EQDEF END ELSE DOT ARROW ARITH_PRODUCT ARITH_PLUS ARITH_MINUS ARITH_LT ARITH_LEQ ARITH_GT ARITH_GEQ AND ]
+##
+## The known suffix of the stack is as follows:
+## MATCH term WITH
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE MATCH WITH
+##
+## Ends in an error in state: 38.
+##
+## atomic_term -> MATCH . term WITH nonempty_list(match_branch) END [ WITH WILDCARD WHERE VERTICAL_BAR UPPER_WORD TYPE THEN SEMI_COLON RIGHT_PAREN PROP MATCH LOWER_WORD LOGIC_TRUE LOGIC_OR LOGIC_NEQ LOGIC_IMPLY LOGIC_FALSE LOGIC_EQUIV LOGIC_EQ LOGIC_AND LEFT_PAREN INTEGER INT EQDEF END ELSE DOT ARROW ARITH_PRODUCT ARITH_PLUS ARITH_MINUS ARITH_LT ARITH_LEQ ARITH_GT ARITH_GEQ AND ]
+##
+## The known suffix of the stack is as follows:
+## MATCH
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE PI LEFT_PAREN UPPER_WORD COLON TYPE WITH
+##
+## Ends in an error in state: 34.
+##
+## typed_ty_var_block -> LEFT_PAREN nonempty_list(raw_var) COLON t_type . RIGHT_PAREN [ UPPER_WORD LOWER_WORD LEFT_PAREN DOT ]
+##
+## The known suffix of the stack is as follows:
+## LEFT_PAREN nonempty_list(raw_var) COLON t_type
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE PI LEFT_PAREN UPPER_WORD COLON WITH
+##
+## Ends in an error in state: 32.
+##
+## typed_ty_var_block -> LEFT_PAREN nonempty_list(raw_var) COLON . t_type RIGHT_PAREN [ UPPER_WORD LOWER_WORD LEFT_PAREN DOT ]
+##
+## The known suffix of the stack is as follows:
+## LEFT_PAREN nonempty_list(raw_var) COLON
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE PI LEFT_PAREN UPPER_WORD WITH
+##
+## Ends in an error in state: 29.
+##
+## nonempty_list(raw_var) -> raw_var . [ COLON ]
+## nonempty_list(raw_var) -> raw_var . nonempty_list(raw_var) [ COLON ]
+##
+## The known suffix of the stack is as follows:
+## raw_var
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE PI LEFT_PAREN WITH
+##
+## Ends in an error in state: 28.
+##
+## typed_ty_var_block -> LEFT_PAREN . nonempty_list(raw_var) COLON t_type RIGHT_PAREN [ UPPER_WORD LOWER_WORD LEFT_PAREN DOT ]
+##
+## The known suffix of the stack is as follows:
+## LEFT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE PI UPPER_WORD COLON TYPE WITH
+##
+## Ends in an error in state: 138.
+##
+## typed_ty_var_list -> typed_ty_var_block . [ DOT ]
+## typed_ty_var_list -> typed_ty_var_block . typed_ty_var_list [ DOT ]
+##
+## The known suffix of the stack is as follows:
+## typed_ty_var_block
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE PI UPPER_WORD COLON WITH
+##
+## Ends in an error in state: 141.
+##
+## typed_ty_var_block -> raw_var COLON . t_type [ UPPER_WORD LOWER_WORD LEFT_PAREN DOT ]
+##
+## The known suffix of the stack is as follows:
+## raw_var COLON
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE PI UPPER_WORD DOT WITH
+##
+## Ends in an error in state: 37.
+##
+## term -> PI typed_ty_var_list DOT . term [ WITH WHERE VERTICAL_BAR THEN SEMI_COLON RIGHT_PAREN EQDEF END ELSE DOT AND ]
+##
+## The known suffix of the stack is as follows:
+## PI typed_ty_var_list DOT
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE PI UPPER_WORD WITH
+##
+## Ends in an error in state: 140.
+##
+## typed_ty_var_block -> raw_var . [ UPPER_WORD LOWER_WORD LEFT_PAREN DOT ]
+## typed_ty_var_block -> raw_var . COLON t_type [ UPPER_WORD LOWER_WORD LEFT_PAREN DOT ]
+##
+## The known suffix of the stack is as follows:
+## raw_var
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE PI WITH
+##
+## Ends in an error in state: 27.
+##
+## term -> PI . typed_ty_var_list DOT term [ WITH WHERE VERTICAL_BAR THEN SEMI_COLON RIGHT_PAREN EQDEF END ELSE DOT AND ]
+##
+## The known suffix of the stack is as follows:
+## PI
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE WILDCARD ARITH_GEQ INT ARITH_LT
+##
+## Ends in an error in state: 86.
+##
+## eq_term -> not_term . [ WITH WHERE VERTICAL_BAR THEN SEMI_COLON RIGHT_PAREN LOGIC_OR LOGIC_IMPLY LOGIC_EQUIV LOGIC_AND EQDEF END ELSE DOT AND ]
+## eq_term -> not_term . LOGIC_EQ not_term [ WITH WHERE VERTICAL_BAR THEN SEMI_COLON RIGHT_PAREN LOGIC_OR LOGIC_IMPLY LOGIC_EQUIV LOGIC_AND EQDEF END ELSE DOT AND ]
+## eq_term -> not_term . LOGIC_NEQ not_term [ WITH WHERE VERTICAL_BAR THEN SEMI_COLON RIGHT_PAREN LOGIC_OR LOGIC_IMPLY LOGIC_EQUIV LOGIC_AND EQDEF END ELSE DOT AND ]
+##
+## The known suffix of the stack is as follows:
+## not_term
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 62, spurious reduction of production apply_term -> atomic_term 
+## In state 74, spurious reduction of production mult_term -> apply_term 
+## In state 71, spurious reduction of production plus_term -> mult_term 
+## In state 84, spurious reduction of production arith_op_term -> plus_term ARITH_GEQ plus_term 
+## In state 89, spurious reduction of production not_term -> arith_op_term 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE WILDCARD ARITH_GEQ WITH
+##
+## Ends in an error in state: 83.
+##
+## arith_op_term -> plus_term ARITH_GEQ . plus_term [ WITH WHERE VERTICAL_BAR THEN SEMI_COLON RIGHT_PAREN LOGIC_OR LOGIC_NEQ LOGIC_IMPLY LOGIC_EQUIV LOGIC_EQ LOGIC_AND EQDEF END ELSE DOT AND ]
+##
+## The known suffix of the stack is as follows:
+## plus_term ARITH_GEQ
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE WILDCARD ARITH_GT WITH
+##
+## Ends in an error in state: 81.
+##
+## arith_op_term -> plus_term ARITH_GT . plus_term [ WITH WHERE VERTICAL_BAR THEN SEMI_COLON RIGHT_PAREN LOGIC_OR LOGIC_NEQ LOGIC_IMPLY LOGIC_EQUIV LOGIC_EQ LOGIC_AND EQDEF END ELSE DOT AND ]
+##
+## The known suffix of the stack is as follows:
+## plus_term ARITH_GT
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE WILDCARD ARITH_LEQ WITH
+##
+## Ends in an error in state: 79.
+##
+## arith_op_term -> plus_term ARITH_LEQ . plus_term [ WITH WHERE VERTICAL_BAR THEN SEMI_COLON RIGHT_PAREN LOGIC_OR LOGIC_NEQ LOGIC_IMPLY LOGIC_EQUIV LOGIC_EQ LOGIC_AND EQDEF END ELSE DOT AND ]
+##
+## The known suffix of the stack is as follows:
+## plus_term ARITH_LEQ
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE WILDCARD ARITH_LT WITH
+##
+## Ends in an error in state: 69.
+##
+## arith_op_term -> plus_term ARITH_LT . plus_term [ WITH WHERE VERTICAL_BAR THEN SEMI_COLON RIGHT_PAREN LOGIC_OR LOGIC_NEQ LOGIC_IMPLY LOGIC_EQUIV LOGIC_EQ LOGIC_AND EQDEF END ELSE DOT AND ]
+##
+## The known suffix of the stack is as follows:
+## plus_term ARITH_LT
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE WILDCARD ARITH_MINUS WITH
+##
+## Ends in an error in state: 77.
+##
+## plus_term -> mult_term ARITH_MINUS . plus_term [ WITH WHERE VERTICAL_BAR THEN SEMI_COLON RIGHT_PAREN LOGIC_OR LOGIC_NEQ LOGIC_IMPLY LOGIC_EQUIV LOGIC_EQ LOGIC_AND EQDEF END ELSE DOT ARITH_LT ARITH_LEQ ARITH_GT ARITH_GEQ AND ]
+##
+## The known suffix of the stack is as follows:
+## mult_term ARITH_MINUS
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE WILDCARD ARITH_PLUS WITH
+##
+## Ends in an error in state: 72.
+##
+## plus_term -> mult_term ARITH_PLUS . plus_term [ WITH WHERE VERTICAL_BAR THEN SEMI_COLON RIGHT_PAREN LOGIC_OR LOGIC_NEQ LOGIC_IMPLY LOGIC_EQUIV LOGIC_EQ LOGIC_AND EQDEF END ELSE DOT ARITH_LT ARITH_LEQ ARITH_GT ARITH_GEQ AND ]
+##
+## The known suffix of the stack is as follows:
+## mult_term ARITH_PLUS
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE WILDCARD ARITH_PRODUCT WITH
+##
+## Ends in an error in state: 75.
+##
+## mult_term -> apply_term ARITH_PRODUCT . mult_term [ WITH WHERE VERTICAL_BAR THEN SEMI_COLON RIGHT_PAREN LOGIC_OR LOGIC_NEQ LOGIC_IMPLY LOGIC_EQUIV LOGIC_EQ LOGIC_AND EQDEF END ELSE DOT ARITH_PLUS ARITH_MINUS ARITH_LT ARITH_LEQ ARITH_GT ARITH_GEQ AND ]
+##
+## The known suffix of the stack is as follows:
+## apply_term ARITH_PRODUCT
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE WILDCARD ARROW WITH
+##
+## Ends in an error in state: 96.
+##
+## term -> apply_term ARROW . term [ WITH WHERE VERTICAL_BAR THEN SEMI_COLON RIGHT_PAREN EQDEF END ELSE DOT AND ]
+##
+## The known suffix of the stack is as follows:
+## apply_term ARROW
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE WILDCARD LOGIC_AND WITH
+##
+## Ends in an error in state: 93.
+##
+## and_term -> eq_term LOGIC_AND . and_term [ WITH WHERE VERTICAL_BAR THEN SEMI_COLON RIGHT_PAREN LOGIC_OR LOGIC_IMPLY LOGIC_EQUIV EQDEF END ELSE DOT AND ]
+##
+## The known suffix of the stack is as follows:
+## eq_term LOGIC_AND
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE WILDCARD LOGIC_EQ INT LOGIC_NEQ
+##
+## Ends in an error in state: 92.
+##
+## and_term -> eq_term . [ WITH WHERE VERTICAL_BAR THEN SEMI_COLON RIGHT_PAREN LOGIC_OR LOGIC_IMPLY LOGIC_EQUIV EQDEF END ELSE DOT AND ]
+## and_term -> eq_term . LOGIC_AND and_term [ WITH WHERE VERTICAL_BAR THEN SEMI_COLON RIGHT_PAREN LOGIC_OR LOGIC_IMPLY LOGIC_EQUIV EQDEF END ELSE DOT AND ]
+##
+## The known suffix of the stack is as follows:
+## eq_term
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 62, spurious reduction of production apply_term -> atomic_term 
+## In state 74, spurious reduction of production mult_term -> apply_term 
+## In state 71, spurious reduction of production plus_term -> mult_term 
+## In state 68, spurious reduction of production arith_op_term -> plus_term 
+## In state 89, spurious reduction of production not_term -> arith_op_term 
+## In state 91, spurious reduction of production eq_term -> not_term LOGIC_EQ not_term 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE WILDCARD LOGIC_EQ WITH
+##
+## Ends in an error in state: 90.
+##
+## eq_term -> not_term LOGIC_EQ . not_term [ WITH WHERE VERTICAL_BAR THEN SEMI_COLON RIGHT_PAREN LOGIC_OR LOGIC_IMPLY LOGIC_EQUIV LOGIC_AND EQDEF END ELSE DOT AND ]
+##
+## The known suffix of the stack is as follows:
+## not_term LOGIC_EQ
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE WILDCARD LOGIC_EQUIV WITH
+##
+## Ends in an error in state: 103.
+##
+## or_term -> and_term LOGIC_EQUIV . or_term [ WITH WHERE VERTICAL_BAR THEN SEMI_COLON RIGHT_PAREN EQDEF END ELSE DOT AND ]
+##
+## The known suffix of the stack is as follows:
+## and_term LOGIC_EQUIV
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE WILDCARD LOGIC_IMPLY WITH
+##
+## Ends in an error in state: 101.
+##
+## or_term -> and_term LOGIC_IMPLY . or_term [ WITH WHERE VERTICAL_BAR THEN SEMI_COLON RIGHT_PAREN EQDEF END ELSE DOT AND ]
+##
+## The known suffix of the stack is as follows:
+## and_term LOGIC_IMPLY
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE WILDCARD LOGIC_NEQ WITH
+##
+## Ends in an error in state: 87.
+##
+## eq_term -> not_term LOGIC_NEQ . not_term [ WITH WHERE VERTICAL_BAR THEN SEMI_COLON RIGHT_PAREN LOGIC_OR LOGIC_IMPLY LOGIC_EQUIV LOGIC_AND EQDEF END ELSE DOT AND ]
+##
+## The known suffix of the stack is as follows:
+## not_term LOGIC_NEQ
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE WILDCARD LOGIC_OR WITH
+##
+## Ends in an error in state: 99.
+##
+## or_term -> and_term LOGIC_OR . or_term [ WITH WHERE VERTICAL_BAR THEN SEMI_COLON RIGHT_PAREN EQDEF END ELSE DOT AND ]
+##
+## The known suffix of the stack is as follows:
+## and_term LOGIC_OR
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE WILDCARD VAL
+##
+## Ends in an error in state: 62.
+##
+## apply_term -> atomic_term . [ WITH WHERE VERTICAL_BAR THEN SEMI_COLON RIGHT_PAREN LOGIC_OR LOGIC_NEQ LOGIC_IMPLY LOGIC_EQUIV LOGIC_EQ LOGIC_AND EQDEF END ELSE DOT ARROW ARITH_PRODUCT ARITH_PLUS ARITH_MINUS ARITH_LT ARITH_LEQ ARITH_GT ARITH_GEQ AND ]
+## apply_term -> atomic_term . nonempty_list(atomic_term) [ WITH WHERE VERTICAL_BAR THEN SEMI_COLON RIGHT_PAREN LOGIC_OR LOGIC_NEQ LOGIC_IMPLY LOGIC_EQUIV LOGIC_EQ LOGIC_AND EQDEF END ELSE DOT ARROW ARITH_PRODUCT ARITH_PLUS ARITH_MINUS ARITH_LT ARITH_LEQ ARITH_GT ARITH_GEQ AND ]
+##
+## The known suffix of the stack is as follows:
+## atomic_term
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE WILDCARD WILDCARD VAL
+##
+## Ends in an error in state: 64.
+##
+## nonempty_list(atomic_term) -> atomic_term . [ WITH WHERE VERTICAL_BAR THEN SEMI_COLON RIGHT_PAREN LOGIC_OR LOGIC_NEQ LOGIC_IMPLY LOGIC_EQUIV LOGIC_EQ LOGIC_AND EQDEF END ELSE DOT ARROW ARITH_PRODUCT ARITH_PLUS ARITH_MINUS ARITH_LT ARITH_LEQ ARITH_GT ARITH_GEQ AND ]
+## nonempty_list(atomic_term) -> atomic_term . nonempty_list(atomic_term) [ WITH WHERE VERTICAL_BAR THEN SEMI_COLON RIGHT_PAREN LOGIC_OR LOGIC_NEQ LOGIC_IMPLY LOGIC_EQUIV LOGIC_EQ LOGIC_AND EQDEF END ELSE DOT ARROW ARITH_PRODUCT ARITH_PLUS ARITH_MINUS ARITH_LT ARITH_LEQ ARITH_GT ARITH_GEQ AND ]
+##
+## The known suffix of the stack is as follows:
+## atomic_term
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE WILDCARD WITH
+##
+## Ends in an error in state: 147.
+##
+## statement -> REWRITE attrs term . DOT [ VAL REWRITE LEMMA INCLUDE GOAL EOF DEF DATA ASSERT ]
+##
+## The known suffix of the stack is as follows:
+## REWRITE attrs term
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 62, spurious reduction of production apply_term -> atomic_term 
+## In state 95, spurious reduction of production mult_term -> apply_term 
+## In state 71, spurious reduction of production plus_term -> mult_term 
+## In state 68, spurious reduction of production arith_op_term -> plus_term 
+## In state 89, spurious reduction of production not_term -> arith_op_term 
+## In state 86, spurious reduction of production eq_term -> not_term 
+## In state 92, spurious reduction of production and_term -> eq_term 
+## In state 98, spurious reduction of production or_term -> and_term 
+## In state 85, spurious reduction of production term -> or_term 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: REWRITE WITH
+##
+## Ends in an error in state: 145.
+##
+## statement -> REWRITE . attrs term DOT [ VAL REWRITE LEMMA INCLUDE GOAL EOF DEF DATA ASSERT ]
+##
+## The known suffix of the stack is as follows:
+## REWRITE
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: VAL LEFT_BRACKET LEFT_PAREN UPPER_WORD RIGHT_BRACKET
+##
+## Ends in an error in state: 13.
+##
+## atomic_attr -> LEFT_PAREN attr . RIGHT_PAREN [ UPPER_WORD RIGHT_PAREN RIGHT_BRACKET QUOTED LOWER_WORD LEFT_PAREN COMMA ]
+##
+## The known suffix of the stack is as follows:
+## LEFT_PAREN attr
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 7, spurious reduction of production atomic_attr -> raw_var 
+## In state 15, spurious reduction of production attr -> atomic_attr 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: VAL LEFT_BRACKET LEFT_PAREN WITH
+##
+## Ends in an error in state: 6.
+##
+## atomic_attr -> LEFT_PAREN . attr RIGHT_PAREN [ UPPER_WORD RIGHT_PAREN RIGHT_BRACKET QUOTED LOWER_WORD LEFT_PAREN COMMA ]
+##
+## The known suffix of the stack is as follows:
+## LEFT_PAREN
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: VAL LEFT_BRACKET UPPER_WORD COMMA WITH
+##
+## Ends in an error in state: 19.
+##
+## separated_nonempty_list(COMMA,attr) -> attr COMMA . separated_nonempty_list(COMMA,attr) [ RIGHT_BRACKET ]
+##
+## The known suffix of the stack is as follows:
+## attr COMMA
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: VAL LEFT_BRACKET UPPER_WORD RIGHT_BRACKET WITH
+##
+## Ends in an error in state: 21.
+##
+## statement -> VAL attrs . name COLON term DOT [ VAL REWRITE LEMMA INCLUDE GOAL EOF DEF DATA ASSERT ]
+##
+## The known suffix of the stack is as follows:
+## VAL attrs
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: VAL LEFT_BRACKET UPPER_WORD RIGHT_PAREN
+##
+## Ends in an error in state: 18.
+##
+## separated_nonempty_list(COMMA,attr) -> attr . [ RIGHT_BRACKET ]
+## separated_nonempty_list(COMMA,attr) -> attr . COMMA separated_nonempty_list(COMMA,attr) [ RIGHT_BRACKET ]
+##
+## The known suffix of the stack is as follows:
+## attr
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 7, spurious reduction of production atomic_attr -> raw_var 
+## In state 15, spurious reduction of production attr -> atomic_attr 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: VAL LEFT_BRACKET UPPER_WORD UPPER_WORD WITH
+##
+## Ends in an error in state: 11.
+##
+## nonempty_list(atomic_attr) -> atomic_attr . [ RIGHT_PAREN RIGHT_BRACKET COMMA ]
+## nonempty_list(atomic_attr) -> atomic_attr . nonempty_list(atomic_attr) [ RIGHT_PAREN RIGHT_BRACKET COMMA ]
+##
+## The known suffix of the stack is as follows:
+## atomic_attr
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: VAL LEFT_BRACKET UPPER_WORD WITH
+##
+## Ends in an error in state: 7.
+##
+## atomic_attr -> raw_var . [ RIGHT_PAREN RIGHT_BRACKET COMMA ]
+## attr -> raw_var . nonempty_list(atomic_attr) [ RIGHT_PAREN RIGHT_BRACKET COMMA ]
+##
+## The known suffix of the stack is as follows:
+## raw_var
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: VAL LEFT_BRACKET WITH
+##
+## Ends in an error in state: 2.
+##
+## attrs -> LEFT_BRACKET . separated_nonempty_list(COMMA,attr) RIGHT_BRACKET [ WILDCARD UPPER_WORD TYPE PROP PI MATCH LOWER_WORD LOGIC_TRUE LOGIC_NOT LOGIC_FORALL LOGIC_FALSE LOGIC_EXISTS LEFT_PAREN INTEGER INT IF FUN ARITH_MINUS ]
+##
+## The known suffix of the stack is as follows:
+## LEFT_BRACKET
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: VAL UPPER_WORD COLON WILDCARD WITH
+##
+## Ends in an error in state: 143.
+##
+## statement -> VAL attrs name COLON term . DOT [ VAL REWRITE LEMMA INCLUDE GOAL EOF DEF DATA ASSERT ]
+##
+## The known suffix of the stack is as follows:
+## VAL attrs name COLON term
+##
+## WARNING: This example involves spurious reductions.
+## This implies that, although the LR(1) items shown above provide an
+## accurate view of the past (what has been recognized so far), they
+## may provide an INCOMPLETE view of the future (what was expected next).
+## In state 62, spurious reduction of production apply_term -> atomic_term 
+## In state 95, spurious reduction of production mult_term -> apply_term 
+## In state 71, spurious reduction of production plus_term -> mult_term 
+## In state 68, spurious reduction of production arith_op_term -> plus_term 
+## In state 89, spurious reduction of production not_term -> arith_op_term 
+## In state 86, spurious reduction of production eq_term -> not_term 
+## In state 92, spurious reduction of production and_term -> eq_term 
+## In state 98, spurious reduction of production or_term -> and_term 
+## In state 85, spurious reduction of production term -> or_term 
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: VAL UPPER_WORD COLON WITH
+##
+## Ends in an error in state: 23.
+##
+## statement -> VAL attrs name COLON . term DOT [ VAL REWRITE LEMMA INCLUDE GOAL EOF DEF DATA ASSERT ]
+##
+## The known suffix of the stack is as follows:
+## VAL attrs name COLON
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: VAL UPPER_WORD WITH
+##
+## Ends in an error in state: 22.
+##
+## statement -> VAL attrs name . COLON term DOT [ VAL REWRITE LEMMA INCLUDE GOAL EOF DEF DATA ASSERT ]
+##
+## The known suffix of the stack is as follows:
+## VAL attrs name
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: VAL WITH
+##
+## Ends in an error in state: 1.
+##
+## statement -> VAL . attrs name COLON term DOT [ VAL REWRITE LEMMA INCLUDE GOAL EOF DEF DATA ASSERT ]
+##
+## The known suffix of the stack is as follows:
+## VAL
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
+file: WITH
+##
+## Ends in an error in state: 0.
+##
+## file' -> . file [ # ]
+##
+## The known suffix of the stack is as follows:
+##
+##
+
+<YOUR SYNTAX ERROR MESSAGE HERE>
+
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/loop/dune b/Src/COLIBRI/simplex_ocaml/dolmen/src/loop/dune
index 48330810a466f1b6de6da0aa2b374beacd874040..19f869f0e0923bc5a5125767eb9b8101e8ce9674 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/loop/dune
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/loop/dune
@@ -1,10 +1,19 @@
 (library
   (name           dolmen_loop)
   (public_name    dolmen_loop)
-  (libraries      dolmen dolmen_type gen unix)
+  (libraries
+    ; External deps
+    gen unix fmt
+    ; main dolmen deps , with versioned languages deps
+    dolmen
+    dolmen.intf dolmen.std dolmen.class
+    dolmen.smtlib2 dolmen.tptp
+    ; typechecker
+    dolmen_type
+    )
   (modules
     ; Interfaces
-    Expr_intf Typer_intf State_intf
+    Expr_intf Typer_intf Headers_intf State_intf
     ; Implementations
-    Parser Typer State Pipeline Pipes)
+    Logic State Parser Typer Headers Pipeline)
 )
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/loop/flow.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/loop/flow.ml
new file mode 100644
index 0000000000000000000000000000000000000000..93e96e2ef0c43f671b6766471d224e4f04aadb3b
--- /dev/null
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/loop/flow.ml
@@ -0,0 +1,22 @@
+
+(* Types *)
+(* ************************************************************************ *)
+
+type header_mode =
+  | Lang_Version
+  | Problem_Logic
+  | Problem_Source
+  | Problem_License
+  | Problem_Category
+  | Problem_Status
+
+type solve_mode =
+  | Assert
+  | Sat_or_unsat
+
+type mode =
+  | Start of { expect : header_mode; }
+  | Solve of { current : solve_mode; stack_depth : int; }
+  | Exited
+
+
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/loop/headers.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/loop/headers.ml
new file mode 100644
index 0000000000000000000000000000000000000000..8a9c58a56dc47247576c036155629b3e54f2025c
--- /dev/null
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/loop/headers.ml
@@ -0,0 +1,316 @@
+
+(* Header check
+
+   This module defines a some pipes to check the presence of headers in
+   an input file. Headerts are there to provide meta-data about problems,
+   such as version, source, classification, and even satisifability status
+   in some cases.
+   Note that this does *not* include the checking of constraints between
+   successivestatements such as what smtlib specifies, see flow.ml
+
+
+   The way this check is implemented/done:
+   - a number of meta-data fields are defines in module [Field],
+     together with ways to parse/print them.
+   - then each language defines its list of headers that are:
+     + required (causing an error if they are absent)
+     + wanted (causing a warning if they are absent)
+   - additionally, some checks are performed on the values of some
+     headers, particularly lang_version and license, which are
+     provided by the state (and usually controlled by the command
+     line, as there are not reasonable defaults for them).
+   - finally the pipe accumulates header (parsing them using the
+     functions from the [Field] module, and a checking function is
+     provided to check the presence of headers at the end of the
+     file processing.
+
+   Note that the current way means that headers can theoretically be
+   present anywhere in the file, rather than at the beginning.
+*)
+
+(* Header fields *)
+(* ************************************************************************ *)
+
+module Field = struct
+
+  type t =
+    | Lang_version
+    | Problem_version
+    | Problem_source
+    | Problem_license
+    | Problem_category
+    | Problem_status
+
+  let equal = (=)
+  let compare = compare
+  let hash = Hashtbl.hash
+
+
+  (* Correspondance between fields and their names in languages *)
+  let name lang field =
+    match lang, field with
+    | Some Logic.Smtlib2 _, Lang_version -> ":smt-lib-version"
+    | Some Logic.Smtlib2 _, Problem_source -> ":source"
+    | Some Logic.Smtlib2 _, Problem_license -> ":license"
+    | Some Logic.Smtlib2 _, Problem_category -> ":category"
+    | Some Logic.Smtlib2 _, Problem_status -> ":status"
+    | _, Lang_version -> "Language version"
+    | _, Problem_version -> "Problem version"
+    | _, Problem_source -> "Problem source"
+    | _, Problem_license -> "Problem license"
+    | _, Problem_category -> "Problem_category"
+    | _, Problem_status -> "Problem status"
+
+  let print ?lang fmt field =
+    Format.fprintf fmt "%s" (name lang field)
+
+
+  (* Parse an attribute into an (optional) field and value. *)
+
+  module Id = Dolmen.Std.Id
+  module Loc = Dolmen.Std.Loc
+  module Ast = Dolmen.Std.Term
+
+  type res =
+    | Ok of t * string
+    | Error of Loc.t * string
+    | Not_a_header
+
+  module Smtlib2 = struct
+
+    let check_version_number version =
+      if String.length version >= 3 &&
+         String.sub version 0 2 = "2." then begin
+        try
+          let s = String.sub version 2 (String.length version - 2) in
+          let _ = int_of_string s in
+          true
+        with Failure _ ->
+          false
+      end else
+        false
+
+
+    let rec parse = function
+      | { Ast.term = Ast.App ({ Ast.term = Ast.Symbol s; _ }, args); loc; _ } ->
+        parse_aux loc s args
+      | _ ->
+        Not_a_header
+
+    and parse_aux loc s args =
+      match s with
+
+      (* Language version *)
+      | { Id.ns = Id.Attr; Id.name = ":smt-lib-version"; } ->
+        begin match args with
+          | [ { Ast.term = Ast.Symbol {
+              Id.ns = Id.Value Id.Real; Id.name = version }; _ } ] ->
+            if check_version_number version then
+                Ok (Lang_version, version)
+            else
+              Error (loc, ":smt-lib-version number must be in the form 2.X")
+          | [] -> Error (loc, "empty value for :smt-lib-version")
+          | { Ast.loc; _ } :: _ -> Error (loc, "Expected a version number")
+        end
+
+      (* Problem source *)
+      | { Id.ns = Id.Attr; Id.name = ":source"; } ->
+        begin match args with
+          | [ { Ast.term = Ast.Symbol {
+              Id.ns = Id.Attr; Id.name = descr }; _ } ] ->
+            Ok (Problem_source, descr)
+          | [] -> Error (loc, "empty value for :source")
+          | { Ast.loc; _ } :: _ -> Error (loc, "Expected a single symbol as description")
+        end
+
+      (* Problem license *)
+      | { Id.ns = Id.Attr; Id.name = ":license"; } ->
+        begin match args with
+          | [ { Ast.term = Ast.Symbol {
+              Id.ns = Id.Value Id.String; Id.name = license }; _ } ] ->
+            Ok (Problem_license, license)
+          | [] -> Error (loc, "empty value for :license")
+          | { Ast.loc; _ } :: _ -> Error (loc, "Expected a single string in quotes")
+        end
+
+      (* Problem category *)
+      | { Id.ns = Id.Attr; Id.name = ":category"; } ->
+        begin match args with
+          | [ { Ast.term = Ast.Symbol {
+              Id.ns = Id.Value Id.String;
+              Id.name = (("crafted"|"random"|"industrial") as category) }; _ } ] ->
+            Ok (Problem_category, category)
+          | [] -> Error (loc, "empty value for :category")
+          | { Ast.loc; _ } :: _ ->
+            Error (loc, {|Expected "crafted", "random", or "industrial" (in quotes)|})
+        end
+
+
+      (* Problem status *)
+      | { Id.ns = Id.Attr; Id.name = ":status"; } ->
+        begin match args with
+          | [ { Ast.term = Ast.Symbol {
+              Id.name = (("sat"|"unsat"|"unknown") as status) ; _ }; _ } ] ->
+            Ok (Problem_status, status)
+          | _ -> Error (loc, "Expected sat|unsat|unknown")
+        end
+
+      (* catch-all *)
+      | _ ->
+        Not_a_header
+
+  end
+
+  let parse ?lang t =
+    match lang with
+    | Some Logic.Smtlib2 _ -> Smtlib2.parse t
+    | _ -> Not_a_header
+
+
+end
+
+(* Headers *)
+(* ************************************************************************ *)
+
+module M = Map.Make(Field)
+
+type t = {
+  fields : string M.t;
+}
+
+let empty = {
+  fields = M.empty;
+}
+
+let set h f v = {
+  fields = M.add f v h.fields;
+}
+
+let remove h f = {
+  fields = M.remove f h.fields;
+}
+
+let get h f =
+  try Some (M.find f h.fields)
+  with Not_found -> None
+
+let mem h f =
+  M.mem f h.fields
+
+(* Required headers for languages *)
+(* ************************************************************************ *)
+
+let smtlib2_required : Field.t list = [
+  Lang_version;
+  Problem_source;
+  Problem_category;
+  (* Problem_status is checked for every check-sat *)
+]
+
+let smtlib2_wanted : Field.t list = [
+  Problem_license;
+]
+
+
+(* Required headers for languages *)
+(* ************************************************************************ *)
+
+module Pipe(State : State_intf.Header_pipe
+            with type header_state := t)
+= struct
+
+  (* Final check for headers *)
+
+  let check_wanted st h =
+    let lang = State.input_lang st in
+    let wanted =
+      match lang with
+      | Some Logic.Smtlib2 _ -> smtlib2_wanted
+      | _ -> []
+    in
+    match List.filter (fun f -> not (mem h f)) wanted with
+    | [] -> st
+    | missing ->
+      let pp_sep fmt () = Format.fprintf fmt ",@ " in
+      State.warn st "The following header fields are missing and thus \
+                     default values will be assumed: %a"
+        (Format.pp_print_list ~pp_sep (Field.print ?lang)) missing
+
+  let check_required st h =
+    let lang = State.input_lang st in
+    let required =
+      match lang with
+      | Some Logic.Smtlib2 _ -> smtlib2_required
+      | _ -> []
+    in
+    match List.filter (fun f -> not (mem h f)) required with
+    | [] -> st
+    | missing ->
+      let pp_sep fmt () = Format.fprintf fmt ",@ " in
+      State.error st "The following header fields are missing: %a"
+        (Format.pp_print_list ~pp_sep (Field.print ?lang)) missing
+
+  let check st =
+    if not (State.check_headers st) then st
+    else begin
+      let h = State.header_state st in
+      let st = check_wanted st h in
+      let st = check_required st h in
+      st
+    end
+
+
+  (* Incremental checks and construction of the header set *)
+
+  let error st loc fmt =
+    let file = State.input_file_loc st in
+    let loc : Dolmen.Std.Loc.full = { file; loc; } in
+    State.error ~loc st fmt
+
+  let check_header st loc field value =
+    match (field : Field.t) with
+    | Lang_version ->
+      begin match State.allowed_lang_version st with
+        | None -> st
+        | Some v ->
+          if v = value then st
+          else error st loc "This language version must be: %s" v
+      end
+    | Problem_license ->
+      begin match State.allowed_licenses st with
+        | [] -> st
+        | allowed ->
+          if List.mem value allowed then st
+          else error st loc "This is not an allowed license"
+      end
+    | _ -> st
+
+  let inspect st c =
+    if not (State.check_headers st) then (st, c)
+    else begin
+      let lang = State.input_lang st in
+      let h = State.header_state st in
+      let st =
+        match (c : Dolmen.Std.Statement.t) with
+        | { descr = Set_info t; loc; _ } ->
+          begin match Field.parse ?lang t with
+            | Not_a_header -> st
+            | Error (loc, msg) -> error st loc "%s" msg
+            | Ok (field, value) ->
+              let st = check_header st loc field value in
+              let st = State.set_header_state st (set h field value) in
+              st
+          end
+        | { descr = Prove _; loc; _ } ->
+          if mem h Problem_status then
+            State.set_header_state st (remove h Problem_status)
+          else
+            error st loc "This statement lacks a %s header"
+              (Field.name lang Problem_status)
+        | _ -> st
+      in
+      st, c
+    end
+
+end
+
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/loop/headers.mli b/Src/COLIBRI/simplex_ocaml/dolmen/src/loop/headers.mli
new file mode 100644
index 0000000000000000000000000000000000000000..6e88bbb6572402af9d77d1e218c837949eed07bb
--- /dev/null
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/loop/headers.mli
@@ -0,0 +1,56 @@
+
+(* This file is free software, part of Dolmen. See file "LICENSE" for more details. *)
+
+(** {2 Header fields} *)
+
+module Field : sig
+
+  type t =
+    | Lang_version
+    | Problem_version
+    | Problem_source
+    | Problem_license
+    | Problem_category
+    | Problem_status (**)
+  (** Header fields. *)
+
+  val hash : t -> int
+  val equal : t -> t -> bool
+  val compare : t -> t -> int
+  (** Usual functions *)
+
+  val name : Logic.language option -> t -> string
+  (** Name of a header field, parameterized by language *)
+
+  val print : ?lang:Logic.language -> Format.formatter -> t -> unit
+  (** Print a header field (with the same string as {!name}). *)
+
+end
+
+(** {2 Header set} *)
+
+type t
+(** Header set, i.e. a map of fields to values for the header. *)
+
+val empty : t
+(** The empty header set *)
+
+val set : t -> Field.t -> string -> t
+(** Add/set a header to the corresponding value. *)
+
+val get : t -> Field.t -> string option
+(** Get a header value, if present in the set. *)
+
+val mem : t -> Field.t -> bool
+(** Test the presence of a header field. *)
+
+val remove : t -> Field.t -> t
+(** Remove a field from a set. *)
+
+(** {2 Pipe functor} *)
+
+module Pipe(State : State_intf.Header_pipe
+            with type header_state := t) :
+  Headers_intf.S with type state := State.t
+
+
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/loop/headers_intf.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/loop/headers_intf.ml
new file mode 100644
index 0000000000000000000000000000000000000000..be4453811cc82e4bb1f688a20e3a4c53176e103f
--- /dev/null
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/loop/headers_intf.ml
@@ -0,0 +1,15 @@
+
+module type S = sig
+
+  type state
+  (** global state threaded through all the pipeline *)
+
+  val check : state -> state
+  (** Check a state for the required headers (once a whole pipeline
+      has been completed *)
+
+  val inspect :
+    state -> Dolmen.Std.Statement.t -> state * Dolmen.Std.Statement.t
+  (** Check the headers *)
+
+end
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/loop/logic.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/loop/logic.ml
new file mode 100644
index 0000000000000000000000000000000000000000..9b5ef8526160d5d3cde2d86cac90c60a8d4b35b0
--- /dev/null
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/loop/logic.ml
@@ -0,0 +1,13 @@
+
+(* This file is free software, part of Dolmen. See file "LICENSE" for more details. *)
+
+(* The Main Dolmen library is used to parse input languages *)
+(* ************************************************************************ *)
+
+module P = Dolmen.Class.Logic.Make
+    (Dolmen.Std.Loc)
+    (Dolmen.Std.Id)
+    (Dolmen.Std.Term)
+    (Dolmen.Std.Statement)
+
+include (P : Dolmen.Class.Logic.S with type statement := Dolmen.Std.Statement.t)
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/loop/logic.mli b/Src/COLIBRI/simplex_ocaml/dolmen/src/loop/logic.mli
new file mode 100644
index 0000000000000000000000000000000000000000..4b3c3c056f1c77ebdd50a0beef8542011d9776ac
--- /dev/null
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/loop/logic.mli
@@ -0,0 +1,7 @@
+
+(* This file is free software, part of Dolmen. See file "LICENSE" for more details. *)
+
+(** This is an instanciation of the Logic class with the standard
+    implementation of parsed terms and statements of Dolmen. *)
+include Dolmen.Class.Logic.S with type statement := Dolmen.Std.Statement.t
+
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/loop/parser.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/loop/parser.ml
index f923962992f0f7ff1f3c699f81ec4b1ad5f0ee0d..91afc5d0638a8ef47d54a7c21c22803fe93cdc4f 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/loop/parser.ml
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/loop/parser.ml
@@ -1,13 +1,168 @@
+
 (* This file is free software, part of Dolmen. See file "LICENSE" for more details. *)
 
-(* The Main Dolmen library is used to parse input languages *)
+(* Pipe functor *)
 (* ************************************************************************ *)
 
-module P = Dolmen.Logic.Make
-    (Dolmen.ParseLocation)
-    (Dolmen.Id)
-    (Dolmen.Term)
-    (Dolmen.Statement)
+module Pipe
+    (Expr : Expr_intf.S)
+    (State : State_intf.Parser_pipe
+     with type term := Expr.term)
+= struct
+
+  (* Module alias & Helper functions *)
+  (* ************************************************************************ *)
+
+  module S = Dolmen.Std.Statement
+
+  (* Parsing *)
+  (* ************************************************************************ *)
+
+  let gen_finally (gen : 'a Gen.t) cl : 'a Gen.t =
+    (* Register a finaliser for the original generator in case an exception is
+       raised at some point in one of the pipes, which would prevent gen from
+       reaching its end and thus prevent closing of the underlying file. *)
+    let () = Gc.finalise_last cl gen in
+    (* Return a new generator which wraps gen and calls the closing function
+       once gen is finished. *)
+    let aux () =
+      match gen () with
+      | Some _ as res -> res
+      | None -> cl (); None
+    in
+    aux
+
+  let wrap_parser g = fun st ->
+    if State.is_interactive st then
+      Format.printf "%s @?" (State.prelude st);
+    State.start `Parsing;
+    let ret = g () in
+    State.stop `Parsing;
+    ret
+
+  let parse prelude st =
+    State.start `Parsing;
+    (* Parse the input *)
+    let st', g =
+      match State.input_source st with
+      | `Stdin ->
+        let lang, gen, _ = Logic.parse_input
+            ?language:(State.input_lang st)
+            (`Stdin (Logic.Smtlib2 `Latest))
+        in
+        State.set_lang st lang, gen
+      | `Raw (filename, contents) ->
+        let lang =
+          match State.input_lang st with
+          | Some l -> l
+          | None ->
+            let res, _, _ = Logic.of_filename filename in
+            res
+        in
+        let lang, gen, cl = Logic.parse_input
+            ~language:lang (`Raw (filename, lang, contents)) in
+        State.set_lang st lang, gen_finally gen cl
+      | `File f ->
+        let s = Dolmen.Std.Statement.include_ f [] in
+        (* Auto-detect input format *)
+        let lang =
+          match State.input_lang st with
+          | Some l -> l
+          | None ->
+            let res, _, _ = Logic.of_filename f in
+            res
+        in
+        (* Formats Dimacs and Tptp are descriptive and lack the emission
+            of formal solve/prove instructions, so we need to add them. *)
+        let s' =
+          match lang with
+          | Logic.Zf
+          | Logic.ICNF
+          | Logic.Smtlib2 _
+          | Logic.Alt_ergo -> s
+          | Logic.Dimacs
+          | Logic.Tptp _ ->
+            Dolmen.Std.Statement.pack [s; Dolmen.Std.Statement.prove ()]
+        in
+        State.set_lang st lang,
+        (Gen.singleton s')
+    in
+    State.stop `Parsing;
+    (* Wrap the resulting parser *)
+    st', wrap_parser (Gen.append (Gen.of_list prelude) g)
+
+  (* Expand dolmen statements *)
+  (* ************************************************************************ *)
+
+  let merge _ st = st
+
+  let gen_of_llist l =
+    let l = ref l in
+    (fun () -> match Lazy.force !l with
+       | [] -> None
+       | x :: r ->
+         l := (lazy r); Some x
+    )
+
+  let expand st c =
+    State.start `Include;
+    let ret = match c with
+      | { S.descr = S.Pack l; _ } ->
+        st, `Gen (merge, Gen.of_list l)
+      (* TODO: filter the statements by passing some stions *)
+      | { S.descr = S.Include file; _ } ->
+        let loc = c.loc in
+        let language = State.input_lang st in
+        let dir = State.input_dir st in
+        begin
+          match Logic.find ?language ~dir file with
+          | None ->
+            let loc = { Dolmen.Std.Loc.file = State.input_file_loc st; loc; } in
+            State.file_not_found ~loc ~dir ~file
+          | Some file ->
+            let file_loc = Dolmen.Std.Loc.mk_file file in
+            let st = State.set_input_file_loc st file_loc in
+            begin match State.input_mode st with
+              | None
+              | Some `Incremental ->
+                let lang, gen, cl = Logic.parse_input ?language (`File file) in
+                let st = State.set_lang st lang in
+                st, `Gen (merge, gen_finally gen cl)
+              | Some `Full ->
+                let lang, l = Logic.parse_file_lazy ?language file in
+                let st = State.set_lang st lang in
+                st, `Gen (merge, gen_of_llist l)
+            end
+        end
+      | _ -> (st, `Ok)
+    in
+    State.stop `Include;
+    ret
+
+(*
+  (* Header & Automaton flow checking *)
+  (* ************************************************************************ *)
+
+
+  let first_mode ~check_headers lang =
+    match (lang: Parser.language) with
+    | Smtlib2 _ when check_headers -> Start { expect = Lang_Version; }
+    | _ -> Assert
+
+  let next_header lang current_header =
+    match (lang: Parser.language) with
+    | Smtlib2 _ ->
+      begin match (current_header : header) with
+        | Lang_Version -> Some Problem_Logic
+        | Problem_Logic -> Some Problem_Source
+        | Problem_Source -> Some Problem_License
+        | Problem_License -> Some Problem_Category
+        | Problem_Category -> Some Problem_Status
+        | Problem_Status -> None
+      end
+    | _ -> None
+*)
+
 
-include (P : Dolmen.Logic.S with type statement := Dolmen.Statement.t)
+end
 
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/loop/parser.mli b/Src/COLIBRI/simplex_ocaml/dolmen/src/loop/parser.mli
index 682375f1f249a215f5000ee9750626b2e401898b..d6d4649afdffdc48b7a44274e196ea47d4a967d4 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/loop/parser.mli
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/loop/parser.mli
@@ -1,6 +1,29 @@
+
 (* This file is free software, part of Dolmen. See file "LICENSE" for more details. *)
 
-(** This is an instanciation of the Logic class with the standard
-    implementation of parsed terms and statements of Dolmen. *)
-include Dolmen.Logic.S with type statement := Dolmen.Statement.t
+(** This module provides convenient pipes for parsing and dealing with includes. *)
+module Pipe
+    (Expr : Expr_intf.S)
+    (State : State_intf.Parser_pipe
+     with type term := Expr.term)
+  : sig
+
+  (** {2 Pipes} *)
+
+  val parse :
+    Dolmen.Std.Statement.t list -> State.t ->
+    State.t * (State.t -> Dolmen.Std.Statement.t option)
+  (** Parsing function. Reads a list of prelude statements, and the state and
+      returns a tuple of the new state (including the detected input language),
+      together with a statement generator. *)
+
+  val expand : State.t -> Dolmen.Std.Statement.t ->
+    State.t * [ `Ok | `Gen of (State.t -> State.t -> State.t) * Dolmen.Std.Statement.t Gen.t ]
+  (** Expand statements (such as includes). Returns the new state, and either:
+      - [ `Ok ], which means the statement can be propagated as is
+      - [ `Gen (flat, g) ], if the statement expands into a generator [g]. The bool [flat]
+        indicates wether the statements in [g] should be treated as a single group of
+        statements (with regards to timeouts, etc...), or as a list of independant statements
+        (each with its own timeout...). *)
 
+end
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/loop/pipeline.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/loop/pipeline.ml
index 986fd349e4d1e91221bf570a16fbb367cb2ba6b8..955dbcdbc1118165ac21b072d7d3bca3d4ca173e 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/loop/pipeline.ml
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/loop/pipeline.ml
@@ -53,43 +53,55 @@ module Make(State : State_intf.Pipeline) = struct
   (* ************************************************************************ *)
 
   type 'a gen = 'a Gen.t
-  type 'a fix = [ `Ok | `Gen of bool * 'a gen ]
-  type ('a, 'b) cont = [ `Continue of 'a | `Done of 'b ]
+  type 'st merge = 'st -> 'st -> 'st
+  type ('a, 'b) cont = [ `Done of 'a | `Continue of 'b ]
+  type ('st, 'a) fix = [ `Ok | `Gen of 'st merge * 'a gen ]
+  type 'st k_exn = { k : 'a. 'st -> Printexc.raw_backtrace -> exn -> 'a; }
 
-  type ('a, 'b) op = {
+  type ('st, 'a, 'b) op = {
     name : string;
-    f : 'a -> 'b;
+    f : 'st -> 'a -> 'st * 'b;
   }
 
   (* Type for pipelines, i.e a series of transformations to
-      apply to the input. An ('a, 'b) t is a pipeline that
+      apply to the input. An ('st, 'a, 'b) t is a pipeline that
       takes an input of type ['a] and returns a value of type
       ['b]. *)
-  type (_, _) t =
+  type (_, _, _) t =
     (* The end of the pipeline, the identity/reflexive constructor *)
     | End :
-        ('a, 'a) t
+        ('st, 'a, 'a) t
     (* Apply a single function and then proceed with the rest of the pipeline *)
     | Map :
-        ('a, 'c) op * ('c, 'b) t -> ('a, 'b) t
+        ('st, 'a, 'c) op * ('st, 'c, 'b) t -> ('st, 'a, 'b) t
+    (* Allow early exiting from the loop *)
     | Cont :
-        ('a, ('c, 'b) cont) op * ('c, 'b) t -> ('a, 'b) t
+        ('st, 'a, ('b, 'c) cont) op * ('st, 'c, 'b) t -> ('st, 'a, 'b) t
     (* Concat two pipeline. Not tail recursive. *)
     | Concat :
-        ('a, 'b) t * ('b, 'c) t -> ('a, 'c) t
+        ('st, 'a, 'b) t * ('st, 'b, 'c) t -> ('st, 'a, 'c) t
     (* Fixpoint expansion *)
     | Fix :
-        ('st * 'a, 'st * 'a fix) op * ('st * 'a, 'st) t -> ('st * 'a, 'st) t
+        ('st, 'a, ('st, 'a) fix) op * ('st, 'a, unit) t -> ('st, 'a, unit) t
 
-  (* Creating pipelines. *)
+  (* Creating operators. *)
+
+  let op ?(name="") f = { name; f; }
+
+  let apply ?name f = op ?name (fun st x -> st, f x)
+
+  let iter_ ?name f = op ?name (fun st x -> f x; st, x)
+
+  let f_map ?name ?(test=(fun _ _ -> true)) f =
+    op ?name (fun st x ->
+        if test st x then begin
+          let st', y = f st x in
+          st', `Continue y
+        end else
+          st, `Done x
+      )
 
-  let apply ?(name="") f =
-    { name; f; }
-  let iter_ ?(name="") f =
-    { name; f = (fun x -> f x; x); }
-  let f_map ?(name="") ?(test=(fun _ -> true)) f =
-    { name; f = (fun ((st, _) as x) ->
-          if test st then `Continue (f x) else `Done st); }
+  (* Creating pipelines. *)
 
   let _end = End
   let (@>>>) op t = Map(op, t)
@@ -98,40 +110,61 @@ module Make(State : State_intf.Pipeline) = struct
 
   let fix op t = Fix(op, t)
 
+  (* Eval an operator *)
+  let eval_op ~exn op st x =
+    try op.f st x
+    with e ->
+      let bt = Printexc.get_raw_backtrace () in
+      exn.k st bt e
+
   (* Eval a pipeline into the corresponding function *)
-  let rec eval : type a b. (a, b) t -> a -> b =
-    fun pipe x ->
+  let rec eval : type st a b.
+    exn:st k_exn -> (st, a, b) t -> st -> a -> st * b =
+    fun ~exn pipe st x ->
     match pipe with
-    | End -> x
+    | End -> st, x
     | Map (op, t) ->
-      eval t (op.f x)
+      let st', y = eval_op ~exn op st x in
+      eval ~exn t st' y
     | Cont (op, t) ->
-      begin match op.f x with
-        | `Continue res -> eval t res
-        | `Done res -> res
+      let st', y = eval_op ~exn op st x in
+      begin match y with
+        | `Continue res -> eval ~exn t st' res
+        | `Done res -> st', res
       end
     | Concat (t, t') ->
-      let y = eval t x in
-      eval t' y
+      let st', y = eval ~exn t st x in
+      eval ~exn t' st' y
     | Fix (op, t) ->
-      let st, y = x in
-      begin match op.f x with
-        | st', `Ok -> eval t (st', y)
-        | st', `Gen (flat, g) ->
-          let aux st c = eval pipe (st, c) in
-          let st'' = Gen.fold aux st' g in
-          if flat then st'' else st
+      let st', y = eval_op ~exn op st x in
+      begin match y with
+        | `Ok -> eval ~exn t st' x
+        | `Gen (merge, g) ->
+          let st'' = eval_gen_fold ~exn pipe st' g in
+          let st''' = merge st st'' in
+          st''', ()
       end
 
+  and eval_gen_fold : type st a.
+    exn: st k_exn -> (st, a, unit) t -> st -> a gen -> st =
+    fun ~exn pipe st g ->
+    match g () with
+    | None -> st
+    | Some x ->
+      let st', () = eval ~exn pipe st x in
+      eval_gen_fold ~exn pipe st' g
+    | exception e ->
+      let bt = Printexc.get_raw_backtrace () in
+      exn.k st bt e
+
   (* Aux function to eval a pipeline on the current value of a generator. *)
-  let run_aux : type a.
-    (State.t * a, State.t) t ->
-    (State.t -> a option) ->
-    State.t -> State.t option =
-    fun pipe g st ->
+  let run_aux ~exn pipe g st =
     match g st with
     | None -> None
-    | Some x -> Some (eval pipe (st, x))
+    | Some x -> Some (eval ~exn pipe st x)
+    | exception e ->
+      let bt = Printexc.get_raw_backtrace () in
+      exn.k st bt e
 
   (* Effectively run a pipeline on all values that come from a generator.
      Time/size limits apply for the complete evaluation of each input
@@ -139,31 +172,66 @@ module Make(State : State_intf.Pipeline) = struct
   let rec run :
     type a.
     finally:(State.t -> exn option -> State.t) ->
-    (State.t -> a option) -> State.t -> (State.t * a, State.t) t -> State.t
+    (State.t -> a option) -> State.t -> (State.t, a, unit) t -> State.t
     = fun ~finally g st pipe ->
+      let exception Exn of State.t * Printexc.raw_backtrace * exn in
       let time = State.time_limit st in
       let size = State.size_limit st in
       let al = setup_alarm time size in
+      let exn = { k = fun st bt e ->
+          (* delete alamr as soon as possible *)
+          let () = delete_alarm al in
+          (* go the the correct handler *)
+          raise (Exn (st, bt, e));
+        }
+      in
       begin
-        match run_aux pipe g st with
+        match run_aux ~exn pipe g st with
+
+        (* End of the run, yay ! *)
         | None ->
           let () = delete_alarm al in
           st
-        | Some st' ->
+
+        (* Regular case, we finished running the pipeline on one input
+           value, let's get to the next one. *)
+        | Some (st', ()) ->
           let () = delete_alarm al in
           let st'' = try finally st' None with _ -> st' in
           run ~finally g st'' pipe
-        | exception exn ->
+
+        (* "Normal" exception case: the exn was raised by an operator, and caught
+           then re-raised by the {exn} cotinuation passed to run_aux *)
+        | exception Exn (st, bt, e) ->
+          (* Flush stdout and print a newline in case the exn was
+             raised in the middle of printing *)
+          Format.pp_print_flush Format.std_formatter ();
+          Format.pp_print_flush Format.err_formatter ();
+          (* Print the backtrace if requested *)
+          if Printexc.backtrace_status () then
+            Printexc.print_raw_backtrace stdout bt;
+          (* Go on running the rest of the pipeline. *)
+          let st' = finally st (Some e) in
+          run ~finally g st' pipe
+
+        (* Exception case for exceptions, that can realisically occur for all
+           asynchronous exceptions, or if some operator was not properly wrapped.
+           In this error case, we might use a rather old and outdate state, but
+           this should not happen often, and should not matter for asynchronous
+           exceptions. *)
+        | exception e ->
+          let bt = Printexc.get_raw_backtrace () in
           (* delete alarm *)
           let () = delete_alarm al in
           (* Flush stdout and print a newline in case the exn was
              raised in the middle of printing *)
           Format.pp_print_flush Format.std_formatter ();
+          Format.pp_print_flush Format.err_formatter ();
           (* Print the backtrace if requested *)
           if Printexc.backtrace_status () then
-            Printexc.print_backtrace stdout;
+            Printexc.print_raw_backtrace stdout bt;
           (* Go on running the rest of the pipeline. *)
-          let st' = finally st (Some exn) in
+          let st' = finally st (Some e) in
           run ~finally g st' pipe
       end
 
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/loop/pipeline.mli b/Src/COLIBRI/simplex_ocaml/dolmen/src/loop/pipeline.mli
index faddb690fa257af284691be63df2d12d42d1ee60..f08d26dec33fccb002af4ee047f65865dd4626dc 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/loop/pipeline.mli
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/loop/pipeline.mli
@@ -19,64 +19,76 @@ module Make(State : State_intf.Pipeline) : sig
 
   (** {2 Type definitions } *)
 
-  type ('a, 'b) op
-  (** An operator from values of type ['a] to value sof type ['b]. *)
+  type ('st, 'a, 'b) op
+  (** An operator from values of type ['a] to value sof type ['b],
+      and where a state value of type ['st] is carried throughout. *)
 
-  type ('a, 'b) t
-  (** The type of pipelines from values of type ['a] to values of type ['b]. *)
+  type ('st, 'a, 'b) t
+  (** The type of pipelines from values of type ['a] to values of type ['b],
+      with state values of type ['st]. *)
 
-  type 'a fix = [ `Ok | `Gen of bool * 'a Gen.t ]
+  type 'st merge = 'st -> 'st -> 'st
+  (** Merge function used at the end of a fixpoint to get the resulting state. *)
+
+  type ('st, 'a) fix = [ `Ok | `Gen of 'st merge * 'a Gen.t ]
   (** Type used to fixpoint expanding statements such as includes. *)
 
-  type ('a, 'b) cont = [ `Continue of 'a | `Done of 'b ]
+  type ('a, 'b) cont = [ `Done of 'a | `Continue of 'b ]
   (** Type used for continuation operators, allowing to leave the pipeline early. *)
 
+  type 'st k_exn = { k : 'a. 'st -> Printexc.raw_backtrace -> exn -> 'a; }
+  (** Exception continuation to provide when evaluating a pipeline manually,
+      in order to evaluate an exception handler with the most up-to-date state. *)
+
 
   (** {2 Creating operators} *)
 
-  val apply : ?name:string -> ('a -> 'b) -> ('a, 'b) op
+  val op : ?name:string -> ('st -> 'a -> 'st * 'b) -> ('st, 'a, 'b) op
+  (** Base constructor function for operators. *)
+
+  val apply : ?name:string -> ('a -> 'b) -> (_, 'a, 'b) op
   (** Create an operator from a function *)
 
+  val iter_ : ?name:string -> ('a -> unit) -> (_, 'a, 'a) op
+  (** Perform the function's side-effect and return the same input. *)
+
   val f_map :
     ?name:string ->
-    ?test:('a -> bool) ->
-    ('a * 'b -> 'a * 'c) ->
-    ('a * 'b, ('a * 'c, 'a) cont) op
+    ?test:('st -> 'a -> bool) ->
+    ('st -> 'a -> 'st * 'b) ->
+    ('st, 'a, ('a, 'b) cont) op
   (** TODO: doc *)
 
-  val iter_ : ?name:string -> ('a -> unit) -> ('a, 'a) op
-  (** Perform the function's side-effect and return the same input. *)
 
 
   (** {2 Creating pipelines} *)
 
-  val _end : ('a, 'a) t
+  val _end : (_, 'a, 'a) t
 
-  val (@>>>) : ('a, 'b) op -> ('b, 'c) t -> ('a, 'c) t
+  val (@>>>) : ('st, 'a, 'b) op -> ('st, 'b, 'c) t -> ('st, 'a, 'c) t
   (** Add an operator at the beginning of a pipeline. *)
 
-  val (@>|>) : ('a, ('b, 'c) cont) op -> ('b, 'c) t -> ('a, 'c) t
+  val (@>|>) : ('st, 'a, ('b, 'c) cont) op -> ('st, 'c, 'b) t -> ('st, 'a, 'b) t
   (** Add a continuation operator, allowing to stop evaluation of the
       pipeline early. *)
 
-  val (@|||) : ('a, 'b) t -> ('b, 'c) t -> ('a, 'c) t
+  val (@|||) : ('st, 'a, 'b) t -> ('st, 'b, 'c) t -> ('st, 'a, 'c) t
   (** Concatenate two pipeline. Whenever possible it is best to use [(@>>>)],
       which creates tail-rec pipelines. *)
 
-  val fix : ('a * 'b, 'a * 'b fix) op -> ('a * 'b, 'a) t -> ('a * 'b, 'a) t
+  val fix : ('st, 'a, ('st, 'a) fix) op -> ('st, 'a, unit) t -> ('st, 'a, unit) t
   (** Perform a fixpoint expansion *)
 
 
   (** {2 Evaluating pipelines} *)
 
-  val eval : ('a, 'b) t -> 'a -> 'b
+  val eval : exn:'st k_exn -> ('st, 'a, 'b) t -> 'st -> 'a -> 'st * 'b
   (** Evaluate a pipeline to a function. *)
 
   val run :
     finally:(State.t -> exn option -> State.t) ->
     (State.t -> 'a option) -> State.t ->
-    (State.t * 'a, State.t) t ->
-    State.t
+    (State.t, 'a, unit) t -> State.t
     (** Loop the evaluation of a pipeline over a generator, and starting options.
         @param finally a function called at the end of every iteration (even if
         an exception has been raised) *)
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/loop/state.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/loop/state.ml
index c7779ce96f72ff7c3bf066e0f6e138dd6250b162..e1a85b4d1b2e0db518c21229dc5f094135e38997 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/loop/state.ml
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/loop/state.ml
@@ -1,84 +1,188 @@
 
 (* This file is free software, part of dolmen. See file "LICENSE" for more information *)
 
-(* Exceptions *)
+(* Type definition & Exceptions *)
 (* ************************************************************************* *)
 
-exception Missing_smtlib_logic
+type perm =
+  | Allow
+  | Warn
+  | Error
 
-exception Input_lang_changed of Parser.language * Parser.language
+exception File_not_found of Dolmen.Std.Loc.full * string * string
 
-exception File_not_found of Dolmen.ParseLocation.t option * string * string
+exception Input_lang_changed of Logic.language * Logic.language
 
-(* State for the typer *)
+(* Type definition *)
 (* ************************************************************************* *)
 
-module For_typer = struct
+type lang = Logic.language
+type ty_state = Typer.ty_state
+type solve_state = unit
 
-  type solve_st = unit
+type 'solve state = {
 
-  let missing_smtlib_logic () = raise Missing_smtlib_logic
+  (* Debug option *)
+  debug             : bool;
 
-end
+  (* Warning/Error options *)
+  context           : bool;
+  max_warn          : int;
+  cur_warn          : int;
+
+  (* Limits for time and size *)
+  time_limit        : float;
+  size_limit        : float;
+
+  (* Input settings *)
+  input_dir         : string;
+  input_lang        : lang option;
+  input_mode        : [ `Full
+                      | `Incremental ] option;
+  input_source      : [ `Stdin
+                      | `File of string
+                      | `Raw of string * string ];
+
+  input_file_loc    : Dolmen.Std.Loc.file;
+
+  (* Header check *)
+  header_check      : bool;
+  header_state      : Headers.t;
+  header_licenses   : string list;
+  header_lang_version : string option;
+
+  (* Typechecking state *)
+  type_state        : ty_state;
+  type_check        : bool;
+  type_strict       : bool;
+
+  (* Solving state *)
+  solve_state       : 'solve;
+
+  (* Output settings *)
+  export_lang       : (lang * Format.formatter) list;
+
+}
+
+type t = solve_state state
+
+(* Debug/print the state *)
+(* ************************************************************************* *)
+
+let debug fmt st =
+  Format.fprintf fmt
+    "@[<hv 2>{@ file: %s; }@]" (Dolmen.Std.Loc.file_name st.input_file_loc)
+
+
+(* State and locations *)
+(* ************************************************************************* *)
+
+let pp_loc fmt o =
+  match o with
+  | None -> ()
+  | Some loc ->
+    if Dolmen.Std.Loc.is_dummy loc then ()
+    else Format.fprintf fmt "%a:@ " Dolmen.Std.Loc.fmt loc
+
+let error ?loc _ format =
+  let loc = Dolmen.Std.Misc.opt_map loc Dolmen.Std.Loc.full_loc in
+  Format.kfprintf (fun _ -> exit 1) Format.err_formatter
+    ("@[<v>%a%a @[<hov>" ^^ format ^^ "@]@]@.")
+    Fmt.(styled `Bold @@ styled (`Fg (`Hi `White)) pp_loc) loc
+    Fmt.(styled `Bold @@ styled (`Fg (`Hi `Red)) string) "Error"
+
+let warn ?loc st format =
+  let loc = Dolmen.Std.Misc.opt_map loc Dolmen.Std.Loc.full_loc in
+  let aux _ = { st with cur_warn = st.cur_warn + 1; } in
+  if st.cur_warn >= st.max_warn then
+    Format.ikfprintf aux Format.err_formatter format
+  else
+    Format.kfprintf aux Format.err_formatter
+      ("@[<v>%a%a @[<hov>" ^^ format ^^ "@]@]@.")
+      Fmt.(styled `Bold @@ styled (`Fg (`Hi `White)) pp_loc) loc
+      Fmt.(styled `Bold @@ styled (`Fg (`Hi `Magenta)) string) "Warning"
+
+let flush st () =
+  let aux _ = { st with cur_warn = 0; } in
+  if st.cur_warn <= st.max_warn then
+    aux ()
+  else
+    Format.kfprintf aux Format.err_formatter
+      ("@[<v>%a @[<hov>%s@ %d@ %swarnings@]@]@.")
+      Fmt.(styled `Bold @@ styled (`Fg (`Hi `Magenta)) string) "Warning"
+      (if st.max_warn = 0 then "Counted" else "Plus")
+      (st.cur_warn - st.max_warn)
+      (if st.max_warn = 0 then "" else "additional ")
+
+(* Getting/Setting options *)
+(* ************************************************************************* *)
+
+let time_limit t = t.time_limit
+let size_limit t = t.size_limit
+
+let input_dir t = t.input_dir
+let input_mode t = t.input_mode
+let input_lang t = t.input_lang
+let input_source t = t.input_source
+
+let input_file_loc st = st.input_file_loc
+let set_input_file_loc st f = { st with input_file_loc = f; }
+
+let set_mode t m = { t with input_mode = Some m; }
+
+let header_state { header_state; _ } = header_state
+let set_header_state st header_state = { st with header_state; }
+
+let check_headers { header_check; _ } = header_check
+let allowed_licenses { header_licenses; _ } = header_licenses
+let allowed_lang_version { header_lang_version; _ } = header_lang_version
+
+let ty_state { type_state; _ } = type_state
+let set_ty_state st type_state = { st with type_state; }
+
+let typecheck st = st.type_check
+let strict_typing { type_strict; _ } = type_strict
+
+let is_interactive = function
+  | { input_source = `Stdin; _ } -> true
+  | _ -> false
+
+let prelude _ = "prompt>"
+
+(* Setting language *)
+(* ************************************************************************* *)
+
+let switch_to_full_mode lang t =
+  let old_mode = input_mode t in
+  let t = set_mode t `Full in
+  match old_mode with
+  | Some `Incremental ->
+    warn t
+      "The@ %s@ format@ does@ not@ support@ \
+       incremental@ mode,@ switching@ to@ full@ mode"
+      lang
+  | _ -> t
+
+let set_lang_aux t l =
+  let t = { t with input_lang = Some l; } in
+  match l with
+  | Logic.Alt_ergo -> switch_to_full_mode "Alt-Ergo" t
+  | _ -> t
+
+let set_lang t l =
+  match t.input_lang with
+  | None -> set_lang_aux t l
+  | Some l' ->
+    if l = l'
+    then set_lang_aux t l
+    else raise (Input_lang_changed (l', l))
 
 (* Full state *)
 (* ************************************************************************* *)
 
-module Make(T : Typer_intf.T) = struct
-  open Dolmen.State
-
-  let pp_loc fmt o =
-    match o with
-    | None -> ()
-    | Some loc ->
-      Format.fprintf fmt "%a:@ " Dolmen.ParseLocation.fmt loc
-
-  let error ?loc _ format =
-    Format.kfprintf (fun _ -> exit 1) Format.err_formatter
-      ("(error %a @[<hov>%a" ^^ format ^^ "@])@.")
-      Fmt.(styled (`Fg (`Hi `Red)) string) "Error" pp_loc loc
-
-  let warn_aux st loc msg =
-    Format.eprintf "(error @[<hov>%a%a %s@])@."
-      pp_loc loc
-      Fmt.(styled (`Fg (`Hi `Magenta)) string) "Warning"
-      msg;
-    st
-
-  let warn st loc msg = warn_aux st (Some loc) msg
-
-  type solve_st = unit
-  type type_st = T.ty_state
-  type t = (Parser.language, type_st, solve_st) Dolmen.State.state
-
-  let start _ = ()
-  let stop _ = ()
-
-  let file_not_found ?loc ~dir ~file =
-    raise (File_not_found (loc, dir, file))
-
-  let set_lang_aux t l =
-    let t = Dolmen.State.set_lang t l in
-    match l with
-    | Parser.Alt_ergo ->
-      let old_mode = Dolmen.State.input_mode t in
-      let t = Dolmen.State.set_mode t `Full in
-      begin match old_mode with
-        | Some `Incremental ->
-          warn_aux t None
-            "The Alt-ergo format does not support incremental mode, switching to full mode"
-        | _ -> t
-      end
-    | _ -> t
-
-  let set_lang t l =
-    match t.input_lang with
-    | None -> set_lang_aux t l
-    | Some l' ->
-      if l = l'
-      then set_lang_aux t l
-      else raise (Input_lang_changed (l', l))
-
-  let run_typecheck st = st.type_check
-
-end
+let start _ = ()
+let stop _ = ()
+
+let file_not_found ~loc ~dir ~file =
+  raise (File_not_found (loc, dir, file))
+
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/loop/state_intf.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/loop/state_intf.ml
index 2b492b0db1496cef7221365f9f65dd7162dcd424..df8675549c8871a9955fafe52b91124b0d4ee37a 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/loop/state_intf.ml
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/loop/state_intf.ml
@@ -13,7 +13,7 @@ type source = [
   | `Raw of string * string
 ]
 
-type phase =[
+type phase = [
   | `Parsing
   | `Include
   | `Typing
@@ -27,18 +27,6 @@ type mode = [
 
 (** {1 Signatures} *)
 
-(** This modules defines the smallest signatures for a solver state that allow
-    to instantiate the {Typer.Make} functor. *)
-module type Typer = sig
-
-  type solve_st
-  (** The type used to store results of solving. *)
-
-  val missing_smtlib_logic : unit -> 'a
-  (** Called when an smtlib set-logic command is missing. *)
-
-end
-
 (** This modules defines the smallest signatures for a solver state that allow
     to instantiate the {Pipeline.Make} functor. *)
 module type Pipeline = sig
@@ -55,8 +43,8 @@ module type Pipeline = sig
 end
 
 (** This modules defines the smallest signatures for a solver state that allow
-    to instantiate the {Pipes.Make} functor. *)
-module type S = sig
+    to instantiate the {Parser.Pipe} functor. *)
+module type Parser_pipe = sig
 
   type t
   (** The type of state *)
@@ -64,26 +52,144 @@ module type S = sig
   type term
   (** The type of solver terms. *)
 
-  (* Hooks at the start/end of phases *)
+  val warn :
+    ?loc:Dolmen.Std.Loc.full ->
+    t -> ('a, Format.formatter, unit, t) format4 ->
+    'a
+  (** Emit a warning *)
+
+  val input_file_loc : t -> Dolmen.Std.Loc.file
+  (** Current input file location meta-data. *)
+
+  val set_input_file_loc : t -> Dolmen.Std.Loc.file -> t
+  (** Set the input file location meta-data. *)
+
   val start : phase -> unit
+  (** Hook at the start of a phase *)
+
   val stop : phase -> unit
+  (** Hook at the end of a phase *)
 
-  (* Interactivity-related queries *)
   val prelude : t -> string
+  (** Some prelude to print at the begining of lines when in interactive mode. *)
+
   val is_interactive : t -> bool
+  (** Whether we are running in interactive mode. *)
 
-  (* Input options *)
   val set_mode : t -> mode -> t
-  val set_lang : t -> Parser.language -> t
+  (* Set the input mode. *)
+
+  val set_lang : t -> Logic.language -> t
+  (** Set the input language. *)
 
   val input_mode : t -> mode option
-  val input_lang : t -> Parser.language option
+  (** Return the current mode (if any). *)
+
+  val input_lang : t -> Logic.language option
+  (** Return the input language (if any). *)
+
   val input_dir : t -> string
+  (** Return the directory of the input source (e.g. the directory of the
+      input file, or the current directory if in interactive mode). *)
+
   val input_source : t -> source
+  (** Return the input source. *)
+
   val file_not_found :
-    ?loc:Dolmen.ParseLocation.t -> dir:string -> file:string -> 'a
-  val warn : t -> Dolmen.ParseLocation.t -> string -> t
+    loc:Dolmen.Std.Loc.full -> dir:string -> file:string -> 'a
+  (** Callback for when a file specified by the input source is not found. *)
+
+end
+
+(** This modules defines the smallest signatures for a solver state that allow
+    to instantiate the {Typer.Make} functor. *)
+module type Typer = sig
+
+  type ty_state
+  (** The type of state used by the typer. *)
+
+  type t
+  (** The type for the global state. *)
+
+  val warn :
+    ?loc:Dolmen.Std.Loc.full -> t ->
+    ('a, Format.formatter, unit, t) format4 -> 'a
+  (** Emit a warning *)
+
+  val input_file_loc : t -> Dolmen.Std.Loc.file
+  (** CUrrent input file location meta-data. *)
+
+  val input_lang : t -> Logic.language option
+  (** The current input language. *)
+
+  val typecheck : t -> bool
+  (** Whether to type-check expressions. *)
+
+  val strict_typing : t -> bool
+  (** Whether to be strict about typing warnings/errors *)
+
+  val ty_state : t -> ty_state
+  (** Returns the typing state associated. *)
+
+  val set_ty_state : t -> ty_state -> t
+  (** Set the typing state. *)
+
+end
+
+(** This modules defines the smallest signatures for a solver state that allow
+    to instantiate the {Typer.Pipe} functor. *)
+module type Typer_pipe = sig
+
+  type t
+  (** The type of state *)
+
+  val input_lang : t -> Logic.language option
+  (** Return the input language (if any). *)
+
+end
+
+
+(** This modules defines the smallest signatures for a solver state that allow
+    to instantiate the {Headers.Pipe} functor. *)
+module type Header_pipe = sig
+
+  type t
+  (** The type of state *)
+
+  type header_state
+  (** The type of state used for the header check*)
+
+  val warn :
+    ?loc:Dolmen.Std.Loc.full ->
+    t -> ('a, Format.formatter, unit, t) format4 ->
+    'a
+  (** Emit an error. *)
+
+  val error :
+    ?loc:Dolmen.Std.Loc.full ->
+    t -> ('a, Format.formatter, unit, t) format4 ->
+    'a
+  (** Emit an error. *)
+
+  val input_file_loc : t -> Dolmen.Std.Loc.file
+  (** Current input file location meta-data. *)
+
+  val input_lang : t -> Logic.language option
+  (** Return the input language (if any). *)
+
+  val header_state : t -> header_state
+  (** Get the header-check state. *)
+
+  val set_header_state : t -> header_state -> t
+  (** Set the header-check state. *)
+
+  val check_headers : t -> bool
+  (** Whether to check the headers. *)
+
+  val allowed_licenses : t -> string list
+  (** Licenses allowed. An empty list means all licenses are allowed. *)
 
-  val set_logic : t -> string -> t
+  val allowed_lang_version : t -> string option
+  (** Language version number allowed. [None] means allowing everything. *)
 
 end
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/loop/typer.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/loop/typer.ml
index e1241adfb2628d394a6daf970195e4eb24e789db..5662c39df41ea9f80957eb2accba971f7467e2f3 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/loop/typer.ml
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/loop/typer.ml
@@ -1,166 +1,232 @@
 
 (* This file is free software, part of dolmen. See file "LICENSE" for more information *)
 
-module type S = sig
-
-  type solve_st
-
-  module T : Dolmen_type.Tff.S
-    with type 'a Tag.t = 'a Dolmen.Tag.t
-     and type Ty.t = Dolmen.Expr.ty
-     and type Ty.Var.t = Dolmen.Expr.ty_var
-     and type Ty.Const.t = Dolmen.Expr.ty_const
-     and type T.t = Dolmen.Expr.term
-     and type T.Var.t = Dolmen.Expr.term_var
-     and type T.Const.t = Dolmen.Expr.term_const
-     and type T.Cstr.t = Dolmen.Expr.term_const
-
-  include Typer_intf.S
-    with type state := (Parser.language, T.state, solve_st) Dolmen.State.state
-     and type ty := Dolmen.Expr.ty
-     and type ty_var := Dolmen.Expr.ty_var
-     and type ty_const := Dolmen.Expr.ty_const
-     and type term := Dolmen.Expr.term
-     and type term_var := Dolmen.Expr.term_var
-     and type term_const := Dolmen.Expr.term_const
-     and type formula := Dolmen.Expr.formula
-
-  val report_error : Format.formatter -> T.err -> unit
-
-  val additional_builtins : T.builtin_symbols ref
-
-  type T.err += Generic_type_error of string
-
-end
+(* Dolmen_type functors instantiation *)
+(* ************************************************************************ *)
+
+module T = Dolmen_type.Tff.Make
+    (Dolmen.Std.Tag)(Dolmen.Std.Expr.Ty)(Dolmen.Std.Expr.Term)
+
+(* Definitions builtin *)
+module Decl = Dolmen_type.Def.Declare(T)
+module Subst = Dolmen_type.Def.Subst(T)(struct
+    let of_list l =
+      let aux acc (k, v) = Dolmen.Std.Expr.Subst.Var.bind acc k v in
+      List.fold_left aux Dolmen.Std.Expr.Subst.empty l
+    let ty_subst l ty =
+      Dolmen.Std.Expr.Ty.subst (of_list l) ty
+    let term_subst tys terms t =
+      Dolmen.Std.Expr.Term.subst (of_list tys) (of_list terms) t
+  end)
+
+(* AE builtins *)
+module Ae_Core =
+  Dolmen_type.Core.Ae.Tff(T)
+    (Dolmen.Std.Expr.Ty)(Dolmen.Std.Expr.Term)
+
+(* Tptp builtins *)
+module Tptp_Core =
+  Dolmen_type.Core.Tptp.Tff(T)
+    (Dolmen.Std.Expr.Ty)(Dolmen.Std.Expr.Term)
+module Tptp_Arith =
+  Dolmen_type.Arith.Tptp.Tff(T)
+    (Dolmen.Std.Expr.Ty)(Dolmen.Std.Expr.Term)
+
+(* Stmlib theories *)
+module Smtlib2_Core =
+  Dolmen_type.Core.Smtlib2.Tff(T)(Dolmen.Std.Expr.Tags)
+    (Dolmen.Std.Expr.Ty)(Dolmen.Std.Expr.Term)
+module Smtlib2_Ints =
+  Dolmen_type.Arith.Smtlib2.Int.Tff(T)
+    (Dolmen.Std.Expr.Ty)(Dolmen.Std.Expr.Term.Int)
+module Smtlib2_Reals =
+  Dolmen_type.Arith.Smtlib2.Real.Tff(T)
+    (Dolmen.Std.Expr.Ty)(Dolmen.Std.Expr.Term.Real)
+module Smtlib2_Reals_Ints =
+  Dolmen_type.Arith.Smtlib2.Real_Int.Tff(T)
+    (Dolmen.Std.Expr.Ty)(Dolmen.Std.Expr.Term)
+module Smtlib2_Arrays =
+  Dolmen_type.Arrays.Smtlib2.Tff(T)
+    (Dolmen.Std.Expr.Ty)(Dolmen.Std.Expr.Term)
+module Smtlib2_Bitv =
+  Dolmen_type.Bitv.Smtlib2.Tff(T)
+    (Dolmen.Std.Expr.Ty)(Dolmen.Std.Expr.Term.Bitv)
+module Smtlib2_Float =
+  Dolmen_type.Float.Smtlib2.Tff(T)
+    (Dolmen.Std.Expr.Ty)(Dolmen.Std.Expr.Term)
+module Smtlib2_String =
+  Dolmen_type.Strings.Smtlib2.Tff(T)
+    (Dolmen.Std.Expr.Ty)(Dolmen.Std.Expr.Term)
+
+(* Zf *)
+module Zf_Core =
+  Dolmen_type.Core.Zf.Tff(T)(Dolmen.Std.Expr.Tags)
+
+(* Typing state *)
+(* ************************************************************************ *)
+
+(* This is here to define the typing state (not to confuse with the state
+   passed in the pipes, which will contain the typing state. *)
+
+type ty_state = {
+  (* logic used *)
+  logic : Dolmen_type.Logic.t;
+  (* current typechecker global state *)
+  typer : T.state;
+  (* typechecker state stack *)
+  stack : T.state list;
+}
+
+let new_state () = {
+  logic = Auto;
+  typer = T.new_state ();
+  stack = [];
+}
+
+
+(* Make functor *)
+(* ************************************************************************ *)
+
+module type S = Typer_intf.S
+
+module Make(S : State_intf.Typer with type ty_state := ty_state) = struct
+
+  (* New warnings & errors *)
+  (* ************************************************************************ *)
 
-module Make(S : State_intf.Typer) = struct
+  type _ T.err +=
+    | Warning_as_error : T.warning -> _ T.err
+    | Missing_logic : Dolmen.Std.Loc.t T.err
+    | Illegal_decl : Dolmen.Std.Statement.decl T.err
+    | Invalid_push_n : Dolmen.Std.Loc.t T.err
+    | Invalid_pop_n : Dolmen.Std.Loc.t T.err
+    | Pop_with_empty_stack : Dolmen.Std.Loc.t T.err
 
-  (* Shadowing *)
+  (* Hints for type errors *)
   (* ************************************************************************ *)
 
-  let print_reason fmt r =
-    match (r : Dolmen_type.Tff.reason) with
-    | Inferred loc ->
-      Format.fprintf fmt "inferred at %a" Dolmen.ParseLocation.fmt loc
-    | Declared loc ->
-      Format.fprintf fmt "declared at %a" Dolmen.ParseLocation.fmt loc
-
-  let print_shadowing_reasons fmt (id, old, cur) =
-    Format.fprintf fmt "Shadowing:@ %a was %a@ and is now %a"
-      Dolmen.Id.print id
-      print_reason old
-      print_reason cur
-
-  (* Warnings *)
+  let poly_hint fmt (c, expected, actual) =
+    let n_ty, n_t = Dolmen.Std.Expr.Term.Const.arity c in
+    let total_arity = n_ty + n_t in
+    match expected with
+    | [x] when x = total_arity && actual = n_t ->
+      Format.fprintf fmt
+        "@ @[<hov>Hint: %a@]" Format.pp_print_text
+        "this is a polymorphic function, you probably forgot \
+         the type arguments@]"
+    | [x] when x = n_t && n_ty <> 0 ->
+      Format.fprintf fmt "@ @[<hov>Hint: %a@]" Format.pp_print_text
+        "it looks like the language enforces implicit polymorphism, \
+         i.e. no type arguments are to be provided to applications \
+         (and instead type annotation/coercions should be used)."
+    | _ :: _ ->
+      Format.fprintf fmt "@ @[<hov>Hint: %a@]" Format.pp_print_text
+        "this is a polymorphic function, and multiple accepted arities \
+         are possible because the language supports inference of all type \
+         arguments when none are given in an application."
+    | _ -> ()
+
+  let pp_hint fmt = function
+    | "" -> ()
+    | msg ->
+      Format.fprintf fmt "@ @[<hov 2>Hint: %a@]"
+        Format.pp_print_text msg
+
+  (* Report type warnings *)
   (* ************************************************************************ *)
 
-  let add_warning, get_warnings =
-    let l = ref [] in
-    let add loc msg = l := (loc, msg) :: !l in
-    let get () = let res = !l in l := []; res in
-    add, get
-
-  let fmt_warning loc format =
-    Format.kasprintf (fun msg -> add_warning loc msg) format
-
-  module Warn = struct
-
-    let reason_loc r =
-    match (r : Dolmen_type.Tff.reason) with
-      | Inferred loc
-      | Declared loc -> loc
-
-    let binding_reason = function
-      | `Not_found -> assert false
-      | `Ty (_, reason)
-      | `Cstr (_, reason)
-      | `Term (_, reason)
-      | `Field (_, reason) -> reason
-
-    let shadow id old cur =
-      let old_reason = binding_reason old in
-      let new_reason = binding_reason cur in
-      let loc = reason_loc new_reason in
-      fmt_warning loc "%a"
-          print_shadowing_reasons (id, old_reason, new_reason)
-
-    let unused_ty_var loc v =
-      fmt_warning loc
-          "Quantified type variable `%a` is unused"
-          Dolmen.Expr.Print.ty_var v
-
-    let unused_term_var loc v =
-      fmt_warning loc
-        "Quantified term variable `%a` is unused"
-        Dolmen.Expr.Print.term_var v
+  let decl_loc d =
+    match (d : Dolmen.Std.Statement.decl) with
+    | Record { loc; _ }
+    | Abstract { loc; _ }
+    | Inductive { loc; _ } -> loc
 
-    let error_in_attribute loc exn =
-      fmt_warning loc
-        "Error while type-checking an attribute:@ %s"
-        (Printexc.to_string exn)
-
-    let not_found _ _ = ()
-
-    let superfluous_destructor _ _ _ _ = ()
+  let print_reason fmt r =
+    match (r : T.reason) with
+    | Builtin ->
+      Format.fprintf fmt "defined by a builtin theory"
+    | Bound (file, ast) ->
+      Format.fprintf fmt "bound at %a"
+        Dolmen.Std.Loc.fmt_pos (Dolmen.Std.Loc.loc file ast.loc)
+    | Inferred (file, ast) ->
+      Format.fprintf fmt "inferred at %a"
+        Dolmen.Std.Loc.fmt_pos (Dolmen.Std.Loc.loc file ast.loc)
+    | Defined (file, d) ->
+      Format.fprintf fmt "defined at %a"
+        Dolmen.Std.Loc.fmt_pos (Dolmen.Std.Loc.loc file d.loc)
+    | Declared (file, d) ->
+      Format.fprintf fmt "declared at %a"
+        Dolmen.Std.Loc.fmt_pos (Dolmen.Std.Loc.loc file (decl_loc d))
+
+  let print_reason_opt fmt = function
+    | Some r -> print_reason fmt r
+    | None -> Format.fprintf fmt "<location missing>"
+
+  let report_warning (T.Warning (_env, _fragment, warn)) =
+    let aux: type a. a T.warn -> _ = fun warn ->
+    match warn with
+    | T.Unused_type_variable v -> Some (fun fmt () ->
+        Format.fprintf fmt
+          "Quantified type variable `%a` is unused"
+          Dolmen.Std.Expr.Print.ty_var v
+      )
+    | T.Unused_term_variable v -> Some (fun fmt () ->
+        Format.fprintf fmt
+          "Quantified term variable `%a` is unused"
+          Dolmen.Std.Expr.Print.term_var v
+      )
+    | T.Error_in_attribute exn -> Some (fun fmt () ->
+        Format.fprintf fmt
+          "Exception while typing attribute:@ %s" (Printexc.to_string exn)
+      )
+    | T.Superfluous_destructor _ -> Some (fun fmt () ->
+        Format.fprintf fmt "Internal warning, please report upstream, ^^"
+      )
 
-  end
+    | T.Shadowing (id, old, _cur) -> Some (fun fmt () ->
+        Format.fprintf fmt
+          "Shadowing: %a was already %a"
+          Dolmen.Std.Id.print id
+          print_reason_opt (T.binding_reason old)
+      )
 
-  (* Dolmen_type functors instantiation *)
-  (* ************************************************************************ *)
+    | Smtlib2_Ints.Restriction msg
+              -> Some (fun fmt () ->
+          Format.fprintf fmt
+            "This is a non-linear expression according to the smtlib spec.%a"
+            pp_hint msg
+        )
+
+    | Smtlib2_Reals.Restriction msg
+              -> Some (fun fmt () ->
+          Format.fprintf fmt
+            "This is a non-linear expression according to the smtlib spec.%a"
+            pp_hint msg
+        )
+
+    | Smtlib2_Reals_Ints.Restriction msg
+      -> Some (fun fmt () ->
+          Format.fprintf fmt
+            "This is a non-linear expression according to the smtlib spec.%a"
+            pp_hint msg
+        )
+
+    | Smtlib2_Float.Real_lit -> Some (fun fmt () ->
+        Format.fprintf fmt
+          "Real literals are not part of the Floats specification."
+      )
+    | Smtlib2_Float.Bitv_extended_lit -> Some (fun fmt () ->
+        Format.fprintf fmt
+          "Bitvector decimal literals are not part of the Floats specification."
+      )
 
-  module T = Dolmen_type.Tff.Make
-      (Dolmen.Tag)(Dolmen.Expr.Ty)(Dolmen.Expr.Term)(Warn)
-
-  (* Definitions builtin *)
-  module Decl = Dolmen_type.Def.Declare(T)
-  module Subst = Dolmen_type.Def.Subst(T)(struct
-
-      let of_list l =
-        let aux acc (k, v) = Dolmen.Expr.Subst.Var.bind acc k v in
-        List.fold_left aux Dolmen.Expr.Subst.empty l
-
-      let ty_subst l ty =
-        Dolmen.Expr.Ty.subst (of_list l) ty
-
-      let term_subst tys terms t =
-        Dolmen.Expr.Term.subst (of_list tys) (of_list terms) t
-    end)
-
-  (* Tptp builtins *)
-  module Tptp_Base =
-    Dolmen_type.Base.Tptp.Tff(T)
-      (Dolmen.Expr.Ty)(Dolmen.Expr.Term)
-  module Tptp_Arith =
-    Dolmen_type.Arith.Tptp.Tff(T)
-      (Dolmen.Expr.Ty)(Dolmen.Expr.Term)
-
-  (* Stmlib theories *)
-  module Smtlib2_Base =
-    Dolmen_type.Base.Smtlib2.Tff(T)(Dolmen.Expr.Tags)
-      (Dolmen.Expr.Ty)(Dolmen.Expr.Term)
-  module Smtlib2_Ints =
-    Dolmen_type.Arith.Smtlib2.Int.Tff(T)
-      (Dolmen.Expr.Ty)(Dolmen.Expr.Term.Int)
-  module Smtlib2_Reals =
-    Dolmen_type.Arith.Smtlib2.Real.Tff(T)
-      (Dolmen.Expr.Ty)(Dolmen.Expr.Term.Real)
-  module Smtlib2_Reals_Ints =
-    Dolmen_type.Arith.Smtlib2.Real_Int.Tff(T)
-      (Dolmen.Expr.Ty)(Dolmen.Expr.Term)
-  module Smtlib2_Arrays =
-    Dolmen_type.Arrays.Smtlib2.Tff(T)
-      (Dolmen.Expr.Ty)(Dolmen.Expr.Term)
-  module Smtlib2_Bitv =
-    Dolmen_type.Bitv.Smtlib2.Tff(T)
-      (Dolmen.Expr.Ty)(Dolmen.Expr.Term)
-  module Smtlib2_Float =
-    Dolmen_type.Float.Smtlib2.Tff(T)
-      (Dolmen.Expr.Ty)(Dolmen.Expr.Term)
-
-  (* Zf *)
-  module Zf_Base =
-    Dolmen_type.Base.Zf.Tff(T)(Dolmen.Expr.Tags)
 
+    | _ -> Some (fun fmt () ->
+        Format.fprintf fmt
+          "Unknown warning, please report upstream, ^^"
+      )
+    in
+    aux warn
 
   (* Report type errors *)
   (* ************************************************************************ *)
@@ -168,95 +234,185 @@ module Make(S : State_intf.Typer) = struct
   let print_res fmt res =
     match (res : T.res) with
     | T.Ttype -> Format.fprintf fmt "Type"
-    | T.Ty ty -> Format.fprintf fmt "the type@ %a" Dolmen.Expr.Ty.print ty
-    | T.Term t -> Format.fprintf fmt "the term@ %a" Dolmen.Expr.Term.print t
+    | T.Ty ty -> Format.fprintf fmt "the type@ %a" Dolmen.Std.Expr.Ty.print ty
+    | T.Term t -> Format.fprintf fmt "the term@ %a" Dolmen.Std.Expr.Term.print t
     | T.Tags _ -> Format.fprintf fmt "some tags"
 
   let print_opt pp fmt = function
     | None -> Format.fprintf fmt "<none>"
     | Some x -> pp fmt x
 
-  type T.err += Generic_type_error of string
+  let rec print_expected fmt = function
+    | [] -> assert false
+    | x :: [] -> Format.fprintf fmt "%d" x
+    | x :: r -> Format.fprintf fmt "%d or %a" x print_expected r
+
+  let print_fragment (type a) fmt (env, fragment : T.env * a T.fragment) =
+    match fragment with
+    | T.Ast ast -> Dolmen.Std.Term.print fmt ast
+    | T.Def d -> Dolmen.Std.Statement.print_def fmt d
+    | T.Decl d -> Dolmen.Std.Statement.print_decl fmt d
+    | T.Defs d ->
+      Dolmen.Std.Statement.print_group Dolmen.Std.Statement.print_def fmt d
+    | T.Decls d ->
+      Dolmen.Std.Statement.print_group Dolmen.Std.Statement.print_decl fmt d
+    | T.Located _ ->
+      let full = T.fragment_loc env fragment in
+      let loc = Dolmen.Std.Loc.full_loc full in
+      Format.fprintf fmt "<located at %a>" Dolmen.Std.Loc.fmt loc
+
+  let print_bt fmt bt =
+    if Printexc.backtrace_status () then begin
+      let s = Printexc.raw_backtrace_to_string bt in
+      Format.fprintf fmt "@ @[<h>%a@]" Format.pp_print_text s
+    end
+
 
-  let report_error fmt = function
-    (* Core Typechecking Errors *)
+  let report_error fmt (T.Error (env, fragment, err)) =
+    match err with
+
+    (* Datatype definition not well founded *)
+    | T.Not_well_founded_datatypes _ ->
+      Format.fprintf fmt "Not well founded datatype declaration"
+
+    (* Inference of the type of a bound variable *)
     | T.Infer_type_variable ->
       Format.fprintf fmt "Cannot infer the type of a variable"
+
+    (* Generic error for when something was expected but not there *)
     | T.Expected (expect, got) ->
-      Format.fprintf fmt "Expected %s but got %a" expect (print_opt print_res) got
-    | T.Bad_op_arity (s, i, j) ->
-      Format.fprintf fmt "Bad arity for builtin '%s':@ expected %d arguments but got %d" s i j
-    | T.Bad_ty_arity (c, i) ->
-      Format.fprintf fmt "Bad arity (expected %d arguments) for type constant@ %a"
-        i Dolmen.Expr.Print.ty_const c
-    | T.Bad_cstr_arity (c, i, j) ->
+      Format.fprintf fmt "Expected %s but got %a"
+        expect (print_opt print_res) got
+
+    (* Arity errors *)
+    | T.Bad_index_arity (s, expected, actual) ->
       Format.fprintf fmt
-        "Bad arity (expected %d type argument, and %d term arguments) for term constructor@ %a"
-        i j Dolmen.Expr.Print.term_const c
-    | T.Bad_term_arity (c, i, j) ->
+        "The indexed family of operators '%s' expects %d indexes, but was given %d"
+        s expected actual
+    | T.Bad_ty_arity (c, actual) ->
+      Format.fprintf fmt "Bad arity: got %d arguments for type constant@ %a"
+        actual Dolmen.Std.Expr.Print.ty_const c
+    | T.Bad_op_arity (s, expected, actual) ->
       Format.fprintf fmt
-        "Bad arity (expected %d type argument, and %d term arguments) for term constant@ %a"
-        i j Dolmen.Expr.Print.term_const c
+        "Bad arity for operator '%s':@ expected %a arguments but got %d"
+        s print_expected expected actual
+    | T.Bad_cstr_arity (c, expected, actual) ->
+      Format.fprintf fmt
+        "Bad arity: expected %a arguments but got %d arguments for constructor@ %a%a"
+        print_expected expected actual Dolmen.Std.Expr.Print.term_const c
+        poly_hint (c, expected, actual)
+    | T.Bad_term_arity (c, expected, actual) ->
+      Format.fprintf fmt
+        "Bad arity: expected %a but got %d arguments for function@ %a%a"
+        print_expected expected actual Dolmen.Std.Expr.Print.term_const c
+        poly_hint (c, expected, actual)
+
+    (* Record constuction errors *)
+    | T.Repeated_record_field f ->
+      Format.fprintf fmt
+        "The field %a is used more than once in this record construction"
+        Dolmen.Std.Expr.Print.id f
+    | T.Missing_record_field f ->
+      Format.fprintf fmt
+        "The field %a is missing from this record construction"
+        Dolmen.Std.Expr.Print.id f
+    | T.Mismatch_record_type (f, r) ->
+      Format.fprintf fmt
+        "The field %a does not belong to record type %a"
+        Dolmen.Std.Expr.Print.id f Dolmen.Std.Expr.Print.id r
+
+    (* Application of a variable *)
     | T.Var_application v ->
-      Format.fprintf fmt "Cannot apply arguments to term variable@ %a" Dolmen.Expr.Print.id v
+      Format.fprintf fmt "Cannot apply arguments to term variable@ %a" Dolmen.Std.Expr.Print.id v
     | T.Ty_var_application v ->
-      Format.fprintf fmt "Cannot apply arguments to type variable@ %a" Dolmen.Expr.Print.id v
+      Format.fprintf fmt "Cannot apply arguments to type variable@ %a" Dolmen.Std.Expr.Print.id v
+
+    (* Wrong type *)
     | T.Type_mismatch (t, expected) ->
       Format.fprintf fmt "The term:@ %a@ has type@ %a@ but was expected to be of type@ %a"
-        Dolmen.Expr.Term.print t
-        Dolmen.Expr.Ty.print (Dolmen.Expr.Term.ty t)
-        Dolmen.Expr.Ty.print expected
+        Dolmen.Std.Expr.Term.print t
+        Dolmen.Std.Expr.Ty.print (Dolmen.Std.Expr.Term.ty t)
+        Dolmen.Std.Expr.Ty.print expected
+
     | T.Quantified_var_inference ->
       Format.fprintf fmt "Cannot infer type for a quantified variable"
+
     | T.Unhandled_builtin b ->
       Format.fprintf fmt
         "The following Dolmen builtin is currently not handled@ %a.@ Please report upstream"
-        Dolmen.Term.print_builtin b
+        Dolmen.Std.Term.print_builtin b
+
     | T.Cannot_tag_tag ->
       Format.fprintf fmt "Cannot apply a tag to another tag (only expressions)"
+
     | T.Cannot_tag_ttype ->
       Format.fprintf fmt "Cannot apply a tag to the Ttype constant"
+
     | T.Cannot_find id ->
-      Format.fprintf fmt "Unbound identifier:@ '%a'" Dolmen.Id.print id
+      Format.fprintf fmt "Unbound identifier:@ '%a'" Dolmen.Std.Id.print id
+
+    | T.Forbidden_quantifier ->
+      Format.fprintf fmt "Quantified expressions are forbidden by the logic."
+
     | T.Type_var_in_type_constructor ->
       Format.fprintf fmt "Type variables cannot appear in the signature of a type constant"
+
     | T.Missing_destructor id ->
       Format.fprintf fmt
         "The destructor '%a'@ was not provided by the user implementation.@ Please report upstream."
-        Dolmen.Id.print id
+        Dolmen.Std.Id.print id
+
     | T.Higher_order_application ->
       Format.fprintf fmt "Higher-order applications are not handled by the Tff typechecker"
+
     | T.Higher_order_type ->
       Format.fprintf fmt "Higher-order types are not handled by the Tff typechecker"
+
     | T.Unbound_variables (tys, [], _) ->
       let pp_sep fmt () = Format.fprintf fmt ",@ " in
       Format.fprintf fmt "The following variables are not bound:@ %a"
-        (Format.pp_print_list ~pp_sep Dolmen.Expr.Print.id) tys
+        (Format.pp_print_list ~pp_sep Dolmen.Std.Expr.Print.id) tys
+
     | T.Unbound_variables ([], ts, _) ->
       let pp_sep fmt () = Format.fprintf fmt ",@ " in
       Format.fprintf fmt "The following variables are not bound:@ %a"
-        (Format.pp_print_list ~pp_sep Dolmen.Expr.Print.id) ts
+        (Format.pp_print_list ~pp_sep Dolmen.Std.Expr.Print.id) ts
+
     | T.Unbound_variables (tys, ts, _) ->
       let pp_sep fmt () = Format.fprintf fmt ",@ " in
       Format.fprintf fmt "The following variables are not bound:@ %a,@ %a"
-        (Format.pp_print_list ~pp_sep Dolmen.Expr.Print.id) tys
-        (Format.pp_print_list ~pp_sep Dolmen.Expr.Print.id) ts
+        (Format.pp_print_list ~pp_sep Dolmen.Std.Expr.Print.id) tys
+        (Format.pp_print_list ~pp_sep Dolmen.Std.Expr.Print.id) ts
+
     | T.Unhandled_ast ->
-      Format.fprintf fmt "The typechecker did not know what to do with the term.@ Please report upstream."
+      Format.fprintf fmt
+        "The typechecker did not know what to do with the following term.@ \
+         Please report upstream.@\n%a"
+        print_fragment (env, fragment)
 
     (* Tptp Arithmetic errors *)
     | Tptp_Arith.Expected_arith_type ty ->
       Format.fprintf fmt "Arithmetic type expected but got@ %a.@ %s"
-        Dolmen.Expr.Ty.print ty
-        "Tptp arithmetic symbols are only polymoprhic over the arithmetic types $int, $rat and $real."
+        Dolmen.Std.Expr.Ty.print ty
+        "Tptp arithmetic symbols are only polymorphic over the arithmetic types $int, $rat and $real."
     | Tptp_Arith.Cannot_apply_to ty ->
       Format.fprintf fmt "Cannot apply the arithmetic operation to type@ %a"
-        Dolmen.Expr.Ty.print ty
+        Dolmen.Std.Expr.Ty.print ty
+
+    (* Smtlib Arrya errors *)
+    | Smtlib2_Arrays.Forbidden msg ->
+      Format.fprintf fmt "Forbidden array sort.%a" pp_hint msg
 
     (* Smtlib Arithmetic errors *)
+    | Smtlib2_Ints.Forbidden msg ->
+      Format.fprintf fmt "Non-linear expressions are forbidden by the logic.%a" pp_hint msg
+    | Smtlib2_Reals.Forbidden msg ->
+      Format.fprintf fmt "Non-linear expressions are forbidden by the logic.%a" pp_hint msg
+    | Smtlib2_Reals_Ints.Forbidden msg ->
+      Format.fprintf fmt "Non-linear expressions are forbidden by the logic.%a" pp_hint msg
     | Smtlib2_Reals_Ints.Expected_arith_type ty ->
       Format.fprintf fmt "Arithmetic type expected but got@ %a.@ %s"
-        Dolmen.Expr.Ty.print ty
+        Dolmen.Std.Expr.Ty.print ty
         "The stmlib Reals_Ints theory requires an arithmetic type in order to correctly desugar the expression."
 
     (* Smtlib Bitvector errors *)
@@ -264,43 +420,62 @@ module Make(S : State_intf.Typer) = struct
       Format.fprintf fmt "The character '%c' is invalid inside a binary bitvector litteral" c
     | Smtlib2_Bitv.Invalid_hex_char c ->
       Format.fprintf fmt "The character '%c' is invalid inside a hexadecimal bitvector litteral" c
+    | Smtlib2_Bitv.Invalid_dec_char c ->
+      Format.fprintf fmt "The character '%c' is invalid inside a decimal bitvector litteral" c
 
     (* Smtlib Float errors *)
     | Smtlib2_Float.Invalid_bin_char c ->
-      Format.fprintf fmt "The character '%c' is invalid inside a binary float litteral" c
+      Format.fprintf fmt "The character '%c' is invalid inside a binary bitvector litteral" c
     | Smtlib2_Float.Invalid_hex_char c ->
-      Format.fprintf fmt "The character '%c' is invalid inside a hexadecimal float litteral" c
-    | Smtlib2_Float.Bitvector_litteral_expected ->
-      Format.fprintf fmt "The fp floating point constructor requires direct bitvector litteral"
-    | Smtlib2_Float.Bitvector_of_size_one_expected i ->
-      Format.fprintf fmt "The fp floating point constructor expect a literal bitvector of size one has first argument (the sign), here it is of size %i" i
-    | Smtlib2_Float.To_fp_incorrect_args ->
-      Format.fprintf fmt "The to_fp function accept an argument of type \
-                          Bitvector or two arguments with the first one a \
-                          RoundingMode and the second one Real, Bitvector or \
-                          FloatingPoint"
-
-    (* Linear arithmetic *)
-    | T.Uncaught_exn (Dolmen.Expr.Filter_failed_term (name, _t))
-      when name = Dolmen.Expr.Filter.Linear.name ->
-      Format.fprintf fmt "Non-linear expressions are forbidden by the logic."
-    (* Quantifier free formulas *)
-    | T.Uncaught_exn (Dolmen.Expr.Filter_failed_term (name, _t))
-      when name = Dolmen.Expr.Filter.Quantifier.name ->
-      Format.fprintf fmt "Quantified expressions are forbidden by the logic."
+      Format.fprintf fmt "The character '%c' is invalid inside a hexadecimal bitvector litteral" c
+    | Smtlib2_Float.Invalid_dec_char c ->
+      Format.fprintf fmt "The character '%c' is invalid inside a decimal bitvector litteral" c
+
+    (* Smtlib String errors *)
+    | Smtlib2_String.Invalid_hexadecimal s ->
+      Format.fprintf fmt "The following is not a valid hexadecimal character: '%s'" s
+    | Smtlib2_String.Invalid_string_char c ->
+      Format.fprintf fmt "The following character is not allowed in string literals: '%c'" c
+    | Smtlib2_String.Invalid_escape_sequence (s, i) ->
+      Format.fprintf fmt "The escape sequence starting at index %d in the \
+                          following string is not allowed: '%s'" i s
 
     (* Expression filters *)
-    | T.Uncaught_exn (Dolmen.Expr.Filter_failed_ty (name, _ty)) ->
-      Format.fprintf fmt "Filter '%s' failed for the given type." name
-    | T.Uncaught_exn (Dolmen.Expr.Filter_failed_term (name, _t)) ->
-      Format.fprintf fmt "Filter '%s' failed for the given term." name
+    | T.Uncaught_exn (Dolmen.Std.Expr.Filter_failed_ty (name, _ty, msg), _) ->
+      Format.fprintf fmt "Filter '%s' failed for the given type.%a" name pp_hint msg
+    | T.Uncaught_exn (Dolmen.Std.Expr.Filter_failed_term (name, _t, msg), _) ->
+      Format.fprintf fmt "Filter '%s' failed for the given term.%a" name pp_hint msg
 
     (* Uncaught exception during type-checking *)
-    | T.Uncaught_exn exn ->
-      Format.fprintf fmt "Uncaught exception: %s" (Printexc.to_string exn)
+    | T.Uncaught_exn (exn, bt) ->
+      Format.fprintf fmt
+        "@[<v 2>Uncaught exception: %s%a@]"
+        (Printexc.to_string exn) print_bt bt
+
+    (* Warnings as errors *)
+    | Warning_as_error w ->
+      begin match report_warning w with
+        | Some pp -> pp fmt ()
+        | None ->
+          Format.fprintf fmt "missing warning reporter, please report upstream, ^^"
+      end
 
-    | Generic_type_error s ->
-      Format.fprintf fmt "%s" s
+    (* Missing logic *)
+    | Missing_logic ->
+      Format.fprintf fmt "Missing logic (aka set-logic for smtlib2)."
+
+    (* Illegal declarations *)
+    | Illegal_decl ->
+      Format.fprintf fmt "Illegal declaration. Hint: check your logic"
+
+    (* Push/Pop errors *)
+    | Invalid_push_n ->
+      Format.fprintf fmt "Invalid push payload (payload must be positive)"
+    | Invalid_pop_n ->
+      Format.fprintf fmt "Invalid pop payload (payload must be positive)"
+    | Pop_with_empty_stack ->
+      Format.fprintf fmt "Pop instruction with an empty stack (likely a \
+                          result of a missing push or excessive pop)"
 
     (* Catch-all *)
     | _ ->
@@ -308,143 +483,642 @@ module Make(S : State_intf.Typer) = struct
 
   let () =
     Printexc.register_printer (function
-        | T.Typing_error (err, _, _) ->
-          Some (Format.asprintf "@[<hov>%a@]@." report_error err)
+        | T.Typing_error error ->
+          Some (Format.asprintf "Typing error:@ %a" report_error error)
         | _ -> None
       )
 
+  (* Warning reporting and wrappers *)
+  (* ************************************************************************ *)
+
+  type warning_conf = {
+    strict_typing : bool;
+    smtlib2_6_shadow_rules : bool;
+  }
+
+  (* Warning reporter, sent to the typechecker.
+     This is responsible for turning fatal warnings into errors *)
+  let warnings_aux report conf ((T.Warning (env, fragment, warn)) as w) =
+    match warn, fragment with
+    (* Warnings as errors *)
+    | T.Shadowing (_, (`Builtin `Term | `Not_found), `Variable _), fragment
+    | T.Shadowing (_, (`Constant _ | `Builtin _ | `Not_found), `Constant _), fragment
+      when conf.smtlib2_6_shadow_rules ->
+      T._error env fragment (Warning_as_error w)
+
+    | Smtlib2_Ints.Restriction _, fragment
+      when conf.strict_typing ->
+      T._error env fragment (Warning_as_error w)
+    | Smtlib2_Reals.Restriction _, fragment
+      when conf.strict_typing ->
+      T._error env fragment (Warning_as_error w)
+    | Smtlib2_Reals_Ints.Restriction _, fragment
+      when conf.strict_typing ->
+      T._error env fragment (Warning_as_error w)
+
+    | Smtlib2_Float.Real_lit, fragment
+      when conf.strict_typing ->
+      T._error env fragment (Warning_as_error w)
+    | Smtlib2_Float.Bitv_extended_lit, fragment
+      when conf.strict_typing ->
+      T._error env fragment (Warning_as_error w)
+
+    (* general case *)
+    | _ -> report w
 
   (* Generate typing env from state *)
   (* ************************************************************************ *)
 
-  let smtlib_logic loc st =
-    match st.Dolmen.State.type_smtlib_logic with
-    | Some s ->
-      begin match Dolmen_type.Base.smtlib_logic s with
-        | Some logic -> logic
-        | None ->
-          (* Unknown logic, default to a reasonable combination *)
-          add_warning loc (Format.asprintf "Unknown logic %s" s);
-          Dolmen_type.Base.all_smtlib_logic
-      end
-    | None ->
-      (* Missing logic, this is a hard error in an smtlib file *)
-      S.missing_smtlib_logic ()
-
-  let builtins_of_smtlib_logic v l =
+  let builtins_of_smtlib2_logic v (l : Dolmen_type.Logic.Smtlib2.t) =
     List.fold_left (fun acc th ->
-        match (th : Dolmen_type.Base.smtlib_theory) with
-        | `Core -> Smtlib2_Base.parse v :: acc
-        | `Ints -> Smtlib2_Ints.parse v :: acc
-        | `Arrays -> Smtlib2_Arrays.parse v :: acc
+        match (th : Dolmen_type.Logic.Smtlib2.theory) with
+        | `Core -> Smtlib2_Core.parse v :: acc
         | `Bitvectors -> Smtlib2_Bitv.parse v :: acc
         | `Floats -> Smtlib2_Float.parse v :: acc
-        | `Reals -> Smtlib2_Reals.parse v :: acc
-        | `Reals_Ints -> Smtlib2_Reals_Ints.parse v :: acc
-      ) [] l.Dolmen_type.Base.theories
-
-  let restrictions_of_smtlib_logic _v l =
-    Dolmen.Expr.Filter.reset ();
-    List.iter (function
-        | `Linear_arithmetic ->
-          Dolmen.Expr.Filter.Linear.active := true
-        | `Quantifier_free ->
-          Dolmen.Expr.Filter.Quantifier.allow := false
-        | `Difference_logic
-        | `No_free_symbol -> (* TODO *) ()
-      ) l.Dolmen_type.Base.restrictions
-
-  let additional_builtins = ref (fun _ _ _ _ -> None : T.builtin_symbols)
-
-  let typing_env
-      ?(loc=Dolmen.ParseLocation.mk "" 0 0 0 0)
-      (st : (Parser.language, _, _) Dolmen.State.state) =
-    (* Expected type for type inference (top-down) *)
-    let expect =
-      match st.input_lang with
-      | Some Dimacs
-      | Some ICNF
-      | Some Tptp _ ->
-        T.Typed Dolmen.Expr.Ty.prop
-      | _ ->
-        T.Nothing
-    in
-    (* Base type used for type inference (bottom) *)
-    let infer_base =
-      match st.input_lang with
-      | Some Dimacs
-      | Some ICNF -> Some Dolmen.Expr.Ty.prop
-      | Some Tptp _ -> Some Dolmen.Expr.Ty.base
-      | _ -> None
+        | `String -> Smtlib2_String.parse v :: acc
+        | `Arrays ->
+          Smtlib2_Arrays.parse ~arrays:l.features.arrays v :: acc
+        | `Ints ->
+          Smtlib2_Ints.parse ~arith:l.features.arithmetic v :: acc
+        | `Reals ->
+          Smtlib2_Reals.parse ~arith:l.features.arithmetic v :: acc
+        | `Reals_Ints ->
+          Smtlib2_Reals_Ints.parse ~arith:l.features.arithmetic v :: acc
+      ) [] l.Dolmen_type.Logic.Smtlib2.theories
+
+  let additional_builtins = ref (fun _ _ -> `Not_found : T.builtin_symbols)
+
+  let typing_env ~loc warnings (st : S.t) =
+
+    let file = S.input_file_loc st in
+
+    let additional_builtins env args =
+      !additional_builtins env args
     in
-    (* Builtins for each language *)
-    let lang_builtins =
-      match st.input_lang with
-      | None -> assert false
-      | Some Dimacs
-      | Some ICNF -> []
-      | Some Alt_ergo -> []
-      | Some Tptp v -> [
-          Tptp_Base.parse v;
+
+
+    (* Match the language to determine bultins and other options *)
+    match (S.input_lang st : Logic.language option) with
+    | None -> assert false
+
+    (* Dimacs & iCNF
+       - these infer the declarations of their constants
+         (we could declare them when the number of clauses and variables
+         is declared in the file, but it's easier this way).
+       - there are no explicit declaration or definitions, hence no builtins *)
+    | Some Dimacs | Some ICNF ->
+      let poly = T.Flexible in
+      let expect = T.Typed Dolmen.Std.Expr.Ty.prop in
+      let infer_base = Some Dolmen.Std.Expr.Ty.prop in
+      let warnings = warnings {
+          strict_typing = S.strict_typing st;
+          smtlib2_6_shadow_rules = false;
+        } in
+      let builtins = Dolmen_type.Base.noop in
+      T.empty_env
+        ~st:(S.ty_state st).typer
+        ~expect ?infer_base ~poly
+        ~warnings ~file builtins
+
+    (* Alt-Ergo format
+    *)
+    | Some Alt_ergo ->
+      let poly = T.Flexible in
+      let expect = T.Nothing in
+      let infer_base = None in
+      let warnings = warnings {
+          strict_typing = S.strict_typing st;
+          smtlib2_6_shadow_rules = false;
+        } in
+      let builtins = Dolmen_type.Base.merge [
+          Ae_Core.parse;
+          Decl.parse; Subst.parse;
+          additional_builtins
+        ] in
+      T.empty_env
+        ~st:(S.ty_state st).typer
+        ~expect ?infer_base ~poly
+        ~warnings ~file builtins
+
+    (* Zipperposition Format
+       - no inference of constants
+       - only the base builtin
+    *)
+    | Some Zf ->
+      let poly = T.Flexible in
+      let expect = T.Nothing in
+      let infer_base = None in
+      let warnings = warnings {
+          strict_typing = S.strict_typing st;
+          smtlib2_6_shadow_rules = false;
+        } in
+      let builtins = Dolmen_type.Base.merge [
+          Decl.parse;
+          Subst.parse;
+          additional_builtins;
+          Zf_Core.parse;
+        ] in
+      T.empty_env
+        ~st:(S.ty_state st).typer
+        ~expect ?infer_base ~poly
+        ~warnings ~file builtins
+
+    (* TPTP
+       - tptp has inference of constants
+       - 2 base theories (Core and Arith) + the builtin Decl and Subst
+         for explicit declaration and definitions
+    *)
+    | Some Tptp v ->
+      let poly = T.Explicit in
+      let expect = T.Typed Dolmen.Std.Expr.Ty.prop in
+      let infer_base = Some Dolmen.Std.Expr.Ty.base in
+      let warnings = warnings {
+          strict_typing = S.strict_typing st;
+          smtlib2_6_shadow_rules = false;
+        } in
+      let builtins = Dolmen_type.Base.merge [
+          Decl.parse;
+          Subst.parse;
+          additional_builtins;
+          Tptp_Core.parse v;
           Tptp_Arith.parse v;
-        ]
-      | Some Zf -> [
-          Zf_Base.parse;
-        ]
-      | Some Smtlib2 v ->
-        let logic = smtlib_logic loc st in
-        restrictions_of_smtlib_logic v logic;
-        builtins_of_smtlib_logic v logic
-    in
-    let additional_builtins env ast s args =
-      !additional_builtins env ast s args
-    in
-    let builtins =
-      Dolmen_type.Base.merge
-        (Decl.parse :: Subst.parse :: additional_builtins :: lang_builtins)
+        ] in
+      T.empty_env
+        ~st:(S.ty_state st).typer
+        ~expect ?infer_base ~poly
+        ~warnings ~file builtins
+
+    (* SMTLib v2
+       - no inference
+       - see the dedicated function for the builtins
+       - restrictions come from the logic declaration
+       - shadowing is forbidden
+    *)
+    | Some Smtlib2 v ->
+      let poly = T.Implicit in
+      let expect = T.Nothing in
+      let infer_base = None in
+      let warnings = warnings {
+          strict_typing = S.strict_typing st;
+          smtlib2_6_shadow_rules = match v with
+            | `Latest | `V2_6 -> true;
+        } in
+      begin match (S.ty_state st).logic with
+        | Auto ->
+          let builtins = Dolmen_type.Base.noop in
+          let env =
+            T.empty_env
+              ~st:(S.ty_state st).typer
+              ~poly ~expect ~warnings ~file builtins
+          in
+          T._error env (Located loc) Missing_logic
+        | Smtlib2 logic ->
+          let builtins = Dolmen_type.Base.merge (
+              Decl.parse :: Subst.parse :: additional_builtins ::
+              builtins_of_smtlib2_logic v logic
+            ) in
+          let quants = logic.features.quantifiers in
+          T.empty_env
+            ~st:(S.ty_state st).typer
+            ~expect ?infer_base ~poly ~quants
+            ~warnings ~file builtins
+      end
+
+  let typing_wrap ?(loc=Dolmen.Std.Loc.no_loc) st ~f =
+    let st = ref st in
+    let report (T.Warning (env, fg, _) as w) =
+      let loc = T.fragment_loc env fg in
+      match report_warning w with
+      | None -> ()
+      | Some pp -> st := S.warn ~loc !st "%a" pp ()
     in
-    T.empty_env ~st:st.type_state ~expect ?infer_base builtins
+    let env = typing_env ~loc (warnings_aux report) !st in
+    let res = f env in
+    !st, res
+
+  (* Push&Pop *)
+  (* ************************************************************************ *)
+
+  let reset st ?loc:_ () =
+    S.set_ty_state st (new_state ())
+
+  let rec push st ?(loc=Dolmen.Std.Loc.no_loc) = function
+    | 0 -> st
+    | i ->
+      if i <= 0 then
+        let env = typing_env ~loc (fun _ _ -> ()) st in
+        T._error env (Located loc) Invalid_push_n
+      else begin
+        let t = S.ty_state st in
+        let st' = T.copy_state t.typer in
+        let t' = { t with stack = st' :: t.stack; } in
+        let st' = S.set_ty_state st t' in
+        push st' (i - 1)
+      end
+
+  let rec pop st ?(loc=Dolmen.Std.Loc.no_loc) = function
+    | 0 -> st
+    | i ->
+      if i <= 0 then
+        let env = typing_env ~loc (fun _ _ -> ()) st in
+        T._error env (Located loc) Invalid_pop_n
+      else begin
+        let t = S.ty_state st in
+        match t.stack with
+        | [] ->
+          let env = typing_env ~loc (fun _ _ -> ()) st in
+          T._error env (Located loc) Pop_with_empty_stack
+        | ty :: r ->
+          let t' = { t with typer = ty; stack = r; } in
+          let st' = S.set_ty_state st t' in
+          pop st' (i - 1)
+      end
+
 
+  (* Setting the logic *)
+  (* ************************************************************************ *)
+
+  let set_logic (st : S.t) ?(loc=Dolmen.Std.Loc.no_loc) s =
+    let file = S.input_file_loc st in
+    let loc : Dolmen.Std.Loc.full = { file; loc; } in
+    match (S.input_lang st : Logic.language option) with
+    | Some ICNF -> st
+    | Some Dimacs -> st
+    | Some Smtlib2 _ ->
+      let st, l =
+        match Dolmen_type.Logic.Smtlib2.parse s with
+        | Some l -> st, l
+        | None ->
+          let st = S.warn ~loc st "Unknown logic %s" s in
+          st, Dolmen_type.Logic.Smtlib2.all
+      in
+      S.set_ty_state st { (S.ty_state st) with logic = Smtlib2 l; }
+    | _ ->
+      S.warn ~loc st
+        "Set logic is not supported for the current language"
+
+
+  (* Declarations *)
+  (* ************************************************************************ *)
+
+  let allow_function_decl (st : S.t) =
+    match (S.ty_state st).logic with
+    | Smtlib2 logic -> logic.features.free_functions
+    | Auto -> true
+
+  let allow_data_type_decl (st : S.t) =
+    match (S.ty_state st).logic with
+    | Smtlib2 logic -> logic.features.datatypes
+    | Auto -> true
+
+  let allow_abstract_type_decl (st : S.t) =
+    match (S.ty_state st).logic with
+    | Smtlib2 logic -> logic.features.free_sorts
+    | Auto -> true
+
+  let check_decl st env d = function
+    | `Type_decl (c : Dolmen.Std.Expr.ty_const) ->
+      begin match Dolmen.Std.Expr.Ty.definition c with
+        | None | Some Abstract ->
+          if not (allow_abstract_type_decl st) then
+            T._error env (Decl d) Illegal_decl
+        | Some Adt _ ->
+          if not (allow_data_type_decl st) then
+            T._error env (Decl d) Illegal_decl
+      end
+    | `Term_decl (c : Dolmen.Std.Expr.term_const) ->
+      let is_function = c.ty.fun_vars <> [] || c.ty.fun_args <> [] in
+      if is_function && not (allow_function_decl st) then
+        T._error env (Decl d) Illegal_decl
+
+  let check_decls st env l decls =
+    List.iter2 (check_decl st env) l decls
+
+  let decls (st : S.t) ?loc ?attr d =
+    typing_wrap ?loc st ~f:(fun env ->
+        let decls = T.decls env ?attr d in
+        let () = check_decls st env d.contents decls in
+        decls
+      )
+
+
+  (* Definitions *)
+  (* ************************************************************************ *)
+
+  let defs st ?loc ?attr d =
+    typing_wrap ?loc st ~f:(fun env ->
+        let l = T.defs env ?attr d in
+        let l = List.map (function
+            | `Type_def (id, _, vars, body) ->
+              let () = if not d.recursive then Subst.define_ty id vars body in
+              `Type_def (id, vars, body)
+            | `Term_def (id, f, vars, args, body) ->
+              let () = Decl.add_definition id (`Term f) in
+              `Term_def (id, f, vars, args, body)
+          ) l
+        in
+        l
+      )
 
   (* Wrappers around the Type-checking module *)
   (* ************************************************************************ *)
 
-  let typecheck (st : _ Dolmen.State.state) = st.type_check
-
-  let def st ?attr id (t : Dolmen.Term.t) =
-    let env = typing_env ?loc:t.loc st in
-    begin match T.new_def ?attr env t id with
-      | `Type_def (id, _, vars, body) ->
-        let () = Subst.define_ty id vars body in
-        st, `Type_def (id, vars, body), get_warnings ()
-      | `Term_def (id, _, vars, args, body) ->
-        let id = Decl.define_term id vars args body in
-        st, `Term_def (id, vars, args, body), get_warnings ()
-    end
+  let typecheck = S.typecheck
 
-  let decls st ?attr l =
-    let env = typing_env st in
-    let decls = T.decls env ?attr l in
-    st, decls, get_warnings ()
-
-  let terms st ?attr:_ l =
-    let res = List.map (fun (t : Dolmen.Term.t) ->
-        let env = typing_env ?loc:t.loc st in
-        T.parse_term env t
-      ) l in
-    st, res, get_warnings ()
-
-  let formula st ?attr:_ ~goal:_ (t : Dolmen.Term.t) =
-    let env = typing_env ?loc:t.loc st in
-    let res = T.parse env t in
-    st, res, get_warnings ()
-
-  let formulas st ?attr:_ l =
-    let l' = List.map (fun (t : Dolmen.Term.t) ->
-        let env = typing_env ?loc:t.loc st in
+  let terms st ?loc ?attr:_ l =
+    typing_wrap ?loc st ~f:(fun env ->
+        List.map (T.parse_term env) l
+      )
+
+  let formula st ?loc ?attr:_ ~goal:_ (t : Dolmen.Std.Term.t) =
+    typing_wrap ?loc st ~f:(fun env ->
         T.parse env t
-      ) l in
-    st, l', get_warnings ()
+      )
+
+  let formulas st ?loc ?attr:_ l =
+    typing_wrap ?loc st ~f:(fun env ->
+        List.map (T.parse env) l
+      )
+
+end
+
+
+(* Pipes functor *)
+(* ************************************************************************ *)
+
+module type Pipe_arg = Typer_intf.Pipe_arg
+module type Pipe_res = Typer_intf.Pipe_res
+
+module Pipe
+    (Expr : Expr_intf.S)
+    (State : State_intf.Typer_pipe)
+    (Typer : Typer_intf.Pipe_arg
+     with type state := State.t
+      and type ty := Expr.ty
+      and type ty_var := Expr.ty_var
+      and type ty_const := Expr.ty_const
+      and type term := Expr.term
+      and type term_var := Expr.term_var
+      and type term_const := Expr.term_const
+      and type formula := Expr.formula)
+= struct
+
+  module S = Dolmen.Std.Statement
+
+  (* Types used in Pipes *)
+  (* ************************************************************************ *)
+
+  (* Used for representing typed statements *)
+  type +'a stmt = {
+    id : Dolmen.Std.Id.t;
+    loc : Dolmen.Std.Loc.t;
+    contents  : 'a;
+  }
+
+  type def = [
+    | `Type_def of Dolmen.Std.Id.t * Expr.ty_var list * Expr.ty
+    | `Term_def of Dolmen.Std.Id.t * Expr.term_const * Expr.ty_var list * Expr.term_var list * Expr.term
+  ]
+
+  type defs = [
+    | `Defs of def list
+  ]
+
+  type decl = [
+    | `Type_decl of Expr.ty_const
+    | `Term_decl of Expr.term_const
+  ]
+
+  type decls = [
+    | `Decls of decl list
+  ]
+
+  type assume = [
+    | `Hyp of Expr.formula
+    | `Goal of Expr.formula
+    | `Clause of Expr.formula list
+  ]
+
+  type solve = [
+    | `Solve of Expr.formula list
+  ]
+
+  type get_info = [
+    | `Get_info of string
+    | `Get_option of string
+    | `Get_proof
+    | `Get_unsat_core
+    | `Get_unsat_assumptions
+    | `Get_model
+    | `Get_value of Expr.term list
+    | `Get_assignment
+    | `Get_assertions
+    | `Echo of string
+    | `Plain of Dolmen.Std.Statement.term
+  ]
+
+  type set_info = [
+    | `Set_logic of string
+    | `Set_info of Dolmen.Std.Statement.term
+    | `Set_option of Dolmen.Std.Statement.term
+  ]
+
+  type stack_control = [
+    | `Pop of int
+    | `Push of int
+    | `Reset_assertions
+    | `Reset
+    | `Exit
+  ]
+
+  (* Agregate types *)
+  type typechecked = [ defs | decls | assume | solve | get_info | set_info | stack_control ]
+
+  (* Simple constructor *)
+  (* let tr implicit contents = { implicit; contents; } *)
+  let simple id loc (contents: typechecked)  = { id; loc; contents; }
+
+
+  (* Typechecking *)
+  (* ************************************************************************ *)
+
+  let stmt_id ref_name =
+    let counter = ref 0 in
+    (fun c ->
+       match c.Dolmen.Std.Statement.id with
+       | { Dolmen.Std.Id.ns = Dolmen.Std.Id.Decl; name = "" } ->
+         let () = incr counter in
+         let name = Format.sprintf "%s_%d" ref_name !counter in
+         Dolmen.Std.Id.mk Dolmen.Std.Id.decl name
+       | id -> id)
+
+  let def_id   = stmt_id "def"
+  let decl_id  = stmt_id "decl"
+  let hyp_id   = stmt_id "hyp"
+  let goal_id  = stmt_id "goal"
+  let prove_id = stmt_id "prove"
+  let other_id = stmt_id "other"
+
+  let fv_list l =
+    let l' = List.map Dolmen.Std.Term.fv l in
+    List.sort_uniq Dolmen.Std.Id.compare (List.flatten l')
+
+  let quantify ~loc var_ty vars f =
+    let vars = List.map (fun v ->
+        let c = Dolmen.Std.Term.const ~loc v in
+        match var_ty v with
+        | None -> c
+        | Some ty -> Dolmen.Std.Term.colon c ty
+      ) vars in
+    Dolmen.Std.Term.forall ~loc vars f
+
+  let normalize st c =
+    match c with
+    (* Clauses without free variables can be typechecked as is
+       without worry, but if there are free variables, these must
+       be quantified or else the typchecker will raise an error. *)
+    | { S.descr = S.Clause l; _ } ->
+      begin match fv_list l with
+        | [] -> c
+
+        | free_vars ->
+          let loc = c.S.loc in
+          let f = match l with
+            | [] -> assert false
+            | [p] -> p
+            | _ -> Dolmen.Std.Term.apply ~loc (Dolmen.Std.Term.or_t ~loc ()) l
+          in
+          let f = quantify ~loc (fun _ -> None) free_vars f in
+          { c with descr = S.Antecedent f; }
+      end
+    (* Axioms and goals in alt-ergo have their type variables
+       implicitly quantified. *)
+    | { S.descr = S.Antecedent t; _ }
+      when State.input_lang st = Some Logic.Alt_ergo ->
+      begin match fv_list [t] with
+        | [] -> c
+        | free_vars ->
+          let loc = c.S.loc in
+          let var_ttype _ = Some (Dolmen.Std.Term.tType ~loc ()) in
+          let f = quantify ~loc var_ttype free_vars t in
+          { c with descr = S.Antecedent f; }
+      end
+    | { S.descr = S.Consequent t; _ }
+      when State.input_lang st = Some Logic.Alt_ergo ->
+      begin match fv_list [t] with
+        | [] -> c
+        | free_vars ->
+          let loc = c.S.loc in
+          let var_ttype _ = Some (Dolmen.Std.Term.tType ~loc ()) in
+          let f = quantify ~loc var_ttype free_vars t in
+          { c with descr = S.Consequent f; }
+      end
+
+
+    (* catch all *)
+    | _ -> c
+
+  let typecheck st c =
+    let res =
+      if not (Typer.typecheck st) then
+        st, `Done ()
+      else match normalize st c with
+
+      (* Pack and includes.
+         These should have been filtered out before this point.
+         TODO: emit some kind of warning ? *)
+      | { S.descr = S.Pack _; _ } -> st, `Done ()
+      | { S.descr = S.Include _; _ } -> st, `Done ()
+
+      (* Assertion stack Management *)
+      | { S.descr = S.Pop i; _ } ->
+        let st = Typer.pop st ~loc:c.S.loc i in
+        st, `Continue (simple (other_id c) c.S.loc (`Pop i))
+      | { S.descr = S.Push i; _ } ->
+        let st = Typer.push st ~loc:c.S.loc i in
+        st, `Continue (simple (other_id c) c.S.loc (`Push i))
+      | { S.descr = S.Reset_assertions; _ } ->
+        let st = Typer.reset st ~loc:c.S.loc () in
+        st, `Continue (simple (other_id c) c.S.loc `Reset_assertions)
+
+      (* Plain statements
+         TODO: allow the `plain` function to return a meaningful value *)
+      | { S.descr = S.Plain t; _ } ->
+        st, `Continue (simple (other_id c) c.S.loc (`Plain t))
+
+      (* Hypotheses and goal statements *)
+      | { S.descr = S.Prove l; _ } ->
+        let st, l = Typer.formulas st ~loc:c.S.loc ?attr:c.S.attr l in
+        st, `Continue (simple (prove_id c) c.S.loc (`Solve l))
+
+      (* Hypotheses & Goals *)
+      | { S.descr = S.Clause l; _ } ->
+        let st, res = Typer.formulas st ~loc:c.S.loc ?attr:c.S.attr l in
+        let stmt : typechecked stmt = simple (hyp_id c) c.S.loc (`Clause res) in
+        st, `Continue stmt
+      | { S.descr = S.Antecedent t; _ } ->
+        let st, ret = Typer.formula st ~loc:c.S.loc ?attr:c.S.attr ~goal:false t in
+        let stmt : typechecked stmt = simple (hyp_id c) c.S.loc (`Hyp ret) in
+        st, `Continue stmt
+      | { S.descr = S.Consequent t; _ } ->
+        let st, ret = Typer.formula st ~loc:c.S.loc ?attr:c.S.attr ~goal:true t in
+        let stmt : typechecked stmt = simple (goal_id c) c.S.loc (`Goal ret) in
+        st, `Continue stmt
+
+      (* Other set_logics should check whether corresponding plugins are activated ? *)
+      | { S.descr = S.Set_logic s; _ } ->
+        let st = Typer.set_logic st ~loc:c.S.loc s in
+        st, `Continue (simple (other_id c) c.S.loc (`Set_logic s))
+
+      (* Set/Get info *)
+      | { S.descr = S.Get_info s; _ } ->
+        st, `Continue (simple (other_id c) c.S.loc (`Get_info s))
+      | { S.descr = S.Set_info t; _ } ->
+        st, `Continue (simple (other_id c) c.S.loc (`Set_info t))
+
+      (* Set/Get options *)
+      | { S.descr = S.Get_option s; _ } ->
+        st, `Continue (simple (other_id c) c.S.loc (`Get_option s))
+      | { S.descr = S.Set_option t; _ } ->
+        st, `Continue (simple (other_id c) c.S.loc (`Set_option t))
+
+      (* Declarations and definitions *)
+      | { S.descr = S.Defs d; _ } ->
+        let st, l = Typer.defs st ~loc:c.S.loc ?attr:c.S.attr d in
+        let res : typechecked stmt = simple (def_id c) c.S.loc (`Defs l) in
+        st, `Continue (res)
+      | { S.descr = S.Decls l; _ } ->
+        let st, l = Typer.decls st ~loc:c.S.loc ?attr:c.S.attr l in
+        let res : typechecked stmt = simple (decl_id c) c.S.loc (`Decls l) in
+        st, `Continue (res)
+
+      (* Smtlib's proof/model instructions *)
+      | { S.descr = S.Get_proof; _ } ->
+        st, `Continue (simple (other_id c) c.S.loc `Get_proof)
+      | { S.descr = S.Get_unsat_core; _ } ->
+        st, `Continue (simple (other_id c) c.S.loc `Get_unsat_core)
+      | { S.descr = S.Get_unsat_assumptions; _ } ->
+        st, `Continue (simple (other_id c) c.S.loc `Get_unsat_assumptions)
+      | { S.descr = S.Get_model; _ } ->
+        st, `Continue (simple (other_id c) c.S.loc `Get_model)
+      | { S.descr = S.Get_value l; _ } ->
+        let st, l = Typer.terms st ~loc:c.S.loc ?attr:c.S.attr l in
+        st, `Continue (simple (other_id c) c.S.loc (`Get_value l))
+      | { S.descr = S.Get_assignment; _ } ->
+        st, `Continue (simple (other_id c) c.S.loc `Get_assignment)
+      (* Assertions *)
+      | { S.descr = S.Get_assertions; _ } ->
+        st, `Continue (simple (other_id c) c.S.loc `Get_assertions)
+      (* Misc *)
+      | { S.descr = S.Echo s; _ } ->
+        st, `Continue (simple (other_id c) c.S.loc (`Echo s))
+      | { S.descr = S.Reset; _ } ->
+        st, `Continue (simple (other_id c) c.S.loc `Reset)
+      | { S.descr = S.Exit; _ } ->
+        st, `Continue (simple (other_id c) c.S.loc `Exit)
+
+    in
+    res
 
 end
 
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/loop/typer.mli b/Src/COLIBRI/simplex_ocaml/dolmen/src/loop/typer.mli
index 656bd370c353eb1a69ca18f6767028ae0252c091..a594f23a50c4e691696c7a11b00e91e79ea8b842 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/loop/typer.mli
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/loop/typer.mli
@@ -1,38 +1,67 @@
 
 (* This file is free software, part of dolmen. See file "LICENSE" for more information *)
 
-module type S = sig
+(** {2 Typechecker state} *)
 
-  type solve_st
+type ty_state
+(** The type of state used by the {!Make} functor. *)
 
-  module T : Dolmen_type.Tff_intf.S
-    with type 'a Tag.t = 'a Dolmen.Tag.t
-     and type Ty.t = Dolmen.Expr.ty
-     and type Ty.Var.t = Dolmen.Expr.ty_var
-     and type Ty.Const.t = Dolmen.Expr.ty_const
-     and type T.t = Dolmen.Expr.term
-     and type T.Var.t = Dolmen.Expr.term_var
-     and type T.Const.t = Dolmen.Expr.term_const
-     and type T.Cstr.t = Dolmen.Expr.term_const
+val new_state : unit -> ty_state
+(** Generate a fresh typing state.
+    The bool argument given decides whether locations are kept (provides
+      better error messages, but uses more memory when running). *)
 
-  include Typer_intf.S
-    with type state := (Parser.language, T.state, solve_st) Dolmen.State.state
-     and type ty := Dolmen.Expr.ty
-     and type ty_var := Dolmen.Expr.ty_var
-     and type ty_const := Dolmen.Expr.ty_const
-     and type term := Dolmen.Expr.term
-     and type term_var := Dolmen.Expr.term_var
-     and type term_const := Dolmen.Expr.term_const
-     and type formula := Dolmen.Expr.formula
+module T : Dolmen_type.Tff.S
+  with type 'a Tag.t = 'a Dolmen.Std.Tag.t
+   and type Ty.t = Dolmen.Std.Expr.ty
+   and type Ty.Var.t = Dolmen.Std.Expr.ty_var
+   and type Ty.Const.t = Dolmen.Std.Expr.ty_const
+   and type T.t = Dolmen.Std.Expr.term
+   and type T.Var.t = Dolmen.Std.Expr.term_var
+   and type T.Const.t = Dolmen.Std.Expr.term_const
+   and type T.Cstr.t = Dolmen.Std.Expr.term_const
+(** The raw type-checker module. *)
 
-  val report_error : Format.formatter -> T.err -> unit
-  (** Report a typing error on the given formatter. *)
 
-  val additional_builtins : T.builtin_symbols ref
+(** {2 Typechecker Functor} *)
 
-  type T.err += Generic_type_error of string
+module type S = Typer_intf.S
 
-end
+module Make
+    (S : State_intf.Typer with type ty_state := ty_state)
+  : S with type state := S.t
+       and type ty_state := ty_state
+       and type env := T.env
+       and type 'a fragment := 'a T.fragment
+       and type error := T.error
+       and type warning := T.warning
+       and type builtin_symbols := T.builtin_symbols
+
+(** {2 Typechecker Pipe} *)
+
+module type Pipe_arg = Typer_intf.Pipe_arg
+module type Pipe_res = Typer_intf.Pipe_res
+
+module Pipe
+    (Expr : Expr_intf.S)
+    (State : State_intf.Typer_pipe)
+    (Typer : Pipe_arg
+     with type state := State.t
+      and type ty := Expr.ty
+      and type ty_var := Expr.ty_var
+      and type ty_const := Expr.ty_const
+      and type term := Expr.term
+      and type term_var := Expr.term_var
+      and type term_const := Expr.term_const
+      and type formula := Expr.formula)
+  : Pipe_res
+    with type state := State.t
+     and type ty := Expr.ty
+     and type ty_var := Expr.ty_var
+     and type ty_const := Expr.ty_const
+     and type term := Expr.term
+     and type term_var := Expr.term_var
+     and type term_const := Expr.term_const
+     and type formula := Expr.formula
 
-module Make(S : State_intf.Typer) : S with type solve_st := S.solve_st
 
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/loop/typer_intf.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/loop/typer_intf.ml
index a1d4ca3ea7eb3b87223ba4008069b822d3891190..8bd1c054df5483ffa52bedc97b4123880f0140d6 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/loop/typer_intf.ml
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/loop/typer_intf.ml
@@ -2,17 +2,7 @@
 
 (** Typer *)
 
-(** This modules defines the smallest signatures for a typechecker that allow
-    to instantiate the {State.Make} functor. *)
-module type T = sig
-
-  type ty_state
-
-end
-
-(** This modules defines the smallest signatures for a typechecker that allow
-    to instantiate the {Pipes.Make} functor. *)
-module type S = sig
+module type Pipe_types = sig
 
   type state
 
@@ -26,36 +16,201 @@ module type S = sig
 
   type formula
 
-  val typecheck : state -> bool
+end
+
+(** This modules defines the smallest signatures for a typechecker that allow
+    to instantiate the {Typer.Pipe} functor. *)
+module type Pipe_arg = sig
+
+  include Pipe_types
+
+  val typecheck :
+    state -> bool
+
+  val reset :
+    state -> ?loc:Dolmen.Std.Loc.t -> unit -> state
+
+  val push :
+    state -> ?loc:Dolmen.Std.Loc.t -> int -> state
 
-  val def :
-    state -> ?attr:Dolmen.Term.t -> Dolmen.Id.t -> Dolmen.Term.t ->
-    state *
-    [
-     | `Type_def of Dolmen.Id.t * ty_var list * ty
-     | `Term_def of term_const * ty_var list * term_var list * term
-    ] *
-    (Dolmen.ParseLocation.t * string) list
+  val pop :
+    state -> ?loc:Dolmen.Std.Loc.t -> int -> state
+
+  val set_logic :
+    state -> ?loc:Dolmen.Std.Loc.t -> string -> state
+
+  val defs :
+    state -> ?loc:Dolmen.Std.Loc.t ->
+    ?attr:Dolmen.Std.Term.t -> Dolmen.Std.Statement.defs ->
+    state * [
+     | `Type_def of Dolmen.Std.Id.t * ty_var list * ty
+     | `Term_def of Dolmen.Std.Id.t * term_const * ty_var list * term_var list * term
+    ] list
 
   val decls :
-    state -> ?attr:Dolmen.Term.t ->
-    Dolmen.Statement.decl list ->
+    state -> ?loc:Dolmen.Std.Loc.t ->
+    ?attr:Dolmen.Std.Term.t -> Dolmen.Std.Statement.decls ->
     state * [
       | `Type_decl of ty_const
       | `Term_decl of term_const
-    ] list *
-    (Dolmen.ParseLocation.t * string) list
+    ] list
 
   val terms :
-    state -> ?attr:Dolmen.Term.t -> Dolmen.Term.t list ->
-    state * term list * (Dolmen.ParseLocation.t * string) list
+    state -> ?loc:Dolmen.Std.Loc.t ->
+    ?attr:Dolmen.Std.Term.t -> Dolmen.Std.Term.t list ->
+    state * term list
 
   val formula :
-    state -> ?attr:Dolmen.Term.t -> goal:bool -> Dolmen.Term.t ->
-    state * formula * (Dolmen.ParseLocation.t * string) list
+    state -> ?loc:Dolmen.Std.Loc.t ->
+    ?attr:Dolmen.Std.Term.t -> goal:bool -> Dolmen.Std.Term.t ->
+    state * formula
 
   val formulas :
-    state -> ?attr:Dolmen.Term.t -> Dolmen.Term.t list ->
-    state * formula list * (Dolmen.ParseLocation.t * string) list
+    state -> ?loc:Dolmen.Std.Loc.t ->
+    ?attr:Dolmen.Std.Term.t -> Dolmen.Std.Term.t list ->
+    state * formula list
+
+end
+
+(** This modules defines the result signature of the {Typer.Make} functor *)
+module type S = sig
+
+  type state
+  (** The type of state for a whole pipeline. *)
+
+  type ty_state
+  (** The type for the state of the typer. *)
+
+  type env
+  (** The type of the typechecker environment. *)
+
+  type 'a fragment
+  (** The type of fragments on which error/warning can occur. *)
+
+  type error
+  (** The type of type-checking errors. *)
+
+  type warning
+  (** The type of type-checking warnings. *)
+
+  type builtin_symbols
+  (** The type of builint symbols for the type-checker. *)
+
+  include Pipe_arg
+    with type state := state
+     and type ty := Dolmen.Std.Expr.ty
+     and type ty_var := Dolmen.Std.Expr.ty_var
+     and type ty_const := Dolmen.Std.Expr.ty_const
+     and type term := Dolmen.Std.Expr.term
+     and type term_var := Dolmen.Std.Expr.term_var
+     and type term_const := Dolmen.Std.Expr.term_const
+     and type formula := Dolmen.Std.Expr.formula
+  (** This signature includes the requirements to instantiate the {Pipes.Make:
+      functor*)
+
+  val print_fragment : Format.formatter -> env * 'a fragment -> unit
+  (** Print a code fragment *)
+
+  val report_error : Format.formatter -> error -> unit
+  (** Report a typing error on the given formatter. *)
+
+  val report_warning : warning ->
+    (Format.formatter -> unit -> unit) option
+  (** Return a reporter for the given warning, if the warning should be
+      reported. *)
+
+  val additional_builtins : builtin_symbols ref
+  (** This reference can be modified to parse new builtin symbols. By default no
+      additional builtin symbols are parsed. It is added for all the languages
+      except Dimacs, and iCNF. *)
 
 end
+
+(** This modules defines the result signature of the {Typer.Pipe} functor *)
+module type Pipe_res = sig
+
+  include Pipe_types
+
+  (** {2 Types} *)
+
+  type +'a stmt = {
+    id          : Dolmen.Std.Id.t;
+    loc         : Dolmen.Std.Loc.t;
+    contents    : 'a;
+  }
+  (** Wrapper around statements. It records implicit type declarations. *)
+
+  type decl = [
+    | `Type_decl of ty_const
+    | `Term_decl of term_const
+  ]
+  (** The type of top-level type declarations. *)
+
+  type decls = [
+    | `Decls of decl list
+  ]
+  (** A list of type declarations. *)
+
+  type def = [
+    | `Type_def of Dolmen.Std.Id.t * ty_var list * ty
+    | `Term_def of Dolmen.Std.Id.t * term_const * ty_var list * term_var list * term
+  ]
+  (** The type of top-level type definitions. Type definitions are inlined and so can be ignored. *)
+
+  type defs = [
+    | `Defs of def list
+  ]
+  (** A list of definitions *)
+
+  type assume = [
+    | `Hyp of formula
+    | `Goal of formula
+    | `Clause of formula list
+  ]
+  (** The type of top-level assertion statements *)
+
+  type solve = [
+    | `Solve of formula list
+  ]
+  (** Top-level solve instruction *)
+
+  type get_info = [
+    | `Get_info of string
+    | `Get_option of string
+    | `Get_proof
+    | `Get_unsat_core
+    | `Get_unsat_assumptions
+    | `Get_model
+    | `Get_value of term list
+    | `Get_assignment
+    | `Get_assertions
+    | `Echo of string
+    | `Plain of Dolmen.Std.Statement.term
+  ]
+  (** Various info getters *)
+
+  type set_info = [
+    | `Set_logic of string
+    | `Set_info of Dolmen.Std.Statement.term
+    | `Set_option of Dolmen.Std.Statement.term
+  ]
+  (** Info setters *)
+
+  type stack_control = [
+    | `Pop of int
+    | `Push of int
+    | `Reset_assertions
+    | `Reset
+    | `Exit
+  ]
+  (** Stack control *)
+
+  type typechecked = [ defs | decls | assume | solve | get_info | set_info | stack_control ]
+  (** The type of statements after typechecking *)
+
+  val typecheck : state -> Dolmen.Std.Statement.t ->
+    state * [ `Continue of typechecked stmt | `Done of unit ]
+  (** Typechecks a statement. *)
+
+end
+
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/lsp/diagnostic.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/lsp/diagnostic.ml
index d581bf87e4aea5b464429fc61d8cb7a306eeac54..9a2dc5079d8d0466aaf8d0fbeda7189623145892 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/lsp/diagnostic.ml
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/lsp/diagnostic.ml
@@ -14,7 +14,7 @@ let start_range = lsp_range start_pos start_pos
 
 let range_of_loc = function
   | None -> start_range
-  | Some (l : Dolmen.ParseLocation.t) ->
+  | Some (l : Dolmen.Std.Loc.loc) ->
     lsp_range
       (lsp_pos (l.start_line - 1) l.start_column)
       (lsp_pos (l.stop_line - 1) l.stop_column)
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/lsp/dune b/Src/COLIBRI/simplex_ocaml/dolmen/src/lsp/dune
index 3a73a781f6f11f2a7a569803bc8dc64775a01beb..0f4ac6f0582d3fce36468adfc96a54fd881365b3 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/lsp/dune
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/lsp/dune
@@ -2,5 +2,13 @@
   (name         main)
   (public_name  dolmenls)
   (package      dolmen_lsp)
-  (libraries    dolmen dolmen_type dolmen_loop lsp)
+  (libraries
+    ; ocaml deps
+    threads.posix
+    ; external deps
+    lsp gen
+    ; dolmen deps
+    dolmen dolmen.intf dolmen.std
+    dolmen_type dolmen_loop
+    )
  )
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/lsp/handler.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/lsp/handler.ml
index 69a1f8d0a8892cb494b94380e2f8740b30b0f718..0a620b038a859f353f3738b82c598a5c9a315e11 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/lsp/handler.ml
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/lsp/handler.ml
@@ -15,8 +15,6 @@ module Res_ = struct
     | Ok x -> f x
 end
 
-module Loc = Dolmen.ParseLocation
-
 module N = Lsp.Client_notification
 module Doc = Lsp.Text_document
 
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/lsp/loop.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/lsp/loop.ml
index 270ed30425734a1811e6275f9699633a3934fd31..60fc28cdf47b9ce5de0fe478cf90f536c88ffe1e 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/lsp/loop.ml
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/lsp/loop.ml
@@ -2,14 +2,16 @@
 (* This file is free software, part of dolmen. See file "LICENSE" for more information *)
 
 module Pipeline = Dolmen_loop.Pipeline.Make(State)
-module Pipe = Dolmen_loop.Pipes.Make(Dolmen.Expr)(State)(State.Typer)
 
-exception Finished of (State.t, string) result
+module Parser = Dolmen_loop.Parser.Pipe(Dolmen.Std.Expr)(State)
+module Header = Dolmen_loop.Headers.Pipe(State)
+module Typer = struct
+  module T = Dolmen_loop.Typer.Make(State)
+  include T
+  include Dolmen_loop.Typer.Pipe(Dolmen.Std.Expr)(State)(T)
+end
 
-let no_loc = Dolmen.ParseLocation.mk "" 1 1 1 1
-let get_loc = function
-  | Some l -> l
-  | None -> no_loc
+exception Finished of (State.t, string) result
 
 let handle_exn st = function
 
@@ -18,34 +20,40 @@ let handle_exn st = function
   | Pipeline.Out_of_time -> Error "timeout"
   | Pipeline.Out_of_space -> Error "memoryout"
   (* Exn during parsing *)
-  | Dolmen.ParseLocation.Uncaught (loc, exn) ->
+  | Dolmen.Std.Loc.Uncaught (loc, exn) ->
+    let file = State.input_file_loc st in
+    let loc = Dolmen.Std.Loc.loc file loc in
     Error (Format.asprintf "%a: %s"
-             Dolmen.ParseLocation.fmt loc (Printexc.to_string exn))
+             Dolmen.Std.Loc.fmt loc (Printexc.to_string exn))
 
   (* lexing error *)
-  | Dolmen.ParseLocation.Lexing_error (loc, msg) ->
-    Ok (State.error st loc "Lexing error: %s" msg)
+  | Dolmen.Std.Loc.Lexing_error (loc, msg) ->
+    let file = State.input_file_loc st in
+    let loc = { Dolmen.Std.Loc.file; loc; } in
+    Ok (State.error ~loc st "Lexing error: %s" msg)
   (* Parsing error *)
-  | Dolmen.ParseLocation.Syntax_error (loc, msg) ->
-    Ok (State.error st loc "Syntax error %s" msg)
+  | Dolmen.Std.Loc.Syntax_error (loc, msg) ->
+    let file = State.input_file_loc st in
+    let loc = { Dolmen.Std.Loc.file; loc; } in
+    Ok (State.error ~loc st "Syntax error %t" msg)
   (* Typing error *)
-  | State.Typer.T.Typing_error (err, _, t) ->
-    let loc = get_loc t.Dolmen.Term.loc in
-    Ok (State.error st loc "Typing error: %a" State.Typer.report_error err)
+  | Dolmen_loop.Typer.T.Typing_error (
+      Dolmen_loop.Typer.T.Error (env, fragment, _err) as error) ->
+    let loc = Dolmen_loop.Typer.T.fragment_loc env fragment in
+    Ok (State.error ~loc st "Typing error: %a" Typer.report_error error)
 
   (* File not found *)
-  | State.File_not_found (l, dir, f) ->
-    Ok (State.error st (get_loc l) "File not found: '%s' in directory '%s'" f dir)
-  (* Missing smtlib statement *)
-  | State.Missing_smtlib_logic ->
-    Ok (State.error st no_loc "Missing smtlib set-logic statement")
+  | State.File_not_found (loc, dir, f) ->
+    Ok (State.error ~loc st "File not found: '%s' in directory '%s'" f dir)
   (* Input lang changed *)
   | State.Input_lang_changed _ ->
-    Ok (State.error st no_loc "Language changed because of an include")
+    Ok (State.error st "Language changed because of an include")
 
   (* Fallback *)
   | exn ->
-    Error (Format.asprintf "unknown exn: %s" (Printexc.to_string exn))
+    Ok (State.error st
+          "Internal error, please report upstream: %s"
+          (Printexc.to_string exn))
 
 let finally st e =
   match e with
@@ -57,7 +65,11 @@ let finally st e =
 let process path opt_contents =
   let dir = Filename.dirname path in
   let file = Filename.basename path in
-  let st = Dolmen.State.{
+  let st = State.{
+      debug = false;
+      max_warn = max_int;
+      cur_warn = 0;
+      context = false;
       time_limit = 0.; (* disable the timer *)
       size_limit = max_float;
       input_dir = dir;
@@ -67,21 +79,25 @@ let process path opt_contents =
         | None -> `File file
         | Some contents -> `Raw (file, contents)
       end;
-      type_state = State.Typer.T.new_state ();
+      input_file_loc = Dolmen.Std.Loc.mk_file "";
+      header_check = true;
+      header_licenses = [];
+      header_lang_version = None;
+      header_state = Dolmen_loop.Headers.empty;
+      type_state = Dolmen_loop.Typer.new_state ();
       type_check = true;
-      type_infer = None;
-      type_shadow = None;
-      type_smtlib_logic = None;
+      type_strict = true;
       solve_state = [];
-      export_lang = None;
+      export_lang = [];
     } in
   try
-    let st, g = Pipe.parse [] st in
+    let st, g = Parser.parse [] st in
     let open Pipeline in
     let st = run ~finally g st (
-        (fix (apply ~name:"expand" Pipe.expand) (
-            (apply ~name:"typecheck" Pipe.typecheck)
-            @>|> ((apply fst) @>>> _end)
+        (fix (op ~name:"expand" Parser.expand) (
+            (op ~name:"headers" Header.inspect)
+            @>>> (op ~name:"typecheck" Typer.typecheck)
+            @>|> (op (fun st _ -> st, ())) @>>> _end
           )
         )
       ) in
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/lsp/state.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/lsp/state.ml
index 3852614d8e6e3b6d5406698af63a2865d4bb724e..536c6154ff7e0d97ce90095979adb356f683be3f 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/lsp/state.ml
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/lsp/state.ml
@@ -1,41 +1,13 @@
 
 (* This file is free software, part of dolmen. See file "LICENSE" for more information *)
 
-include Dolmen.State
-
-(* Exceptions *)
-(* ************************************************************************* *)
-
-exception Missing_smtlib_logic
-
-exception File_not_found of
-    Dolmen.ParseLocation.t option * string * string
-
-exception Input_lang_changed of
-    Dolmen_loop.Parser.language * Dolmen_loop.Parser.language
-
-
-(* Module Instantiation *)
-(* ************************************************************************* *)
-
-module Aux = struct
-
-  type solve_st = Diagnostic.t list
-
-  let missing_smtlib_logic () = raise Missing_smtlib_logic
-
-end
-
-module Typer = Dolmen_loop.Typer.Make(Aux)
+include Dolmen_loop.State
 
 (* Type definition *)
 (* ************************************************************************* *)
 
-type lang = Dolmen_loop.Parser.language
-type typer_st = Typer.T.state
-type solver_st = Diagnostic.t list
-
-type t = (lang, typer_st, solver_st) Dolmen.State.state
+type solve_state = Diagnostic.t list
+type t = solve_state state
 
 (* Warnings *)
 (* ************************************************************************* *)
@@ -43,41 +15,39 @@ type t = (lang, typer_st, solver_st) Dolmen.State.state
 let add_diag d (st : t) =
   { st with solve_state = d :: st.solve_state; }
 
-let warn t loc msg =
-  let d = Diagnostic.warn ~loc msg in
-  add_diag d t
+let full_loc t = function
+  | Some full ->
+    Dolmen.Std.Loc.full_loc full
+  | None ->
+    let file = input_file_loc t in
+    Dolmen.Std.Loc.loc file Dolmen.Std.Loc.no_loc
 
-let error t loc format =
-  (* NOTE: probably useless, kasprintf allocates a new buffer… right? *)
-  Format.pp_set_margin Format.str_formatter 500;
+let warn ?loc t format =
+  let loc = full_loc t loc in
   Format.kasprintf (fun msg ->
+      let d = Diagnostic.warn ~loc msg in
+      add_diag d t) format
+
+
+let error ?loc t format =
+  let loc = full_loc t loc in
+  (* Flush the str formatter to clear any unflushed leftover *)
+  let _ = Format.flush_str_formatter () in
+  (* Set the str formatter out functions to not emit newline characters *)
+  let str_out_functions =
+    Format.pp_get_formatter_out_functions Format.str_formatter ()
+  in
+  let () =
+    Format.pp_set_formatter_out_functions Format.str_formatter {
+      str_out_functions with
+      out_newline = (fun () -> str_out_functions.out_spaces 1);
+      out_indent = (fun _ -> ());
+    }
+  in
+  (* Print the error message *)
+  Format.kfprintf (fun _ ->
+      let msg = Format.flush_str_formatter () in
       let d = Diagnostic.error ~loc msg in
       add_diag d t
-    ) ("@[<h>" ^^ format ^^ "@]")
-
-(* Necessary functions *)
-(* ************************************************************************* *)
-
-let start _ = ()
-let stop _ = ()
-
-let file_not_found ?loc ~dir ~file =
-  raise (File_not_found (loc, dir, file))
-
-let set_lang_aux t l =
-  let t = Dolmen.State.set_lang t l in
-  match l with
-  | Dolmen_loop.Parser.Alt_ergo ->
-    Dolmen.State.set_mode t `Full
-  | _ -> t
-
-let set_lang t l =
-  match t.input_lang with
-  | None -> set_lang_aux t l
-  | Some l' ->
-    if l = l'
-    then set_lang_aux t l
-    else raise (Input_lang_changed (l', l))
-
-let run_typecheck st = st.type_check
+    ) Format.str_formatter ("@[<h>" ^^ format ^^ "@]")
 
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/dune b/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/dune
index 7644d77088d33038002f02651560f62d97701fd4..cfce679acb545f412914371eb53e3147cb949495 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/dune
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/dune
@@ -5,9 +5,9 @@
   (flags :standard -warn-error -3)
   (modules
     ; Parsing structures
-    ParseLocation Id Term Statement Normalize
+    Loc Id Term Statement Normalize
     ; Typing & Loop stuff
-    Tag Pretty Expr State
+    Tag Pretty Expr
     ; Helpers
-    Misc Transformer)
+    Msg Tok Vec Misc Escape Transformer)
 )
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/escape.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/escape.ml
new file mode 100644
index 0000000000000000000000000000000000000000..f60b549722d25a15240347a6295c0a81602f69da
--- /dev/null
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/escape.ml
@@ -0,0 +1,120 @@
+(* This file is free software, part of Archsat. See file "LICENSE" for more details. *)
+
+(* Wrapper around polymorphic identifiers *)
+(* ************************************************************************ *)
+
+module type Arg = Dolmen_intf.Id.Escape
+
+(* Escaping helper *)
+(* ************************************************************************ *)
+
+let smap f s =
+  let b = Buffer.create (String.length s) in
+  let rec aux i =
+    if i >= String.length s then
+      Buffer.contents b
+    else begin
+      Buffer.add_string b (f (i + 1) s.[i]);
+      aux (i + 1)
+    end
+  in
+  aux 0
+
+(* Renaming function *)
+(* ************************************************************************ *)
+
+let get_num ~sep s =
+  let rec aux acc mult i =
+    if i < 0 then s, 0
+    else match s.[i] with
+      | ('0' .. '9') as c ->
+        let j = int_of_char c - 48 in
+        aux (acc + j * mult) (mult * 10) (i - 1)
+      | c when c = sep ->
+        if i = 0 then s, 0 (* no base name found *)
+        else String.sub s 0 i, acc
+      | _ -> s, 0
+  in
+  aux 0 1 (String.length s - 1)
+
+let rename ~sep s =
+  let base, n = get_num ~sep s in
+  Format.sprintf "%s%c%d" base sep (n + 1)
+
+
+(* Printing wrappers for escapped sequences *)
+(* ************************************************************************ *)
+
+type status =
+  | Same    (* No changes to the identifiers name *)
+  | Escaped (* Identifiers has been escaped *)
+  | Renamed (* Identifier has been renamed due to a conflict
+               with another escaped or renamed identifier *)
+
+module Make(Id : Arg) = struct
+
+  module H = Hashtbl.Make(Id)
+
+  type t = {
+    lang   : string;
+    name   : Id.t -> string;     (* function for identifier name *)
+    escape : string -> string;  (* escape function, ideally idempotent *)
+    rename : string -> string;  (* renaming function, should have no fixpoint *)
+    mutable table : (status * string) H.t;
+    mutable names : (string, Id.t) Hashtbl.t;
+  }
+
+  let mk ~lang ~name ~escape ~rename = {
+    lang; name;
+    escape; rename;
+    table = H.create 1013;
+    names = Hashtbl.create 1013;
+  }
+
+  let flush t =
+    Hashtbl.reset t.names;
+    H.reset t.table;
+    ()
+
+  (* Adding escapped sequences *)
+  (* ************************************************************************ *)
+
+  let rec add t id status name =
+    match Hashtbl.find t.names name with
+    | exception Not_found ->
+      add_success t id status name
+    | r ->
+      assert (not (Id.equal id r));
+      add_failure t id name
+
+  and add_success t any status name =
+    let () = H.add t.table any (status, name) in
+    let () = Hashtbl.add t.names name any in
+    name
+
+  and add_failure t id name =
+    let new_name = t.rename name in
+    assert (new_name <> name);
+    add t id Renamed new_name
+
+  let escape t id =
+    match H.find t.table id with
+    | (_, s) -> s
+    | exception Not_found ->
+      let name = t.name id in
+      let escaped = t.escape (t.name id) in
+      let status, new_name =
+        if (escaped = name)
+        then Same, name (* allow the gc to reclaim 'escaped' *)
+        else Escaped, escaped
+      in
+      add t id status new_name
+
+  (* Convenience functions *)
+  (* ************************************************************************ *)
+
+  let print t fmt id =
+    Format.fprintf fmt "%s" (escape t id)
+
+end
+
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/escape.mli b/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/escape.mli
new file mode 100644
index 0000000000000000000000000000000000000000..5fa8c72c25a19da6ab2ac7d4d5b5136b41e66049
--- /dev/null
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/escape.mli
@@ -0,0 +1,53 @@
+(* This file is free software, part of Archsat. See file "LICENSE" for more details. *)
+
+(** Escaping identifiers
+
+    This module provides helpers to print identifers
+    in languages, in order to ensure that the printed
+    string is conform to a language specification, in
+    order to avoid all kinds of injections (e.g.
+    parentheses in identifier names, etc...) *)
+
+(** {2 Identifier name manipulation} *)
+
+val smap : (int -> char -> string) -> string -> string
+(** [umap f] provides an equivalent of flat_map on strings.
+    [f] is given the position of the character in the string (starting from [1]),
+    and a character. *)
+
+val rename : sep:char -> string -> string
+(** A renaming function, which add an increasing number after the given separator. *)
+
+
+(** {2 Identifier escaping} *)
+
+module type Arg = Dolmen_intf.Id.Escape
+
+module Make(Id : Arg) : sig
+
+  type t
+  (** The type of environnment/escaper for a given language.
+      Identifiers printed using a given environment, are escaped, and
+      its actual printed string recorded, in order to avoid future conflicts
+      with other escaped identifiers. *)
+
+  val mk :
+    lang:string ->
+    name:(Id.t -> string) ->
+    escape:(string -> string) ->
+    rename:(string -> string) -> t
+  (** Create an escaper from scratch. The name function is called to determine
+      the name of an identifier. The escape function is assumed
+      to be idempotent and have a lot of fixpoints (i.e. all valid identifiers
+      name should map to themselves) whereas the renaming function should
+      have absolutely no fixpoint (i.e. for all strings [rename s <> s]) *)
+
+  val flush : t -> unit
+  (** Remove all the stored information about escaping and renaming. *)
+
+  val print : t -> Format.formatter -> Id.t -> unit
+  (** A printing function that automatically escapes and rename if needed to
+      avoid name clashes, and then print to the given formatter. *)
+
+end
+
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/expr.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/expr.ml
index b80bf1e88453ff054e78834801a93992d7626c55..08d437347129a33ed68b8071226afc4c1fcea653 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/expr.ml
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/expr.ml
@@ -32,7 +32,6 @@ type ('ttype, 'ty) function_type = {
   fun_ret : 'ty;
 }
 
-
 (* Representation of types *)
 type ty_var = ttype id
 
@@ -43,7 +42,8 @@ and ty_descr =
   | App of ty_const * ty list
 
 and ty = {
-  descr : ty_descr;
+  as_ : ty_var option;
+  mutable descr : ty_descr;
   mutable hash : hash; (* lazy hash *)
   mutable tags : Tag.map;
 }
@@ -53,10 +53,13 @@ type term_var = ty id
 
 and term_const = (ttype, ty) function_type id
 
+and pattern = term
+
 and term_descr =
   | Var of term_var
   | App of term_const * ty list * term list
   | Binder of binder * term
+  | Match of term * (pattern * term) list
 
 and binder =
   | Exists of ty_var list * term_var list
@@ -78,7 +81,7 @@ type formula = term
 (* ************************************************************************* *)
 
 type builtin += Base | Wildcard
-type builtin += Prop | Univ
+type builtin += Prop | Unit | Univ
 type builtin += Coercion
 type builtin +=
   | True | False
@@ -88,8 +91,19 @@ type builtin +=
   | Imply | Equiv
 type builtin += Ite
 type builtin +=
-  | Constructor of ty_const * int
-  | Destructor of ty_const * term_const * int * int
+  | Tester of {
+      cstr : term_const;
+    }
+  | Constructor of {
+      adt : ty_const;
+      case : int;
+    }
+  | Destructor of {
+      adt : ty_const;
+      cstr : term_const;
+      case : int;
+      field: int;
+    }
 
 (* arithmetic *)
 type builtin +=
@@ -98,15 +112,17 @@ type builtin +=
   | Real | Decimal of string
   | Lt | Leq | Gt | Geq
   | Minus | Add | Sub | Mul
-  | Div | Div_e | Div_t | Div_f
-  | Modulo | Modulo_t | Modulo_f
+  | Div
+  | Div_e | Modulo_e
+  | Div_t | Modulo_t
+  | Div_f | Modulo_f
   | Abs | Divisible
   | Is_int | Is_rat
   | Floor | Ceiling | Truncate | Round
 
 (* arrays *)
 type builtin +=
-  | Array | Store | Select | Const
+  | Array | Store | Select
 
 (* Bitvectors *)
 type builtin +=
@@ -147,30 +163,30 @@ type builtin +=
   | Plus_zero of int * int
   | Minus_zero of int * int
   | NaN of int * int
-  | Fp_abs  of int * int
-  | Fp_neg  of int * int
-  | Fp_add  of int * int
-  | Fp_sub  of int * int
-  | Fp_mul  of int * int
-  | Fp_div  of int * int
-  | Fp_fma  of int * int
-  | Fp_sqrt  of int * int
-  | Fp_rem  of int * int
+  | Fp_abs of int * int
+  | Fp_neg of int * int
+  | Fp_add of int * int
+  | Fp_sub of int * int
+  | Fp_mul of int * int
+  | Fp_div of int * int
+  | Fp_fma of int * int
+  | Fp_sqrt of int * int
+  | Fp_rem of int * int
   | Fp_roundToIntegral  of int * int
-  | Fp_min  of int * int
-  | Fp_max  of int * int
-  | Fp_leq  of int * int
-  | Fp_lt  of int * int
-  | Fp_geq  of int * int
-  | Fp_gt  of int * int
-  | Fp_eq  of int * int
-  | Fp_isNormal  of int * int
-  | Fp_isSubnormal  of int * int
-  | Fp_isZero  of int * int
-  | Fp_isInfinite  of int * int
-  | Fp_isNaN  of int * int
-  | Fp_isNegative  of int * int
-  | Fp_isPositive  of int * int
+  | Fp_min of int * int
+  | Fp_max of int * int
+  | Fp_leq of int * int
+  | Fp_lt of int * int
+  | Fp_geq of int * int
+  | Fp_gt of int * int
+  | Fp_eq of int * int
+  | Fp_isNormal of int * int
+  | Fp_isSubnormal of int * int
+  | Fp_isZero of int * int
+  | Fp_isInfinite of int * int
+  | Fp_isNaN of int * int
+  | Fp_isNegative of int * int
+  | Fp_isPositive of int * int
   | Ieee_format_to_fp of int * int
   | Fp_to_fp of int * int * int * int
   | Real_to_fp of int * int
@@ -180,6 +196,50 @@ type builtin +=
   | To_sbv of int * int * int
   | To_real of int * int
 
+(* Strings *)
+type builtin +=
+  | String
+  | Str of string
+  | Str_length
+  | Str_at
+  | Str_to_code
+  | Str_of_code
+  | Str_is_digit
+  | Str_to_int
+  | Str_of_int
+  | Str_concat
+  | Str_sub
+  | Str_index_of
+  | Str_replace
+  | Str_replace_all
+  | Str_replace_re
+  | Str_replace_re_all
+  | Str_is_prefix
+  | Str_is_suffix
+  | Str_contains
+  | Str_lexicographic_strict
+  | Str_lexicographic_large
+  | Str_in_re
+
+(* String Regular languages *)
+type builtin +=
+  | String_RegLan
+  | Re_empty
+  | Re_all
+  | Re_allchar
+  | Re_of_string
+  | Re_range
+  | Re_concat
+  | Re_union
+  | Re_inter
+  | Re_star
+  | Re_cross
+  | Re_complement
+  | Re_diff
+  | Re_option
+  | Re_power of int
+  | Re_loop of int * int
+
 
 (* Exceptions *)
 (* ************************************************************************* *)
@@ -187,227 +247,12 @@ type builtin +=
 exception Bad_ty_arity of ty_const * ty list
 exception Bad_term_arity of term_const * ty list * term list
 
-exception Filter_failed_ty of string * ty
-exception Filter_failed_term of string * term
+exception Filter_failed_ty of string * ty * string
+exception Filter_failed_term of string * term * string
 
 exception Type_already_defined of ty_const
 exception Record_type_expected of ty_const
 
-(* Views *)
-(* ************************************************************************* *)
-
-module View = struct
-
-  type ty_view =
-    | Var of ty_var
-    | App of ty_const * ty list
-    | Builtin_app of builtin * ty list
-
-  type term_view =
-    | Var of term_var
-    | App of term_const * ty list * term list
-    | Binder of binder * term
-    | Builtin_app of builtin * ty list * term list
-
-  let ty (ty : ty) : ty_view =
-    match ty.descr with
-    | Var v -> Var v
-    | App (({ builtin; _ } as c), l) ->
-      begin match builtin with
-        | Base -> App (c, l)
-        | _ -> Builtin_app (builtin, l)
-      end
-
-  let term (t : term) : term_view =
-    match t.descr with
-    | Var v -> Var v
-    | App (({ builtin; _ } as c), tys, ts) ->
-      begin match builtin with
-        | Base -> App (c, tys, ts)
-        | _ -> Builtin_app (builtin, tys, ts)
-      end
-    | Binder (b, t) -> Binder (b, t)
-
-end
-
-(* Flags and filters *)
-(* ************************************************************************* *)
-
-module Filter = struct
-
-  type status = [
-    | `Pass
-    | `Warn
-    | `Error
-  ]
-  type ty_filter = ty_const -> ty list -> status
-  type term_filter = term_const -> ty list -> term list -> status
-
-  let ty : (string * bool ref * ty_filter) list tag = Tag.create ()
-  let term : (string * bool ref * term_filter) list tag = Tag.create ()
-
-  module Quantifier = struct
-
-    let allow = ref true
-    let name = "quantifier"
-    let reset () = allow := true
-
-  end
-
-  module Linear = struct
-
-    let active = ref false
-    let name = "linear"
-    let reset () = active := false
-
-    let classify_ty (ty : ty) =
-      match View.ty ty with
-      | Builtin_app (Int, _) -> `Int
-      | Builtin_app (Rat, _) -> `Rat
-      | Builtin_app (Real, _) -> `Real
-      | _ -> `Other
-
-    let is_ty_int t = (classify_ty t = `Int)
-    let is_ty_rat t = (classify_ty t = `Rat)
-    let is_ty_real t = (classify_ty t = `Real)
-
-    let classify_term (t : term) =
-      match View.term t with
-      | Var _ -> `Const
-      | Builtin_app (Integer _, _, _) -> `Value `Integer
-      | Builtin_app (Rational _, _, _) -> `Value `Rational
-      | Builtin_app (Decimal _, _, _) -> `Value `Decimal
-      | Builtin_app (Minus, _, [t']) -> `Negated t'
-      | Builtin_app (Coercion, [src; dst], [t'])
-        when (( is_ty_int src && (is_ty_rat dst || is_ty_real dst) )
-              || ( is_ty_rat src &&  is_ty_real dst) ) ->
-        `Coerced t'
-      (* Rational values *)
-      | Builtin_app (Div, _, [a; b]) ->
-        `Div (a, b)
-      (* Fallback *)
-      | _ -> `Other
-
-    let classify t =
-      match classify_term t with
-      | `Value _ -> `Value
-      | `Const -> `Constant
-      | `Negated t' ->
-        begin match classify_term t' with
-          | `Value _ -> `Value
-          | _ -> `Other
-        end
-      | `Coerced t' ->
-        begin match classify_term t' with
-          | `Value _ -> `Value
-          | _ -> `Other
-        end
-      | `Div (a, b) ->
-        begin match classify_term a, classify_term b with
-          | `Value `Integer, `Value `Integer -> `Value
-          | _ -> `Other
-        end
-      | _ -> `Other
-
-    let gen_wrapper _ _ _ = `Error
-
-    let div_wrapper _ _ ts =
-      match ts with
-      | [a; b] ->
-        begin match classify_term a, classify_term b with
-          | `Value `Integer, `Value `Integer -> `Pass
-          | _ -> `Error
-        end
-      | _ -> `Error
-
-    let mul_wrapper _ _ ts =
-      match ts with
-      | [a; b] ->
-        begin match classify a, classify b with
-          | `Value, `Constant
-          | `Constant, `Value -> `Pass
-          | _ -> `Error
-        end
-      | _ -> `Error
-
-    let gen = name, active, gen_wrapper
-    let div = name, active, div_wrapper
-    let mul = name, active, mul_wrapper
-
-  end
-
-  let reset () =
-    Quantifier.reset ();
-    Linear.reset ()
-
-end
-
-
-(* Helpers *)
-(* ************************************************************************* *)
-
-(* Useful shorthand for chaining comparisons *)
-let (<?>) i (cmp, x, y) =
-  match i with
-  | 0 -> cmp x y
-  | _ -> i
-
-(* hash helpers *)
-let hash2 x y = Hashtbl.seeded_hash x y
-let hash3 x y z = hash2 x (hash2 y z)
-let hash4 x y z t = hash2 x (hash3 y z t)
-
-(* option iter *)
-let option_iter f = function
-  | None -> ()
-  | Some x -> f x
-
-(* list hash *)
-let hash_list f l =
-  let rec aux acc = function
-    | [] -> acc
-    | x :: r -> aux (Hashtbl.seeded_hash acc (f x)) r
-  in
-  aux 0 l
-
-(* lexicographic comparison *)
-let lexicographic cmp l l' =
-  let rec aux l l' =
-    match l, l' with
-    | [], [] -> 0
-    | _ :: _, [] -> 1
-    | [], _ :: _ -> -1
-    | x :: r, x' :: r' ->
-      begin match cmp x x' with
-        | 0 -> aux r r'
-        | res -> res
-      end
-  in
-  aux l l'
-
-(* List creation *)
-let init_list n f =
-  let rec aux acc i =
-    if i > n then List.rev acc else aux (f i :: acc) (i + 1)
-  in
-  aux [] 1
-
-(* constant list with the same elements *)
-let replicate n x =
-  let rec aux x acc n =
-    if n <= 0 then acc
-    else aux x (x :: acc) (n - 1)
-  in
-  aux x [] n
-
-(* automatic cache *)
-let with_cache ~cache f x =
-  match Hashtbl.find cache x with
-  | res -> res
-  | exception Not_found ->
-    let res = f x in
-    Hashtbl.add cache x res;
-    res
 
 (* Tags *)
 (* ************************************************************************* *)
@@ -427,9 +272,13 @@ module Tags = struct
   let prefix = Pretty.Prefix
 
   let named = Tag.create ()
+  let triggers = Tag.create ()
+
+  let bound = Tag.create ()
 
 end
 
+
 (* Printing *)
 (* ************************************************************************* *)
 
@@ -449,7 +298,7 @@ module Print = struct
   let pp_index fmt (v : _ id) = Format.fprintf fmt "/%d" v.index
 
   let id fmt (v : _ id) =
-    match Tag.get v.tags name with
+    match Tag.last v.tags name with
     | Some (Pretty.Exact s | Pretty.Renamed s) -> Format.fprintf fmt "%s" s
     | None ->
       if !print_index then
@@ -457,11 +306,12 @@ module Print = struct
       else
         Format.fprintf fmt "%s" v.name
 
-  let rec ty fmt (t : ty) = match t.descr with
+  let rec ty_descr fmt (descr : ty_descr) =
+    match descr with
     | Var v -> id fmt v
     | App (f, []) -> id fmt f
     | App (f, l) ->
-      begin match Tag.get f.tags pos with
+      begin match Tag.last f.tags pos with
         | Some Pretty.Prefix ->
           Format.fprintf fmt "@[<hov 2>%a %a@]"
             id f (Format.pp_print_list ~pp_sep:(return "") ty) l
@@ -473,6 +323,11 @@ module Print = struct
             id f (Format.pp_print_list ~pp_sep:(return ",@ ") ty) l
       end
 
+  and ty fmt (t: ty) =
+    match t.as_ with
+    | None -> ty_descr fmt t.descr
+    | Some v -> Format.fprintf fmt "(%a@ as@ %a)" ty_descr t.descr id v
+
   let params fmt = function
     | [] -> ()
     | l -> Format.fprintf fmt "∀ @[<hov>%a@].@ "
@@ -488,7 +343,7 @@ module Print = struct
   let fun_ttype = signature ttype
 
   let id_pretty fmt (v : _ id) =
-    match Tag.get v.tags pos with
+    match Tag.last v.tags pos with
     | None -> ()
     | Some Pretty.Infix -> Format.fprintf fmt "(%a)" id v
     | Some Pretty.Prefix -> Format.fprintf fmt "[%a]" id v
@@ -518,9 +373,13 @@ module Print = struct
     | App (f, tys, args) -> term_app fmt f tys args
     | Binder (b, body) ->
       Format.fprintf fmt "@[<hv 2>%a%a@ %a@]" binder b binder_sep b term body
+    | Match (scrutinee, branches) ->
+      Format.fprintf fmt "@[<hv 2>match %a with@ %a@]"
+        term scrutinee
+        (Format.pp_print_list ~pp_sep:(return "@ ") branch) branches
 
   and term_app fmt (f : _ id) tys args =
-    match Tag.get f.tags pos with
+    match Tag.last f.tags pos with
     | Some Pretty.Prefix ->
       begin match args with
         | [] -> id fmt f
@@ -572,6 +431,9 @@ module Print = struct
   and binding fmt (v, t) =
     Format.fprintf fmt "@[<hov 2>%a =@ %a@]" id v term t
 
+  and branch fmt (pattern, body) =
+    Format.fprintf fmt "@[<hov 2>| %a@ ->@ %a" term pattern term body
+
   let iter ~sep pp fmt k =
     let first = ref true in
     k (fun x ->
@@ -580,6 +442,144 @@ module Print = struct
       )
 end
 
+(* Views *)
+(* ************************************************************************* *)
+
+module View = struct
+
+  module Ty = struct
+    type t = [
+      | `Int
+      | `Rat
+      | `Real
+      | `Array of ty * ty
+      | `Bitv of int
+      | `Float of int * int
+      | `String
+      | `String_reg_lang
+      (* Generic cases *)
+      | `Var of ty_var
+      | `App of [
+          | `Generic of ty_const
+          | `Builtin of builtin
+        ] * ty list
+    ]
+
+    let view (ty : ty) : t =
+      match ty.descr with
+      | Var v -> `Var v
+      | App (({ builtin; _ } as c), l) ->
+        begin match builtin with
+          | Int -> `Int
+          | Rat -> `Rat
+          | Real -> `Real
+          | Bitv i -> `Bitv i
+          | Float (e, s) -> `Float (e, s)
+          | Array -> begin match l with
+              | [src; dst] -> `Array (src, dst)
+              | _ -> assert false (* not possible *)
+            end
+          | String -> `String
+          | String_RegLan -> `String_reg_lang
+          | Base -> `App (`Generic c, l)
+          | _ -> `App (`Builtin builtin, l)
+        end
+
+  end
+
+end
+
+(* Flags and filters *)
+(* ************************************************************************* *)
+
+module Filter = struct
+
+  type status = [
+    | `Pass
+    | `Warn
+    | `Error of string
+  ]
+  type ty_filter = string * bool ref * (ty_const -> ty list -> status)
+  type term_filter = string * bool ref * (term_const -> ty list -> term list -> status)
+
+  let ty : ty_filter tag = Tag.create ()
+  let term : term_filter tag = Tag.create ()
+
+  module type S = sig
+    val name : string
+    val active : bool ref
+    val reset : unit -> unit
+  end
+
+end
+
+
+(* Helpers *)
+(* ************************************************************************* *)
+
+(* Useful shorthand for chaining comparisons *)
+let (<?>) i (cmp, x, y) =
+  match i with
+  | 0 -> cmp x y
+  | _ -> i
+
+(* hash helpers *)
+let hash2 x y = Hashtbl.seeded_hash x y
+let hash3 x y z = hash2 x (hash2 y z)
+let hash4 x y z t = hash2 x (hash3 y z t)
+
+(* option iter *)
+let option_iter f = function
+  | None -> ()
+  | Some x -> f x
+
+(* list hash *)
+let hash_list f l =
+  let rec aux acc = function
+    | [] -> acc
+    | x :: r -> aux (Hashtbl.seeded_hash acc (f x)) r
+  in
+  aux 0 l
+
+(* lexicographic comparison *)
+let lexicographic cmp l l' =
+  let rec aux l l' =
+    match l, l' with
+    | [], [] -> 0
+    | _ :: _, [] -> 1
+    | [], _ :: _ -> -1
+    | x :: r, x' :: r' ->
+      begin match cmp x x' with
+        | 0 -> aux r r'
+        | res -> res
+      end
+  in
+  aux l l'
+
+(* List creation *)
+let init_list n f =
+  let rec aux acc i =
+    if i > n then List.rev acc else aux (f i :: acc) (i + 1)
+  in
+  aux [] 1
+
+(* constant list with the same elements *)
+let replicate n x =
+  let rec aux x acc n =
+    if n <= 0 then acc
+    else aux x (x :: acc) (n - 1)
+  in
+  aux x [] n
+
+(* automatic cache *)
+let with_cache ~cache f x =
+  match Hashtbl.find cache x with
+  | res -> res
+  | exception Not_found ->
+    let res = f x in
+    Hashtbl.add cache x res;
+    res
+
 (* Ids *)
 (* ************************************************************************* *)
 
@@ -594,10 +594,14 @@ module Id = struct
 
   let equal v v' = compare v v' = 0
 
+  let print fmt id = Format.pp_print_string fmt id.name
+
   (* Tags *)
+  let tag (id : _ id) k v = id.tags <- Tag.add id.tags k v
+
   let get_tag (id : _ id) k = Tag.get id.tags k
 
-  let tag (id : _ id) k v = id.tags <- Tag.add id.tags k v
+  let get_tag_last (id : _ id) k = Tag.last id.tags k
 
   (* Creating ids *)
   let id_counter = ref 0
@@ -608,10 +612,16 @@ module Id = struct
 
   let const
       ?pos ?name ?builtin ?tags
+      ?(ty_filters=[]) ?(term_filters=[])
       cname fun_vars fun_args fun_ret =
     let res = mk ?builtin ?tags cname { fun_vars; fun_args; fun_ret; } in
+    (* Add filter tags *)
+    List.iter (tag res Filter.ty) ty_filters;
+    List.iter (tag res Filter.term) term_filters;
+    (* Add pretty printing tags *)
     option_iter (tag res Print.pos) pos;
     option_iter (fun s -> tag res Print.name (Pretty.Exact s)) name;
+    (* Return the id *)
     res
 
   let indexed
@@ -667,6 +677,15 @@ module FV = struct
   let remove s l =
     List.fold_left (fun acc v -> del v acc) s l
 
+  let diff s s' =
+    Mi.merge (fun _ o o' ->
+        match o, o' with
+        | None, None -> None
+        | None, Some _ -> None
+        | (Some _ as res), None -> res
+        | Some _, Some _ -> None
+      ) s s'
+
   let merge s s' =
     Mi.merge (fun _ o o' ->
         match o, o' with
@@ -787,14 +806,77 @@ module Ty = struct
 
   type t = ty
 
+  type view = View.Ty.t
+
   type subst = (ty_var, ty) Subst.t
 
   type 'a tag = 'a Tag.t
 
+  (* printing *)
+  let print = Print.ty
+
+  (* hash function *)
+  let rec hash_aux (t : t) = match t.descr with
+    | Var v -> hash2 3 (Id.hash v)
+    | App (f, args) -> hash3 5 (Id.hash f) (hash_list hash args)
+
+  and hash (t : t) =
+    if t.hash < 0 then t.hash <- hash_aux t;
+    t.hash
+
+  (* comparison *)
+  let discr (t: t) = match t.descr with
+    | Var _ -> 1
+    | App _ -> 2
+
+  let rec compare (u : t) (v : t) =
+    if u == v || u.descr == v.descr then 0 else begin
+      let hu = hash u and hv = hash v in
+      if hu <> hv then hu - hv (* safe since both are positive *)
+      else match u.descr, v.descr with
+        | Var v, Var v' -> Id.compare v v'
+        | App (f, args), App (f', args') ->
+          Id.compare f f'
+          <?> (lexicographic compare, args, args')
+        | _, _ -> Stdlib.compare (discr u) (discr v)
+    end
+
+  let equal u v = compare u v = 0
+
+  (* Set a wildcard/hole to a concrete type
+
+     Wildcard can be set to point to another type by mutating the
+     descr field of types (this is the only operation that mutates
+     this field).
+     In order to be correct, when we set a wildcard v to point at
+     another wildcard w, we must remember that, so that when we set
+     w to something, we also need to update v. *)
+
+  let wildcard_tbl = ref Subst.empty
+
+  let wildcard_get v =
+    match Subst.Var.get v !wildcard_tbl with
+    | l -> l
+    | exception Not_found -> []
+
+  let wildcard_add v l =
+    let l' = wildcard_get v in
+    wildcard_tbl := Subst.Var.bind !wildcard_tbl v (List.rev_append l l')
+
+  let set_wildcard v (t: t) =
+    let set_descr (t : t) (s: t) = s.descr <- t.descr in
+    let l = wildcard_get v in
+    List.iter (set_descr t) l;
+    match t.descr with
+    | Var ({ builtin = Wildcard; _ } as w) -> wildcard_add w l;
+    | _ -> ()
+
+
   (* Types definitions *)
 
   type adt_case = {
     cstr : term_const;
+    tester : term_const;
     dstrs : term_const option array;
   }
 
@@ -803,12 +885,12 @@ module Ty = struct
     | Adt of {
         ty : ty_const;
         record : bool;
-        cstrs : adt_case list;
+        cases : adt_case array;
       }
 
   let definition_tag : def Tag.t = Tag.create ()
 
-  let definition c = Id.get_tag c definition_tag
+  let definition c = Id.get_tag_last c definition_tag
 
   let is_record c =
     match definition c with
@@ -820,43 +902,17 @@ module Ty = struct
     | None -> Id.tag c definition_tag d
     | Some _ -> raise (Type_already_defined c)
 
+  (* view *)
+  let view = View.Ty.view
 
   (* Tags *)
-  let get_tag (t : t) k = Tag.get t.tags k
-
   let tag (t : t) k v = t.tags <- Tag.add t.tags k v
 
-  (* printing *)
-  let print = Print.ty
-
-  (* hash function *)
-  let rec hash_aux (t : t) = match t.descr with
-    | Var v -> hash2 3 (Id.hash v)
-    | App (f, args) -> hash3 5 (Id.hash f) (hash_list hash args)
-
-  and hash (t : t) =
-    if t.hash < 0 then t.hash <- hash_aux t;
-    t.hash
-
-  (* comparison *)
-  let discr (t: t) = match t.descr with
-    | Var _ -> 1
-    | App _ -> 2
-
-  let rec compare u v =
-    if u == v then 0 else begin
-      let hu = hash u and hv = hash v in
-      if hu <> hv then hu - hv (* safe since both are positive *)
-      else match u.descr, v.descr with
-        | Var v, Var v' -> Id.compare v v'
-        | App (f, args), App (f', args') ->
-          Id.compare f f'
-          <?> (lexicographic compare, args, args')
-        | _, _ -> Stdlib.compare (discr u) (discr v)
-    end
+  let get_tag (t : t) k = Tag.get t.tags k
 
-  let equal u v = compare u v = 0
+  let get_tag_last (t : t) k = Tag.last t.tags k
 
+  (* Module for namespacing *)
   module Var = struct
     type t = ty_var
     let tag = Id.tag
@@ -864,6 +920,7 @@ module Ty = struct
     let equal = Id.equal
     let compare = Id.compare
     let get_tag = Id.get_tag
+    let get_tag_last = Id.get_tag_last
     let mk name = Id.mk name Type
   end
 
@@ -874,14 +931,18 @@ module Ty = struct
     let equal = Id.equal
     let compare = Id.compare
     let get_tag = Id.get_tag
+    let get_tag_last = Id.get_tag_last
     let mk name n = Id.const name [] (replicate n Type) Type
     let arity (c : t) = List.length c.ty.fun_args
 
     let prop = Id.const ~builtin:Prop "Prop" [] [] Type
+    let unit = Id.const ~builtin:Unit "unit" [] [] Type
     let base = Id.const ~builtin:Univ "$i" [] [] Type
     let int = Id.const ~builtin:Int "int" [] [] Type
     let rat = Id.const ~builtin:Rat "rat" [] [] Type
     let real = Id.const ~builtin:Real "real" [] [] Type
+    let string = Id.const ~builtin:String "string" [] [] Type
+    let string_reg_lang = Id.const ~builtin:String_RegLan "string_reglang" [] [] Type
     let array = Id.const ~builtin:Array "array" [] [Type; Type] Type
     let bitv =
       with_cache ~cache:(Hashtbl.create 13) (fun i ->
@@ -894,11 +955,17 @@ module Ty = struct
     let roundingMode = Id.const ~builtin:RoundingMode "RoundingMode" [] [] Type
   end
 
-  let mk descr = { descr; hash = -1; tags = Tag.empty; }
+  let mk descr = { as_ = None; descr; hash = -1; tags = Tag.empty; }
+
+  let as_ t v = { t with as_ = Some v; }
 
   let of_var v = mk (Var v)
 
-  let wildcard () = of_var (Id.mk ~builtin:Wildcard "_" Type)
+  let wildcard () =
+    let v = Id.mk ~builtin:Wildcard "_" Type in
+    let t = of_var v in
+    wildcard_add v [t];
+    t
 
   let rec check_filters res f args = function
     | [] -> res
@@ -906,7 +973,7 @@ module Ty = struct
       if !active then match (check f args) with
         | `Pass -> check_filters res f args r
         | `Warn -> check_filters res f args r
-        | `Error -> raise (Filter_failed_ty (name, res))
+        | `Error msg -> raise (Filter_failed_ty (name, res, msg))
       else
         check_filters res f args r
 
@@ -916,23 +983,27 @@ module Ty = struct
       raise (Bad_ty_arity (f, args))
     else begin
       let res = mk (App (f, args)) in
-      match Const.get_tag f Filter.ty with
-      | None -> res
-      | Some l -> check_filters res f args l
+      check_filters res f args (Const.get_tag f Filter.ty)
     end
 
-  (* Builtin prop *)
+  (* Builtin types *)
   let prop = apply Const.prop []
+  let unit = apply Const.unit []
   let base = apply Const.base []
   let int = apply Const.int []
   let rat = apply Const.rat []
   let real = apply Const.real []
+  let string = apply Const.string []
+  let string_reg_lang = apply Const.string_reg_lang []
   let array src dst = apply Const.array [src; dst]
   let bitv i = apply (Const.bitv i) []
   let float' es = apply (Const.float es) []
   let float e s = float' (e,s)
   let roundingMode = apply Const.roundingMode []
 
+  (* alias for alt-ergo *)
+  let bool = prop
+
   (* Matching *)
   exception Impossible_matching of ty * ty
 
@@ -977,18 +1048,25 @@ module Ty = struct
     | { descr = App (_, tys); _ } ->
       List.exists (occurs subst l) tys
 
+  let robinson_bind subst m v u =
+    if occurs subst [v] u then
+      raise (Impossible_unification (m, u))
+    else
+      Subst.Var.bind subst v u
+
+  let robinson_as subst s t =
+    match s.as_ with
+    | None -> subst
+    | Some v -> robinson_bind subst s v t
+
   let rec robinson subst s t =
+    let subst = robinson_as (robinson_as subst s t) t s in
     let s = follow subst s in
     let t = follow subst t in
     match s, t with
     | ({ descr = Var ({ builtin = Wildcard; _ } as v); _ } as m), u
     | u, ({ descr = Var ({ builtin = Wildcard; _ } as v); _ } as m) ->
-      if equal m u then
-        subst
-      else if occurs subst [v] u then
-        raise (Impossible_unification (m, u))
-      else
-        Subst.Var.bind subst v u
+      if equal m u then subst else robinson_bind subst m v u
     | ({ descr = Var v; _}, { descr = Var v'; _ }) ->
       if Id.equal v v' then subst
       else raise (Impossible_unification (s, t))
@@ -1042,17 +1120,23 @@ module Term = struct
   type 'a tag = 'a Tag.t
 
   exception Wrong_type of t * ty
+  exception Wrong_sum_type of term_const * ty
   exception Wrong_record_type of term_const * ty_const
+
   exception Field_repeated of term_const
   exception Field_missing of term_const
   exception Field_expected of term_const
 
+  exception Constructor_expected of term_const
+
   let print = Print.term
 
   (* Tags *)
+  let tag (t : t) k v = t.tags <- Tag.add t.tags k v
+
   let get_tag (t : t) k = Tag.get t.tags k
 
-  let tag (t : t) k v = t.tags <- Tag.add t.tags k v
+  let get_tag_last (t : t) k = Tag.last t.tags k
 
   (* Hash *)
   let rec hash_aux t =
@@ -1062,6 +1146,8 @@ module Term = struct
       hash4 5 (Id.hash f) (hash_list Ty.hash tys) (hash_list hash args)
     | Binder (b, body) ->
       hash3 7 (hash_binder b) (hash body)
+    | Match (scrutinee, branches) ->
+      hash3 11 (hash scrutinee) (hash_branches branches)
 
   and hash t =
     if t.hash <= 0 then t.hash <- hash_aux t;
@@ -1076,12 +1162,19 @@ module Term = struct
       let aux (v, t) = hash2 (Id.hash v) (hash t) in
       hash2 7 (hash_list aux l)
 
+  and hash_branch (pattern, body) =
+    hash2 (hash pattern) (hash body)
+
+  and hash_branches l =
+    hash_list hash_branch l
+
   (* Comparison *)
   let discr t =
     match t.descr with
     | Var _ -> 1
     | App _ -> 2
     | Binder _ -> 3
+    | Match _ -> 4
 
   let binder_discr = function
     | Exists _ -> 1
@@ -1101,26 +1194,124 @@ module Term = struct
         | Binder (b, body), Binder (b', body') ->
           compare_binder b b'
           <?> (compare, body, body')
+        | Match (s, l), Match (s', l') ->
+          compare s s'
+          <?> (lexicographic compare_branch, l, l')
         | _, _ -> (discr u) - (discr v)
     end
 
-  and compare_binder b b' =
-    match b, b' with
-    | Exists (tys, ts), Exists (tys', ts') ->
-      lexicographic Id.compare tys tys'
-      <?> (lexicographic Id.compare, ts, ts')
-    | Forall (tys, ts), Forall (tys', ts') ->
-      lexicographic Id.compare tys tys'
-      <?> (lexicographic Id.compare, ts, ts')
-    | Letin l, Letin l' ->
-      let aux (v, t) (v', t') = Id.compare v v' <?> (compare, t, t') in
-      lexicographic aux l l'
-    | _, _ -> (binder_discr b) - (binder_discr b')
+  and compare_binder b b' =
+    match b, b' with
+    | Exists (tys, ts), Exists (tys', ts') ->
+      lexicographic Id.compare tys tys'
+      <?> (lexicographic Id.compare, ts, ts')
+    | Forall (tys, ts), Forall (tys', ts') ->
+      lexicographic Id.compare tys tys'
+      <?> (lexicographic Id.compare, ts, ts')
+    | Letin l, Letin l' ->
+      let aux (v, t) (v', t') = Id.compare v v' <?> (compare, t, t') in
+      lexicographic aux l l'
+    | _, _ -> (binder_discr b) - (binder_discr b')
+
+  and compare_branch (p, b) (p', b') =
+    compare p p' <?> (compare, b, b')
+
+  let equal u v = compare u v = 0
+
+  (* Inspection *)
+  let ty { ty; _ } = ty
+
+  (* free variables *)
+  let rec free_vars acc (t : t) = match t.descr with
+    | Var v -> FV.add (FV.Term v) (Ty.free_vars acc v.ty)
+    | App (_, tys, ts) ->
+      List.fold_left free_vars (
+        List.fold_left Ty.free_vars acc tys
+      ) ts
+    | Binder ((Exists (tys, ts) | Forall (tys, ts)), body) ->
+      let fv = free_vars FV.empty body in
+      let fv = FV.remove fv tys in
+      let fv = FV.remove fv ts in
+      FV.merge fv acc
+    | Binder (Letin l, body) ->
+      let fv = free_vars FV.empty body in
+      let fv = List.fold_right (fun (v, t) acc ->
+          let acc = free_vars acc t in
+          let acc = FV.del v acc in
+          let acc = Ty.free_vars acc v.ty in
+          acc
+        ) l fv in
+      FV.merge fv acc
+    | Match (scrutinee, branches) ->
+      let acc = free_vars acc scrutinee in
+      List.fold_left (fun fv (pat, body) ->
+          let free = free_vars FV.empty body in
+          let bound = free_vars FV.empty pat in
+          FV.merge fv (FV.diff free bound)
+        ) acc branches
+
+  let fv t =
+    let s = free_vars FV.empty t in
+    FV.to_list s
+
+  (* Helpers for adt definition *)
+  let mk_cstr ty_c name i vars args ret =
+    Id.const name vars args ret
+      ~builtin:(Constructor { adt = ty_c; case = i; })
+
+  let mk_cstr_tester cstr =
+    let name = Format.asprintf "is:%a" Print.id cstr in
+    Id.const ~builtin:(Tester { cstr })
+      name cstr.ty.fun_vars [cstr.ty.fun_ret] Ty.prop
+
+  (* ADT definition *)
+  let define_adt_aux ~record ty_const vars l =
+    let ty =  Ty.apply ty_const (List.map Ty.of_var vars) in
+    let cases = ref [] in
+    let l' = List.mapi (fun i (cstr_name, args) ->
+        let args_ty = List.map fst args in
+        let cstr = mk_cstr ty_const cstr_name i vars args_ty ty in
+        let tester = mk_cstr_tester cstr in
+        let dstrs = Array.make (List.length args) None in
+        let l' = List.mapi (fun j -> function
+            | (arg_ty, None) -> (arg_ty, None)
+            | (arg_ty, Some name) ->
+              let dstr =
+                Id.const name vars [ty] arg_ty
+                  ~builtin:(Destructor {
+                      adt = ty_const; cstr;
+                      case = i; field = j; })
+              in
+              dstrs.(j) <- Some dstr;
+              (arg_ty, Some dstr)
+          ) args in
+        cases := { Ty.cstr; tester; dstrs; } :: !cases;
+        cstr, l'
+      ) l in
+    assert (not record || List.length !cases = 1);
+    Ty.define ty_const (Adt { ty = ty_const; record;
+                              cases = Array.of_list @@ List.rev !cases; });
+    l'
+
+  let define_adt = define_adt_aux ~record:false
 
-  let equal u v = compare u v = 0
+  let define_record ty_const vars l =
+    let name = ty_const.name in
+    let cstr_args = List.map (fun (field_name, ty) ->
+        ty, Some field_name
+      ) l in
+    let l' = define_adt_aux ~record:true ty_const vars [name, cstr_args] in
+    match l' with
+    | [ _, l'' ] ->
+      List.map (function
+          | _, Some dstr -> dstr
+          | _, None -> assert false
+        ) l''
+    | _ -> assert false
 
-  (* Inspection *)
-  let ty { ty; _ } = ty
+  (* Exhaustivity check
+     TODO: implement this *)
+  let check_exhaustivity _ty _pats = ()
 
   (* Variables *)
   module Var = struct
@@ -1130,6 +1321,7 @@ module Term = struct
     let equal = Id.equal
     let compare = Id.compare
     let get_tag = Id.get_tag
+    let get_tag_last = Id.get_tag_last
     let ty ({ ty; _ } : t) = ty
     let mk name ty = Id.mk name ty
   end
@@ -1142,7 +1334,23 @@ module Term = struct
     let equal = Id.equal
     let compare = Id.compare
     let get_tag = Id.get_tag
-    let mk name vars args ret = Id.const name vars args ret
+    let get_tag_last = Id.get_tag_last
+
+    let mk name vars args ret =
+      let r = ref ret in
+      let b = ref true in
+      let args = List.map (fun ty ->
+          if !b || not (Ty.equal ty ret) then ty
+          else begin
+            let v = Ty.Var.mk "'ret" in
+            r := Ty.of_var v;
+            b := true;
+            Ty.as_ ty v
+          end
+        ) args
+      in
+      Id.const name vars args !r
+
     let arity (c : t) =
       List.length c.ty.fun_vars, List.length c.ty.fun_args
 
@@ -1230,31 +1438,12 @@ module Term = struct
         ~name:"store" ~builtin:Store
         "Store" [a; b] [arr; a_ty; b_ty] arr
 
-    let const =
-      let a = Ty.Var.mk "alpha" in
-      let a_ty = Ty.of_var a in
-      let b = Ty.Var.mk "beta" in
-      let b_ty = Ty.of_var b in
-      let arr = Ty.array a_ty b_ty in
-      Id.const
-        ~name:"const" ~builtin:Const
-        "Const" [a; b] [b_ty] arr
-
     let coerce =
       let a = Ty.Var.mk "alpha" in
       let b = Ty.Var.mk "beta" in
       Id.const ~builtin:Coercion "coerce"
         [a; b] [Ty.of_var a] (Ty.of_var b)
 
-    let linear_gen_tags =
-      Tag.(add empty) Filter.term [Filter.Linear.gen]
-
-    let linear_div_tags =
-      Tag.(add empty) Filter.term [Filter.Linear.div]
-
-    let linear_mul_tags =
-      Tag.(add empty) Filter.term [Filter.Linear.mul]
-
     module Int = struct
 
       let int =
@@ -1275,39 +1464,31 @@ module Term = struct
           "Sub" [] [Ty.int; Ty.int] Ty.int
 
       let mul = Id.const
-          ~pos:Pretty.Infix ~name:"*"
-          ~builtin:Mul ~tags:linear_mul_tags
+          ~pos:Pretty.Infix ~name:"*" ~builtin:Mul
           "Mul" [] [Ty.int; Ty.int] Ty.int
 
       let div_e = Id.const
-          ~pos:Pretty.Infix ~name:"/e"
-          ~builtin:Div_e ~tags:linear_gen_tags
+          ~pos:Pretty.Infix ~name:"/" ~builtin:Div_e
           "Div_e" [] [Ty.int; Ty.int] Ty.int
       let div_t = Id.const
-          ~pos:Pretty.Infix ~name:"/t"
-          ~builtin:Div_t ~tags:linear_gen_tags
+          ~pos:Pretty.Infix ~name:"/t" ~builtin:Div_t
           "Div_t" [] [Ty.int; Ty.int] Ty.int
       let div_f = Id.const
-          ~pos:Pretty.Infix ~name:"/f"
-          ~builtin:Div_f ~tags:linear_gen_tags
+          ~pos:Pretty.Infix ~name:"/f" ~builtin:Div_f
           "Div_f" [] [Ty.int; Ty.int] Ty.int
 
       let rem_e = Id.const
-          ~pos:Pretty.Infix ~name:"%"
-          ~builtin:Modulo ~tags:linear_gen_tags
+          ~pos:Pretty.Infix ~name:"%" ~builtin:Modulo_e
           "Modulo" [] [Ty.int; Ty.int] Ty.int
       let rem_t = Id.const
-          ~pos:Pretty.Infix ~name:"%"
-          ~builtin:Modulo_t ~tags:linear_gen_tags
+          ~pos:Pretty.Infix ~name:"%e" ~builtin:Modulo_t
           "Modulo" [] [Ty.int; Ty.int] Ty.int
       let rem_f = Id.const
-          ~pos:Pretty.Infix ~name:"%"
-          ~builtin:Modulo_f ~tags:linear_gen_tags
+          ~pos:Pretty.Infix ~name:"%f" ~builtin:Modulo_f
           "Modulo" [] [Ty.int; Ty.int] Ty.int
 
       let abs = Id.const
           ~name:"abs" ~builtin:Abs
-          ~tags:linear_gen_tags
           "Abs" [] [Ty.int] Ty.int
 
       let lt = Id.const
@@ -1328,22 +1509,18 @@ module Term = struct
 
       let floor = Id.const
           ~name:"floor" ~builtin:Floor
-          ~tags:linear_gen_tags
           "Floor" [] [Ty.int] Ty.int
 
       let ceiling = Id.const
           ~name:"ceiling" ~builtin:Ceiling
-          ~tags:linear_gen_tags
           "Ceiling" [] [Ty.int] Ty.int
 
       let truncate = Id.const
           ~name:"truncate" ~builtin:Truncate
-          ~tags:linear_gen_tags
           "Truncate" [] [Ty.int] Ty.int
 
       let round = Id.const
           ~name:"round" ~builtin:Round
-          ~tags:linear_gen_tags
           "Round" [] [Ty.int] Ty.int
 
       let is_int = Id.const
@@ -1355,7 +1532,8 @@ module Term = struct
           "Is_rat" [] [Ty.int] Ty.prop
 
       let divisible = Id.const
-          ~builtin:Divisible "Divisible" [] [Ty.int; Ty.int] Ty.prop
+          ~builtin:Divisible "Divisible"
+          [] [Ty.int; Ty.int] Ty.prop
 
     end
 
@@ -1379,38 +1557,30 @@ module Term = struct
           "Sub" [] [Ty.rat; Ty.rat] Ty.rat
 
       let mul = Id.const
-          ~pos:Pretty.Infix ~name:"*"
-          ~builtin:Mul ~tags:linear_mul_tags
+          ~pos:Pretty.Infix ~name:"*" ~builtin:Mul
           "Mul" [] [Ty.rat; Ty.rat] Ty.rat
 
       let div = Id.const
-          ~pos:Pretty.Infix ~name:"/"
-          ~builtin:Div ~tags:linear_div_tags
+          ~pos:Pretty.Infix ~name:"/" ~builtin:Div
           "Div" [] [Ty.rat; Ty.rat] Ty.rat
       let div_e = Id.const
-          ~pos:Pretty.Infix ~name:"/e"
-          ~builtin:Div_e ~tags:linear_gen_tags
+          ~pos:Pretty.Infix ~name:"/e" ~builtin:Div_e
           "Div_e" [] [Ty.rat; Ty.rat] Ty.rat
       let div_t = Id.const
-          ~pos:Pretty.Infix ~name:"/t"
-          ~builtin:Div_t ~tags:linear_gen_tags
+          ~pos:Pretty.Infix ~name:"/t" ~builtin:Div_t
           "Div_t" [] [Ty.rat; Ty.rat] Ty.rat
       let div_f = Id.const
-          ~pos:Pretty.Infix ~name:"/f"
-          ~builtin:Div_f ~tags:linear_gen_tags
+          ~pos:Pretty.Infix ~name:"/f" ~builtin:Div_f
           "Div_f" [] [Ty.rat; Ty.rat] Ty.rat
 
       let rem_e = Id.const
-          ~pos:Pretty.Infix ~name:"%"
-          ~builtin:Modulo ~tags:linear_gen_tags
+          ~pos:Pretty.Infix ~name:"%" ~builtin:Modulo_e
           "Modulo" [] [Ty.rat; Ty.rat] Ty.rat
       let rem_t = Id.const
-          ~pos:Pretty.Infix ~name:"%"
-          ~builtin:Modulo_t ~tags:linear_gen_tags
+          ~pos:Pretty.Infix ~name:"%" ~builtin:Modulo_t
           "Modulo" [] [Ty.rat; Ty.rat] Ty.rat
       let rem_f = Id.const
-          ~pos:Pretty.Infix ~name:"%"
-          ~builtin:Modulo_f ~tags:linear_gen_tags
+          ~pos:Pretty.Infix ~name:"%" ~builtin:Modulo_f
           "Modulo" [] [Ty.rat; Ty.rat] Ty.rat
 
       let lt = Id.const
@@ -1431,22 +1601,18 @@ module Term = struct
 
       let floor = Id.const
           ~name:"floor" ~builtin:Floor
-          ~tags:linear_gen_tags
           "Floor" [] [Ty.rat] Ty.rat
 
       let ceiling = Id.const
           ~name:"ceiling" ~builtin:Ceiling
-          ~tags:linear_gen_tags
           "Ceiling" [] [Ty.rat] Ty.rat
 
       let truncate = Id.const
           ~name:"truncate" ~builtin:Truncate
-          ~tags:linear_gen_tags
           "Truncate" [] [Ty.rat] Ty.rat
 
       let round = Id.const
           ~name:"round" ~builtin:Round
-          ~tags:linear_gen_tags
           "Round" [] [Ty.rat] Ty.rat
 
       let is_int = Id.const
@@ -1478,38 +1644,31 @@ module Term = struct
           "Sub" [] [Ty.real; Ty.real] Ty.real
 
       let mul = Id.const
-          ~pos:Pretty.Infix ~name:"*"
-          ~builtin:Mul ~tags:linear_mul_tags
+          ~pos:Pretty.Infix ~name:"*" ~builtin:Mul
           "Mul" [] [Ty.real; Ty.real] Ty.real
 
       let div = Id.const
-          ~pos:Pretty.Infix ~name:"/"
-          ~builtin:Div ~tags:linear_div_tags
+          ~pos:Pretty.Infix ~name:"/" ~builtin:Div
           "Div" [] [Ty.real; Ty.real] Ty.real
+
       let div_e = Id.const
-          ~pos:Pretty.Infix ~name:"/"
-          ~builtin:Div_e ~tags:linear_gen_tags
+          ~pos:Pretty.Infix ~name:"/" ~builtin:Div_e
           "Div_e" [] [Ty.real; Ty.real] Ty.real
       let div_t = Id.const
-          ~pos:Pretty.Infix ~name:"/t"
-          ~builtin:Div_t ~tags:linear_gen_tags
+          ~pos:Pretty.Infix ~name:"/t" ~builtin:Div_t
           "Div_t" [] [Ty.real; Ty.real] Ty.real
       let div_f = Id.const
-          ~pos:Pretty.Infix ~name:"/f"
-          ~builtin:Div_f ~tags:linear_gen_tags
+          ~pos:Pretty.Infix ~name:"/f" ~builtin:Div_f
           "Div_f" [] [Ty.real; Ty.real] Ty.real
 
       let rem_e = Id.const
-          ~pos:Pretty.Infix ~name:"%"
-          ~builtin:Modulo ~tags:linear_gen_tags
+          ~pos:Pretty.Infix ~name:"%" ~builtin:Modulo_e
           "Modulo" [] [Ty.real; Ty.real] Ty.real
       let rem_t = Id.const
-          ~pos:Pretty.Infix ~name:"%"
-          ~builtin:Modulo_t ~tags:linear_gen_tags
+          ~pos:Pretty.Infix ~name:"%" ~builtin:Modulo_t
           "Modulo" [] [Ty.real; Ty.real] Ty.real
       let rem_f = Id.const
-          ~pos:Pretty.Infix ~name:"%"
-          ~builtin:Modulo_f ~tags:linear_gen_tags
+          ~pos:Pretty.Infix ~name:"%" ~builtin:Modulo_f
           "Modulo" [] [Ty.real; Ty.real] Ty.real
 
       let lt = Id.const
@@ -1530,22 +1689,18 @@ module Term = struct
 
       let floor = Id.const
           ~name:"floor" ~builtin:Floor
-          ~tags:linear_gen_tags
           "Floor" [] [Ty.real] Ty.real
 
       let ceiling = Id.const
           ~name:"ceiling" ~builtin:Ceiling
-          ~tags:linear_gen_tags
           "Ceiling" [] [Ty.real] Ty.real
 
       let truncate = Id.const
           ~name:"truncate" ~builtin:Truncate
-          ~tags:linear_gen_tags
           "Truncate" [] [Ty.real] Ty.real
 
       let round = Id.const
           ~name:"round" ~builtin:Round
-          ~tags:linear_gen_tags
           "Round" [] [Ty.real] Ty.real
 
       let is_int = Id.const
@@ -1557,197 +1712,210 @@ module Term = struct
           "Is_rat" [] [Ty.real] Ty.prop
     end
 
-    let bitv s =
-      Id.const ~builtin:(Bitvec s)
-        (Format.asprintf "bv#%s#" s) [] [] (Ty.bitv (String.length s))
+    module Bitv = struct
 
-    let bitv_concat =
-      with_cache ~cache:(Hashtbl.create 13) (fun (i, j) ->
-          Id.const ~builtin:Bitv_concat "bitv_concat"
-            [] [Ty.bitv i; Ty.bitv j] (Ty.bitv (i + j))
-        )
+      let bitv s =
+        Id.const ~builtin:(Bitvec s)
+          (Format.asprintf "bv#%s#" s) [] [] (Ty.bitv (String.length s))
 
-    let bitv_extract =
-      with_cache ~cache:(Hashtbl.create 13) (fun (i, j, n) ->
-          Id.const ~builtin:(Bitv_extract (j, i))
-            (Format.asprintf "bitv_extract_%d_%d" i j) []
-            [Ty.bitv n] (Ty.bitv (i - j + 1))
-        )
+      let concat =
+        with_cache ~cache:(Hashtbl.create 13) (fun (i, j) ->
+            Id.const ~builtin:Bitv_concat "bitv_concat"
+              [] [Ty.bitv i; Ty.bitv j] (Ty.bitv (i + j))
+          )
 
-    let bitv_repeat =
-      with_cache ~cache:(Hashtbl.create 13) (fun (k, n) ->
-          Id.const ~builtin:Bitv_repeat (Format.asprintf "bitv_repeat_%d" k)
-            [] [Ty.bitv n] (Ty.bitv (n * k))
-        )
+      let extract =
+        with_cache ~cache:(Hashtbl.create 13) (fun (i, j, n) ->
+            Id.const ~builtin:(Bitv_extract (i, j))
+              (Format.asprintf "bitv_extract_%d_%d" i j) []
+              [Ty.bitv n] (Ty.bitv (i - j + 1))
+          )
 
-    let zero_extend =
-      with_cache ~cache:(Hashtbl.create 13) (fun (k, n) ->
-          Id.const ~builtin:Bitv_zero_extend (Format.asprintf "zero_extend_%d" k)
-            [] [Ty.bitv n] (Ty.bitv (n + k))
-        )
+      let repeat =
+        with_cache ~cache:(Hashtbl.create 13) (fun (k, n) ->
+            Id.const ~builtin:Bitv_repeat (Format.asprintf "bitv_repeat_%d" k)
+              [] [Ty.bitv n] (Ty.bitv (n * k))
+          )
 
-    let sign_extend =
-      with_cache ~cache:(Hashtbl.create 13) (fun (k, n) ->
-          Id.const ~builtin:Bitv_sign_extend (Format.asprintf "sign_extend_%d" k)
-            [] [Ty.bitv n] (Ty.bitv (n + k))
-        )
+      let zero_extend =
+        with_cache ~cache:(Hashtbl.create 13) (fun (k, n) ->
+            Id.const ~builtin:Bitv_zero_extend (Format.asprintf "zero_extend_%d" k)
+              [] [Ty.bitv n] (Ty.bitv (n + k))
+          )
 
-    let rotate_right =
-      with_cache ~cache:(Hashtbl.create 13) (fun (k, n) ->
-          Id.const ~builtin:(Bitv_rotate_right k)
-            (Format.asprintf "rotate_right_%d" k) [] [Ty.bitv n] (Ty.bitv n)
-        )
+      let sign_extend =
+        with_cache ~cache:(Hashtbl.create 13) (fun (k, n) ->
+            Id.const ~builtin:Bitv_sign_extend (Format.asprintf "sign_extend_%d" k)
+              [] [Ty.bitv n] (Ty.bitv (n + k))
+          )
 
-    let rotate_left =
-      with_cache ~cache:(Hashtbl.create 13) (fun (k, n) ->
-          Id.const ~builtin:(Bitv_rotate_left k)
-            (Format.asprintf "rotate_left_%d" k) [] [Ty.bitv n] (Ty.bitv n)
-        )
+      let rotate_right =
+        with_cache ~cache:(Hashtbl.create 13) (fun (k, n) ->
+            Id.const ~builtin:(Bitv_rotate_right k)
+              (Format.asprintf "rotate_right_%d" k) [] [Ty.bitv n] (Ty.bitv n)
+          )
 
-    let bvnot =
-      with_cache ~cache:(Hashtbl.create 13) (fun n ->
-          Id.const ~builtin:Bitv_not "bvnot" [] [Ty.bitv n] (Ty.bitv n)
-        )
+      let rotate_left =
+        with_cache ~cache:(Hashtbl.create 13) (fun (k, n) ->
+            Id.const ~builtin:(Bitv_rotate_left k)
+              (Format.asprintf "rotate_left_%d" k) [] [Ty.bitv n] (Ty.bitv n)
+          )
 
-    let bvand =
-      with_cache ~cache:(Hashtbl.create 13) (fun n ->
-          Id.const ~builtin:Bitv_and "bvand" [] [Ty.bitv n;Ty.bitv n] (Ty.bitv n)
-        )
+      let not =
+        with_cache ~cache:(Hashtbl.create 13) (fun n ->
+            Id.const ~builtin:Bitv_not "bvnot" [] [Ty.bitv n] (Ty.bitv n)
+          )
 
-    let bvor =
-      with_cache ~cache:(Hashtbl.create 13) (fun n ->
-          Id.const ~builtin:Bitv_or "bvor" [] [Ty.bitv n;Ty.bitv n] (Ty.bitv n)
-        )
+      let and_ =
+        with_cache ~cache:(Hashtbl.create 13) (fun n ->
+            Id.const ~builtin:Bitv_and "bvand" []
+              [Ty.bitv n; Ty.bitv n] (Ty.bitv n)
+          )
 
-    let bvnand =
-      with_cache ~cache:(Hashtbl.create 13) (fun n ->
-          Id.const ~builtin:Bitv_nand "bvnand" [] [Ty.bitv n;Ty.bitv n] (Ty.bitv n)
-        )
+      let or_ =
+        with_cache ~cache:(Hashtbl.create 13) (fun n ->
+            Id.const ~builtin:Bitv_or "bvor" []
+              [Ty.bitv n; Ty.bitv n] (Ty.bitv n)
+          )
 
-    let bvnor =
-      with_cache ~cache:(Hashtbl.create 13) (fun n ->
-          Id.const ~builtin:Bitv_nor "bvnor" [] [Ty.bitv n;Ty.bitv n] (Ty.bitv n)
-        )
+      let nand =
+        with_cache ~cache:(Hashtbl.create 13) (fun n ->
+            Id.const ~builtin:Bitv_nand "bvnand" []
+              [Ty.bitv n; Ty.bitv n] (Ty.bitv n)
+          )
 
-    let bvxor =
-      with_cache ~cache:(Hashtbl.create 13) (fun n ->
-          Id.const ~builtin:Bitv_xor "bvxor" [] [Ty.bitv n;Ty.bitv n] (Ty.bitv n)
-        )
+      let nor =
+        with_cache ~cache:(Hashtbl.create 13) (fun n ->
+            Id.const ~builtin:Bitv_nor "bvnor" []
+              [Ty.bitv n; Ty.bitv n] (Ty.bitv n)
+          )
 
-    let bvxnor =
-      with_cache ~cache:(Hashtbl.create 13) (fun n ->
-          Id.const ~builtin:Bitv_xnor "bvxnor" [] [Ty.bitv n;Ty.bitv n] (Ty.bitv n)
-        )
+      let xor =
+        with_cache ~cache:(Hashtbl.create 13) (fun n ->
+            Id.const ~builtin:Bitv_xor "bvxor" []
+              [Ty.bitv n; Ty.bitv n] (Ty.bitv n)
+          )
 
-    let bvcomp =
-      with_cache ~cache:(Hashtbl.create 13) (fun n ->
-          Id.const ~builtin:Bitv_comp "bvcomp" [] [Ty.bitv n; Ty.bitv n] (Ty.bitv 1)
-        )
+      let xnor =
+        with_cache ~cache:(Hashtbl.create 13) (fun n ->
+            Id.const ~builtin:Bitv_xnor "bvxnor" []
+              [Ty.bitv n; Ty.bitv n] (Ty.bitv n)
+          )
 
-    let bvneg =
-      with_cache ~cache:(Hashtbl.create 13) (fun n ->
-          Id.const ~builtin:Bitv_neg "bvneg" [] [Ty.bitv n] (Ty.bitv n)
-        )
+      let comp =
+        with_cache ~cache:(Hashtbl.create 13) (fun n ->
+            Id.const ~builtin:Bitv_comp "bvcomp" []
+              [Ty.bitv n; Ty.bitv n] (Ty.bitv 1)
+          )
 
-    let bvadd =
-      with_cache ~cache:(Hashtbl.create 13) (fun n ->
-          Id.const ~builtin:Bitv_add "bvadd" [] [Ty.bitv n; Ty.bitv n] (Ty.bitv n)
-        )
+      let neg =
+        with_cache ~cache:(Hashtbl.create 13) (fun n ->
+            Id.const ~builtin:Bitv_neg "bvneg" [] [Ty.bitv n] (Ty.bitv n)
+          )
+
+      let add =
+        with_cache ~cache:(Hashtbl.create 13) (fun n ->
+            Id.const ~builtin:Bitv_add "bvadd" [] [Ty.bitv n; Ty.bitv n] (Ty.bitv n)
+          )
 
-    let bvsub =
+      let sub =
       with_cache ~cache:(Hashtbl.create 13) (fun n ->
           Id.const ~builtin:Bitv_sub "bvsub" [] [Ty.bitv n; Ty.bitv n] (Ty.bitv n)
         )
 
-    let bvmul =
-      with_cache ~cache:(Hashtbl.create 13) (fun n ->
-          Id.const ~builtin:Bitv_mul "bvmul" [] [Ty.bitv n; Ty.bitv n] (Ty.bitv n)
-        )
+      let mul =
+        with_cache ~cache:(Hashtbl.create 13) (fun n ->
+            Id.const ~builtin:Bitv_mul "bvmul" [] [Ty.bitv n; Ty.bitv n] (Ty.bitv n)
+          )
 
-    let bvudiv =
-      with_cache ~cache:(Hashtbl.create 13) (fun n ->
-          Id.const ~builtin:Bitv_udiv "bvudiv" [] [Ty.bitv n; Ty.bitv n] (Ty.bitv n)
-        )
+      let udiv =
+        with_cache ~cache:(Hashtbl.create 13) (fun n ->
+            Id.const ~builtin:Bitv_udiv "bvudiv" [] [Ty.bitv n; Ty.bitv n] (Ty.bitv n)
+          )
 
-    let bvurem =
-      with_cache ~cache:(Hashtbl.create 13) (fun n ->
-          Id.const ~builtin:Bitv_urem "bvurem" [] [Ty.bitv n; Ty.bitv n] (Ty.bitv n)
-        )
+      let urem =
+        with_cache ~cache:(Hashtbl.create 13) (fun n ->
+            Id.const ~builtin:Bitv_urem "bvurem" [] [Ty.bitv n; Ty.bitv n] (Ty.bitv n)
+          )
 
-    let bvsdiv =
-      with_cache ~cache:(Hashtbl.create 13) (fun n ->
-          Id.const ~builtin:Bitv_sdiv "bvsdiv" [] [Ty.bitv n; Ty.bitv n] (Ty.bitv n)
-        )
+      let sdiv =
+        with_cache ~cache:(Hashtbl.create 13) (fun n ->
+            Id.const ~builtin:Bitv_sdiv "bvsdiv" [] [Ty.bitv n; Ty.bitv n] (Ty.bitv n)
+          )
 
-    let bvsrem =
-      with_cache ~cache:(Hashtbl.create 13) (fun n ->
-          Id.const ~builtin:Bitv_srem "bvsrem" [] [Ty.bitv n; Ty.bitv n] (Ty.bitv n)
-        )
+      let srem =
+        with_cache ~cache:(Hashtbl.create 13) (fun n ->
+            Id.const ~builtin:Bitv_srem "bvsrem" [] [Ty.bitv n; Ty.bitv n] (Ty.bitv n)
+          )
 
-    let bvsmod =
-      with_cache ~cache:(Hashtbl.create 13) (fun n ->
-          Id.const ~builtin:Bitv_smod "bvsmod" [] [Ty.bitv n; Ty.bitv n] (Ty.bitv n)
-        )
+      let smod =
+        with_cache ~cache:(Hashtbl.create 13) (fun n ->
+            Id.const ~builtin:Bitv_smod "bvsmod" [] [Ty.bitv n; Ty.bitv n] (Ty.bitv n)
+          )
 
-    let bvshl =
-      with_cache ~cache:(Hashtbl.create 13) (fun n ->
-          Id.const ~builtin:Bitv_shl "bvshl" [] [Ty.bitv n; Ty.bitv n] (Ty.bitv n)
-        )
+      let shl =
+        with_cache ~cache:(Hashtbl.create 13) (fun n ->
+            Id.const ~builtin:Bitv_shl "bvshl" [] [Ty.bitv n; Ty.bitv n] (Ty.bitv n)
+          )
 
-    let bvlshr =
-      with_cache ~cache:(Hashtbl.create 13) (fun n ->
-          Id.const ~builtin:Bitv_lshr "bvlshr" [] [Ty.bitv n; Ty.bitv n] (Ty.bitv n)
-        )
+      let lshr =
+        with_cache ~cache:(Hashtbl.create 13) (fun n ->
+            Id.const ~builtin:Bitv_lshr "bvlshr" [] [Ty.bitv n; Ty.bitv n] (Ty.bitv n)
+          )
 
-    let bvashr =
-      with_cache ~cache:(Hashtbl.create 13) (fun n ->
-          Id.const ~builtin:Bitv_ashr "bvashr" [] [Ty.bitv n; Ty.bitv n] (Ty.bitv n)
-        )
+      let ashr =
+        with_cache ~cache:(Hashtbl.create 13) (fun n ->
+            Id.const ~builtin:Bitv_ashr "bvashr" [] [Ty.bitv n; Ty.bitv n] (Ty.bitv n)
+          )
 
-    let bvult =
-      with_cache ~cache:(Hashtbl.create 13) (fun n ->
-          Id.const ~builtin:Bitv_ult "bvult" [] [Ty.bitv n; Ty.bitv n] Ty.prop
-        )
+      let ult =
+        with_cache ~cache:(Hashtbl.create 13) (fun n ->
+            Id.const ~builtin:Bitv_ult "bvult" [] [Ty.bitv n; Ty.bitv n] Ty.prop
+          )
 
-    let bvule =
-      with_cache ~cache:(Hashtbl.create 13) (fun n ->
-          Id.const ~builtin:Bitv_ule "bvule" [] [Ty.bitv n; Ty.bitv n] Ty.prop
-        )
+      let ule =
+        with_cache ~cache:(Hashtbl.create 13) (fun n ->
+            Id.const ~builtin:Bitv_ule "bvule" [] [Ty.bitv n; Ty.bitv n] Ty.prop
+          )
 
-    let bvugt =
-      with_cache ~cache:(Hashtbl.create 13) (fun n ->
-          Id.const ~builtin:Bitv_ugt "bvugt" [] [Ty.bitv n; Ty.bitv n] Ty.prop
-        )
+      let ugt =
+        with_cache ~cache:(Hashtbl.create 13) (fun n ->
+            Id.const ~builtin:Bitv_ugt "bvugt" [] [Ty.bitv n; Ty.bitv n] Ty.prop
+          )
 
-    let bvuge =
-      with_cache ~cache:(Hashtbl.create 13) (fun n ->
-          Id.const ~builtin:Bitv_uge "bvsge" [] [Ty.bitv n; Ty.bitv n] Ty.prop
-        )
+      let uge =
+        with_cache ~cache:(Hashtbl.create 13) (fun n ->
+            Id.const ~builtin:Bitv_uge "bvsge" [] [Ty.bitv n; Ty.bitv n] Ty.prop
+          )
 
-    let bvslt =
-      with_cache ~cache:(Hashtbl.create 13) (fun n ->
-          Id.const ~builtin:Bitv_slt "bvslt" [] [Ty.bitv n; Ty.bitv n] Ty.prop
-        )
+      let slt =
+        with_cache ~cache:(Hashtbl.create 13) (fun n ->
+            Id.const ~builtin:Bitv_slt "bvslt" [] [Ty.bitv n; Ty.bitv n] Ty.prop
+          )
 
-    let bvsle =
-      with_cache ~cache:(Hashtbl.create 13) (fun n ->
-          Id.const ~builtin:Bitv_sle "bvsle" [] [Ty.bitv n; Ty.bitv n] Ty.prop
-        )
+      let sle =
+        with_cache ~cache:(Hashtbl.create 13) (fun n ->
+            Id.const ~builtin:Bitv_sle "bvsle" [] [Ty.bitv n; Ty.bitv n] Ty.prop
+          )
 
-    let bvsgt =
-      with_cache ~cache:(Hashtbl.create 13) (fun n ->
-          Id.const ~builtin:Bitv_sgt "bvsgt" [] [Ty.bitv n; Ty.bitv n] Ty.prop
-        )
+      let sgt =
+        with_cache ~cache:(Hashtbl.create 13) (fun n ->
+            Id.const ~builtin:Bitv_sgt "bvsgt" [] [Ty.bitv n; Ty.bitv n] Ty.prop
+          )
 
-    let bvsge =
-      with_cache ~cache:(Hashtbl.create 13) (fun n ->
-          Id.const ~builtin:Bitv_sge "bvsge" [] [Ty.bitv n; Ty.bitv n] Ty.prop
-        )
+      let sge =
+        with_cache ~cache:(Hashtbl.create 13) (fun n ->
+            Id.const ~builtin:Bitv_sge "bvsge" [] [Ty.bitv n; Ty.bitv n] Ty.prop
+          )
+
+    end
 
     module Float = struct
+
       let fp =
-        with_cache ~cache:(Hashtbl.create 13) (fun (e,s) ->
-            Id.const ~builtin:(Fp (e,s)) "fp" [] [Ty.bitv 1; Ty.bitv e; Ty.bitv (s-1)] (Ty.float e s)
+        with_cache ~cache:(Hashtbl.create 13) (fun (e, s) ->
+            Id.const ~builtin:(Fp(e, s)) "fp" []
+              [Ty.bitv 1; Ty.bitv e; Ty.bitv (s-1)] (Ty.float e s)
           )
 
       let roundNearestTiesToEven =
@@ -1773,7 +1941,11 @@ module Term = struct
             let fp = Ty.float' es in
             let args = List.init args (fun _ -> fp) in
             let args = match rm with None -> args | Some () -> Ty.roundingMode::args in
-            let res = match res with | None -> fp | Some res -> res in
+            let res =
+              match res with
+              | Some res -> res
+              | None -> fp
+            in
             Id.const ~builtin:(builtin es) name [] args res
           )
 
@@ -1782,37 +1954,37 @@ module Term = struct
       let plus_zero = fp_gen_fun ~args:0 "plus_zero" (fun (e,s) -> Plus_zero (e,s))
       let minus_zero = fp_gen_fun ~args:0 "minus_zero" (fun (e,s) -> Minus_zero (e,s))
       let nan = fp_gen_fun ~args:0 "nan" (fun (e,s) -> NaN (e,s))
-      let fp_abs = fp_gen_fun ~args:1 "fp.abs" (fun (e,s) -> Fp_abs (e,s))
-      let fp_neg = fp_gen_fun ~args:1 "fp.neg" (fun (e,s) -> Fp_neg (e,s))
-      let fp_add = fp_gen_fun ~args:2 ~rm:() "fp.add" (fun (e,s) -> Fp_add (e,s))
-      let fp_sub = fp_gen_fun ~args:2 ~rm:() "fp.sub" (fun (e,s) -> Fp_sub (e,s))
-      let fp_mul = fp_gen_fun ~args:2 ~rm:() "fp.mul" (fun (e,s) -> Fp_mul (e,s))
-      let fp_div = fp_gen_fun ~args:2 ~rm:() "fp.div" (fun (e,s) -> Fp_div (e,s))
-      let fp_fma = fp_gen_fun ~args:3 ~rm:() "fp.fma" (fun (e,s) -> Fp_fma (e,s))
-      let fp_sqrt = fp_gen_fun ~args:1 ~rm:() "fp.sqrt" (fun (e,s) -> Fp_sqrt (e,s))
-      let fp_rem = fp_gen_fun ~args:2 "fp.rem" (fun (e,s) -> Fp_rem (e,s))
-      let fp_roundToIntegral = fp_gen_fun ~args:1 ~rm:() "fp.roundToIntegral" (fun (e,s) -> Fp_roundToIntegral (e,s))
-      let fp_min = fp_gen_fun ~args:2 "fp.min" (fun (e,s) -> Fp_min (e,s))
-      let fp_max = fp_gen_fun ~args:2 "fp.max" (fun (e,s) -> Fp_max (e,s))
-      let fp_leq = fp_gen_fun ~args:2 ~res:Ty.prop "fp.leq" (fun (e,s) -> Fp_leq (e,s))
-      let fp_lt = fp_gen_fun ~args:2 ~res:Ty.prop "fp.lt" (fun (e,s) -> Fp_lt (e,s))
-      let fp_geq = fp_gen_fun ~args:2 ~res:Ty.prop "fp.geq" (fun (e,s) -> Fp_geq (e,s))
-      let fp_gt = fp_gen_fun ~args:2 ~res:Ty.prop "fp.gt" (fun (e,s) -> Fp_gt (e,s))
-      let fp_eq = fp_gen_fun ~args:2 ~res:Ty.prop "fp.eq" (fun (e,s) -> Fp_eq (e,s))
-      let fp_isNormal = fp_gen_fun ~args:1 ~res:Ty.prop "fp.isnormal" (fun (e,s) -> Fp_isNormal (e,s))
-      let fp_isSubnormal = fp_gen_fun ~args:1 ~res:Ty.prop "fp.issubnormal" (fun (e,s) -> Fp_isSubnormal (e,s))
-      let fp_isZero = fp_gen_fun ~args:1 ~res:Ty.prop "fp.iszero" (fun (e,s) -> Fp_isZero (e,s))
-      let fp_isInfinite = fp_gen_fun ~args:1 ~res:Ty.prop "fp.isinfinite" (fun (e,s) -> Fp_isInfinite (e,s))
-      let fp_isNaN = fp_gen_fun ~args:1 ~res:Ty.prop "fp.isnan" (fun (e,s) -> Fp_isNaN (e,s))
-      let fp_isNegative = fp_gen_fun ~args:1 ~res:Ty.prop "fp.isnegative" (fun (e,s) -> Fp_isNegative (e,s))
-      let fp_isPositive = fp_gen_fun ~args:1 ~res:Ty.prop "fp.ispositive" (fun (e,s) -> Fp_isPositive (e,s))
+      let abs = fp_gen_fun ~args:1 "fp.abs" (fun (e,s) -> Fp_abs (e,s))
+      let neg = fp_gen_fun ~args:1 "fp.neg" (fun (e,s) -> Fp_neg (e,s))
+      let add = fp_gen_fun ~args:2 ~rm:() "fp.add" (fun (e,s) -> Fp_add (e,s))
+      let sub = fp_gen_fun ~args:2 ~rm:() "fp.sub" (fun (e,s) -> Fp_sub (e,s))
+      let mul = fp_gen_fun ~args:2 ~rm:() "fp.mul" (fun (e,s) -> Fp_mul (e,s))
+      let div = fp_gen_fun ~args:2 ~rm:() "fp.div" (fun (e,s) -> Fp_div (e,s))
+      let fma = fp_gen_fun ~args:3 ~rm:() "fp.fma" (fun (e,s) -> Fp_fma (e,s))
+      let sqrt = fp_gen_fun ~args:1 ~rm:() "fp.sqrt" (fun (e,s) -> Fp_sqrt (e,s))
+      let rem = fp_gen_fun ~args:2 "fp.rem" (fun (e,s) -> Fp_rem (e,s))
+      let roundToIntegral = fp_gen_fun ~args:1 ~rm:() "fp.roundToIntegral" (fun (e,s) -> Fp_roundToIntegral (e,s))
+      let min = fp_gen_fun ~args:2 "fp.min" (fun (e,s) -> Fp_min (e,s))
+      let max = fp_gen_fun ~args:2 "fp.max" (fun (e,s) -> Fp_max (e,s))
+      let leq = fp_gen_fun ~args:2 ~res:Ty.prop "fp.leq" (fun (e,s) -> Fp_leq (e,s))
+      let lt = fp_gen_fun ~args:2 ~res:Ty.prop "fp.lt" (fun (e,s) -> Fp_lt (e,s))
+      let geq = fp_gen_fun ~args:2 ~res:Ty.prop "fp.geq" (fun (e,s) -> Fp_geq (e,s))
+      let gt = fp_gen_fun ~args:2 ~res:Ty.prop "fp.gt" (fun (e,s) -> Fp_gt (e,s))
+      let eq = fp_gen_fun ~args:2 ~res:Ty.prop "fp.eq" (fun (e,s) -> Fp_eq (e,s))
+      let isNormal = fp_gen_fun ~args:1 ~res:Ty.prop "fp.isnormal" (fun (e,s) -> Fp_isNormal (e,s))
+      let isSubnormal = fp_gen_fun ~args:1 ~res:Ty.prop "fp.issubnormal" (fun (e,s) -> Fp_isSubnormal (e,s))
+      let isZero = fp_gen_fun ~args:1 ~res:Ty.prop "fp.iszero" (fun (e,s) -> Fp_isZero (e,s))
+      let isInfinite = fp_gen_fun ~args:1 ~res:Ty.prop "fp.isinfinite" (fun (e,s) -> Fp_isInfinite (e,s))
+      let isNaN = fp_gen_fun ~args:1 ~res:Ty.prop "fp.isnan" (fun (e,s) -> Fp_isNaN (e,s))
+      let isNegative = fp_gen_fun ~args:1 ~res:Ty.prop "fp.isnegative" (fun (e,s) -> Fp_isNegative (e,s))
+      let isPositive = fp_gen_fun ~args:1 ~res:Ty.prop "fp.ispositive" (fun (e,s) -> Fp_isPositive (e,s))
       let to_real = fp_gen_fun ~args:1 ~res:Ty.real "fp.to_real" (fun (e,s) -> To_real (e,s))
 
       let ieee_format_to_fp =
         with_cache ~cache:(Hashtbl.create 13) (fun ((e,s) as es) ->
             Id.const ~builtin:(Ieee_format_to_fp (e,s)) "to_fp" [] [Ty.bitv (e+s)] (Ty.float' es)
           )
-      let fp_to_fp =
+      let to_fp =
         with_cache ~cache:(Hashtbl.create 13) (fun (e1,s1,e2,s2) ->
             Id.const ~builtin:(Fp_to_fp (e1,s1,e2,s2)) "to_fp" [] [Ty.roundingMode;Ty.float e1 s1] (Ty.float e2 s2)
           )
@@ -1830,14 +2002,141 @@ module Term = struct
           )
       let to_ubv =
         with_cache ~cache:(Hashtbl.create 13) (fun (e,s,bv) ->
-            Id.const ~builtin:(To_ubv (e,s,bv)) "fp.to_ubv" [] [Ty.roundingMode;Ty.float e s] (Ty.bitv bv)
+            Id.const ~builtin:(To_ubv (bv,e,s)) "fp.to_ubv" [] [Ty.roundingMode;Ty.float e s] (Ty.bitv bv)
           )
       let to_sbv =
         with_cache ~cache:(Hashtbl.create 13) (fun (e,s,bv) ->
-            Id.const ~builtin:(To_sbv (e,s,bv)) "fp.to_sbv" [] [Ty.roundingMode;Ty.float e s] (Ty.bitv bv)
+            Id.const ~builtin:(To_sbv (bv,e,s)) "fp.to_sbv" [] [Ty.roundingMode;Ty.float e s] (Ty.bitv bv)
+          )
+
+    end
+
+    module String = struct
+
+      let string =
+        with_cache ~cache:(Hashtbl.create 13) (fun s ->
+            Id.const ~builtin:(Str s) (Format.asprintf {|"%s"|} s) [] [] Ty.string
           )
 
+      let length =
+        Id.const ~builtin:Str_length "length"
+          [] [Ty.string] Ty.int
+      let at =
+        Id.const ~builtin:Str_at "at"
+          [] [Ty.string; Ty.int] Ty.string
+      let to_code =
+        Id.const ~builtin:Str_to_code "to_code"
+          [] [Ty.string] Ty.int
+      let of_code =
+        Id.const ~builtin:Str_of_code "of_code"
+          [] [Ty.int] Ty.string
+      let is_digit =
+        Id.const ~builtin:Str_is_digit "is_digit"
+          [] [Ty.string] Ty.prop
+      let to_int =
+        Id.const ~builtin:Str_to_int "to_int"
+          [] [Ty.string] Ty.int
+      let of_int =
+        Id.const ~builtin:Str_of_int "of_int"
+          [] [Ty.int] Ty.string
+      let concat =
+        Id.const ~builtin:Str_concat ~pos:Pretty.Infix "++"
+          [] [Ty.string; Ty.string] Ty.string
+      let sub =
+        Id.const ~builtin:Str_sub "sub"
+          [] [Ty.string; Ty.int; Ty.int] Ty.string
+      let index_of =
+        Id.const ~builtin:Str_index_of "index_of"
+          [] [Ty.string; Ty.string; Ty.int] Ty.int
+      let replace =
+        Id.const ~builtin:Str_replace "replace"
+          [] [Ty.string; Ty.string; Ty.string] Ty.string
+      let replace_all =
+        Id.const ~builtin:Str_replace_all "replace_all"
+          [] [Ty.string; Ty.string; Ty.string] Ty.string
+      let replace_re =
+        Id.const ~builtin:Str_replace_re "replace_re"
+          [] [Ty.string; Ty.string_reg_lang; Ty.string] Ty.string
+      let replace_re_all =
+        Id.const ~builtin:Str_replace_re_all "replace_re_all"
+          [] [Ty.string; Ty.string_reg_lang; Ty.string] Ty.string
+      let is_prefix =
+        Id.const ~builtin:Str_is_prefix "is_prefix"
+          [] [Ty.string; Ty.string] Ty.prop
+      let is_suffix =
+        Id.const ~builtin:Str_is_suffix "is_suffix"
+          [] [Ty.string; Ty.string] Ty.prop
+      let contains =
+        Id.const ~builtin:Str_contains "contains"
+          [] [Ty.string; Ty.string] Ty.prop
+      let lt =
+        Id.const ~builtin:Str_lexicographic_strict
+          ~pos:Pretty.Infix "lt"
+          [] [Ty.string; Ty.string] Ty.prop
+      let leq =
+        Id.const ~builtin:Str_lexicographic_large
+          ~pos:Pretty.Infix "leq"
+          [] [Ty.string; Ty.string] Ty.prop
+      let in_re =
+        Id.const ~builtin:Str_in_re "in_re"
+          [] [Ty.string; Ty.string_reg_lang] Ty.prop
+
+      module Reg_Lang = struct
+
+        let empty =
+          Id.const ~builtin:Re_empty "empty"
+            [] [] Ty.string_reg_lang
+        let all =
+          Id.const ~builtin:Re_all "all"
+            [] [] Ty.string_reg_lang
+        let allchar =
+          Id.const ~builtin:Re_allchar "allchar"
+            [] [] Ty.string_reg_lang
+        let of_string =
+          Id.const ~builtin:Re_of_string "of_string"
+            [] [Ty.string] Ty.string_reg_lang
+        let range =
+          Id.const ~builtin:Re_range "range"
+            [] [Ty.string; Ty.string] Ty.string_reg_lang
+        let concat =
+          Id.const ~builtin:Re_concat ~pos:Pretty.Infix "++"
+            [] [Ty.string_reg_lang; Ty.string_reg_lang] Ty.string_reg_lang
+        let union =
+          Id.const ~builtin:Re_union ~pos:Pretty.Infix "∪"
+            [] [Ty.string_reg_lang; Ty.string_reg_lang] Ty.string_reg_lang
+        let inter =
+          Id.const ~builtin:Re_inter ~pos:Pretty.Infix "∩"
+            [] [Ty.string_reg_lang; Ty.string_reg_lang] Ty.string_reg_lang
+        let diff =
+          Id.const ~builtin:Re_diff ~pos:Pretty.Infix "-"
+            [] [Ty.string_reg_lang; Ty.string_reg_lang] Ty.string_reg_lang
+        let star =
+          Id.const ~builtin:Re_star ~pos:Pretty.Prefix "*"
+            [] [Ty.string_reg_lang] Ty.string_reg_lang
+        let cross =
+          Id.const ~builtin:Re_cross ~pos:Pretty.Prefix "+"
+            [] [Ty.string_reg_lang] Ty.string_reg_lang
+        let complement =
+          Id.const ~builtin:Re_complement "complement"
+            [] [Ty.string_reg_lang] Ty.string_reg_lang
+        let option =
+          Id.const ~builtin:Re_option "option"
+            [] [Ty.string_reg_lang] Ty.string_reg_lang
+        let power =
+          with_cache ~cache:(Hashtbl.create 13) (fun n ->
+              Id.const ~builtin:(Re_power n) (Format.asprintf "power_%d" n)
+                [] [Ty.string_reg_lang] Ty.string_reg_lang
+            )
+        let loop =
+          with_cache ~cache:(Hashtbl.create 13) (fun (n1, n2) ->
+              Id.const ~builtin:(Re_loop (n1, n2)) (Format.asprintf "loop_%d_%d" n1 n2)
+                [] [Ty.string_reg_lang] Ty.string_reg_lang
+            )
+
+      end
+
     end
+
   end
 
   (* Constructors are simply constants *)
@@ -1848,10 +2147,33 @@ module Term = struct
     let equal = Id.equal
     let compare = Id.compare
     let get_tag = Id.get_tag
-    let mk ty_c name i vars args ret =
-      Id.const ~builtin:(Constructor (ty_c, i)) name vars args ret
+    let get_tag_last = Id.get_tag_last
     let arity (c : t) =
       List.length c.ty.fun_vars, List.length c.ty.fun_args
+
+    let tester c =
+      match c.builtin with
+      | Constructor { adt; case; } ->
+        begin match Ty.definition adt with
+          | Some Adt { cases; _ } -> cases.(case).tester
+          | _ -> assert false
+        end
+      | _ -> raise (Constructor_expected c)
+
+    let void =
+      match define_adt Ty.Const.unit [] ["void", []] with
+      | [void, _] -> void
+      | _ -> assert false
+
+    let pattern_arity (c : t) ret tys =
+      try
+        let s = List.fold_left2 Subst.Var.bind Subst.empty c.ty.fun_vars tys in
+        let s = Ty.robinson s c.ty.fun_ret ret in
+        List.map (Ty.subst s) c.ty.fun_args
+      with
+      | Ty.Impossible_unification _ -> raise (Wrong_sum_type (c, ret))
+      | Invalid_argument _ -> raise (Bad_term_arity (c, tys, []))
+
   end
 
   (* Record fields are represented as their destructors, i.e. constants *)
@@ -1859,49 +2181,33 @@ module Term = struct
     type t = term_const
     let hash = Id.hash
     let equal = Id.equal
-  end
+    let compare = Id.compare
 
-  (* ADT definition *)
-  let define_adt_aux ~record ty_const vars l =
-    let ty =  Ty.apply ty_const (List.map Ty.of_var vars) in
-    let cases = ref [] in
-    let l' = List.mapi (fun i (cstr_name, args) ->
-        let args_ty = List.map fst args in
-        let cstr = Cstr.mk ty_const cstr_name i vars args_ty ty in
-        let dstrs = Array.make (List.length args) None in
-        let l' = List.mapi (fun j -> function
-            | (arg_ty, None) -> (arg_ty, None)
-            | (arg_ty, Some name) ->
-              let dstr =
-                Id.const
-                  ~builtin:(Destructor (ty_const, cstr, i, j))
-                  name vars [ty] arg_ty
-              in
-              dstrs.(i) <- Some dstr;
-              (arg_ty, Some dstr)
-          ) args in
-        cases := { Ty.cstr; dstrs; } :: !cases;
-        cstr, l'
-      ) l in
-    assert (not record || List.length !cases = 1);
-    Ty.define ty_const (Adt { ty = ty_const; record; cstrs = List.rev !cases; });
-    l'
+    (* Record field getter *)
+    let find ty_c i =
+      match Ty.definition ty_c with
+      | Some Adt { record = true; cases = [| { dstrs; _ } |]; _ } ->
+        begin match dstrs.(i) with
+          | Some c -> c
+          | None -> assert false
+        end
+      | _ ->
+        raise (Record_type_expected ty_c)
+
+    (* Record creation *)
+    let index ty_c f =
+      match f.builtin with
+      | Destructor { adt = ty_d; case = i; field = j; _ } ->
+        if Id.equal ty_c ty_d then begin
+          assert (i = 0);
+          j
+        end else
+          raise (Wrong_record_type (f, ty_c))
+      | _ ->
+        raise (Field_expected f)
 
-  let define_adt = define_adt_aux ~record:false
+  end
 
-  let define_record ty_const vars l =
-    let name = ty_const.name in
-    let cstr_args = List.map (fun (field_name, ty) ->
-        ty, Some field_name
-      ) l in
-    let l' = define_adt_aux ~record:true ty_const vars [name, cstr_args] in
-    match l' with
-    | [ _, l'' ] ->
-      List.map (function
-          | _, Some dstr -> dstr
-          | _, None -> assert false
-        ) l''
-    | _ -> assert false
 
   (* Filter check *)
   let rec check_filters res f tys args = function
@@ -1910,7 +2216,7 @@ module Term = struct
       if !active then match (check f tys args) with
         | `Pass -> check_filters res f tys args r
         | `Warn -> check_filters res f tys args r
-        | `Error -> raise (Filter_failed_term (name, res))
+        | `Error msg -> raise (Filter_failed_term (name, res, msg))
       else
         check_filters res f tys args r
 
@@ -1920,13 +2226,8 @@ module Term = struct
   let of_var v = mk (Var v) v.ty
 
   (* This function does not check types enough, do not export outside the module *)
-  let bind b body =
-    let res = mk (Binder (b, body)) (ty body) in
-    match !Filter.Quantifier.allow, b with
-    | true, _
-    | _, (Letin _) -> res
-    | false, (Exists _ | Forall _) ->
-      raise (Filter_failed_term (Filter.Quantifier.name, res))
+  let mk_bind b body =
+    mk (Binder (b, body)) (ty body)
 
   (* Substitutions *)
   let rec ty_var_list_subst ty_var_map = function
@@ -1963,7 +2264,11 @@ module Term = struct
       else apply f new_tys new_args
     | Binder (b, body) ->
       let b', ty_var_map, t_var_map = binder_subst ~fix ty_var_map t_var_map b in
-      bind b' (subst_aux ~fix ty_var_map t_var_map body)
+      mk_bind b' (subst_aux ~fix ty_var_map t_var_map body)
+    | Match (scrutinee, branches) ->
+      let scrutinee = subst_aux ~fix ty_var_map t_var_map scrutinee in
+      let branches = List.map (branch_subst ~fix ty_var_map t_var_map) branches in
+      pattern_match scrutinee branches
 
   and binder_subst ~fix ty_var_map t_var_map = function
     | Exists (tys, ts) ->
@@ -1995,6 +2300,12 @@ module Term = struct
         binding_list_subst ~fix ty_var_map t_var_map acc r
       end
 
+  and branch_subst ~fix ty_var_map t_var_map (pattern, body) =
+    let _, l = fv pattern in
+    let _, t_var_map = term_var_list_subst ty_var_map t_var_map [] l in
+    (subst_aux ~fix ty_var_map t_var_map pattern,
+     subst_aux ~fix ty_var_map t_var_map body)
+
   and subst ?(fix=true) ty_var_map t_var_map t =
     if Subst.is_empty ty_var_map && Subst.is_empty t_var_map then
       t
@@ -2004,28 +2315,57 @@ module Term = struct
   (* Application typechecking *)
   and instantiate (f : term_const) tys args =
     if List.length f.ty.fun_vars <> List.length tys ||
-       List.length f.ty.fun_args <> List.length args then
+       List.length f.ty.fun_args <> List.length args then begin
       raise (Bad_term_arity (f, tys, args))
-    else begin
+    end else begin
       let map = List.fold_left2 Subst.Var.bind Subst.empty f.ty.fun_vars tys in
-      let expected_types = List.map (Ty.subst map) f.ty.fun_args in
       let s = List.fold_left2 (fun s expected term ->
           try Ty.robinson s expected (ty term)
-          with Ty.Impossible_unification _ -> raise (Wrong_type (term, expected))
-        ) map expected_types args
+          with Ty.Impossible_unification _ ->
+            raise (Wrong_type (term, Ty.subst s expected))
+        ) map f.ty.fun_args args
       in
-      let actual_ty_args = List.map (Ty.subst s) tys in
-      let actual_args = List.map (subst s Subst.empty) args in
-      actual_ty_args, actual_args, Ty.subst s f.ty.fun_ret
+      Subst.iter Ty.set_wildcard s;
+      Ty.subst s f.ty.fun_ret
     end
 
   (* Application *)
   and apply f tys args =
-    let tys, args, ret = instantiate f tys args in
+    let ret = instantiate f tys args in
     let res = mk (App (f, tys, args)) ret in
-    match Const.get_tag f Filter.term with
-    | None -> res
-    | Some l -> check_filters res f tys args l
+    check_filters res f tys args (Const.get_tag f Filter.term)
+
+  (* Pattern matching *)
+  and pattern_match scrutinee branches =
+    let scrutinee_ty = ty scrutinee in
+    (* first,
+       unify the type of the scrutinee and all patterns,
+       and unify the type of all bodies *)
+    let body_ty = Ty.wildcard () in
+    let s = List.fold_left (fun acc (pattern, body) ->
+        let acc =
+          try Ty.robinson acc scrutinee_ty (ty pattern)
+          with Ty.Impossible_unification _ -> raise (Wrong_type (pattern, scrutinee_ty))
+        in
+        let acc =
+          try Ty.robinson acc body_ty (ty body)
+          with Ty.Impossible_unification _ -> raise (Wrong_type (body, body_ty))
+        in
+        acc
+      ) Subst.empty branches
+    in
+    (* Apply the substitution to the scrutinee, patterns and bodies *)
+    let scrutinee = subst s Subst.empty scrutinee in
+    let branches = List.map (fun (pat, body) ->
+        (subst s Subst.empty pat, subst s Subst.empty body)
+      ) branches in
+    (* Check exhaustivity *)
+    let () = check_exhaustivity (ty scrutinee) (List.map fst branches) in
+    (* Build the pattern matching *)
+    mk (Match (scrutinee, branches)) (Ty.subst s body_ty)
+
+
+  (* Wrappers around application *)
 
   let apply_cstr = apply
 
@@ -2036,39 +2376,26 @@ module Term = struct
     in
     apply f tys [t]
 
-  (* Record field getter *)
-  let record_field ty_c i =
-    match Ty.definition ty_c with
-    | Some Adt { record = true; cstrs = [ { dstrs; _ } ]; _ } ->
-      begin match dstrs.(i) with
-        | Some c -> c
-        | None -> assert false
-      end
-    | _ ->
-      raise (Record_type_expected ty_c)
-
-  (* Record creation *)
-  let record_field_id ty_c f =
-    match f.builtin with
-    | Destructor (ty_d, _, i, j) ->
-      if Id.equal ty_c ty_d then begin
-        assert (i = 0);
-        j
-      end else
-        raise (Wrong_record_type (f, ty_c))
-    | _ ->
-      raise (Field_expected f)
+  (* ADT constructor tester *)
+  let cstr_tester c t =
+    let tester = Cstr.tester c in
+    let ty_args = init_list
+        (List.length tester.ty.fun_vars)
+        (fun _ -> Ty.wildcard ())
+    in
+    apply tester ty_args [t]
 
+  (* Recor creation *)
   let build_record_fields ty_c l =
     let n =
       match Ty.definition ty_c with
-      | Some Adt { record = true; cstrs = [ { dstrs; _ } ]; _ } ->
+      | Some Adt { record = true; cases = [| { dstrs; _ } |]; _ } ->
         Array.length dstrs
       | _ -> raise (Record_type_expected ty_c)
     in
     let fields = Array.make n None in
     List.iter (fun (field, value) ->
-        let i = record_field_id ty_c field in
+        let i = Field.index ty_c field in
         match fields.(i) with
         | Some _ -> raise (Field_repeated field)
         | None -> fields.(i) <- Some value
@@ -2079,7 +2406,7 @@ module Term = struct
     | [] -> raise (Invalid_argument "Dolmen.Expr.record")
     | ((f, _) :: _) as l ->
       begin match f.builtin with
-        | Destructor (ty_c, c, _, _) when Ty.is_record ty_c ->
+        | Destructor { adt = ty_c; cstr = c; _ } when Ty.is_record ty_c ->
           let fields = build_record_fields ty_c l in
           (* Check that all fields are indeed present, and create the list
              of term arguments *)
@@ -2099,13 +2426,13 @@ module Term = struct
       end
 
   let record l =
-    mk_record (fun ty_c i -> raise (Field_missing (record_field ty_c i))) l
+    mk_record (fun ty_c i -> raise (Field_missing (Field.find ty_c i))) l
 
   let record_with t = function
     | [] -> t
     | l ->
       let aux ty_c i =
-        let f = record_field ty_c i in
+        let f = Field.find ty_c i in
         apply_field f t
       in
       mk_record aux l
@@ -2123,6 +2450,8 @@ module Term = struct
     apply Const.coerce [src_ty; dst_ty] [t]
 
   (* Common constructions *)
+  let void = apply Cstr.void [] []
+
   let _true = apply Const._true [] []
   let _false = apply Const._false [] []
 
@@ -2158,7 +2487,7 @@ module Term = struct
 
   (* arithmetic *)
   module Int = struct
-    let int = int
+    let mk = int
     let minus t = apply Const.Int.minus [] [t]
     let add a b = apply Const.Int.add [] [a; b]
     let sub a b = apply Const.Int.sub [] [a; b]
@@ -2189,6 +2518,7 @@ module Term = struct
   end
 
   module Rat = struct
+    (* let mk = rat *)
     let minus t = apply Const.Rat.minus [] [t]
     let add a b = apply Const.Rat.add [] [a; b]
     let sub a b = apply Const.Rat.sub [] [a; b]
@@ -2216,7 +2546,7 @@ module Term = struct
   end
 
   module Real = struct
-    let real = real
+    let mk = real
     let minus t = apply Const.Real.minus [] [t]
     let add a b = apply Const.Real.add [] [a; b]
     let sub a b = apply Const.Real.sub [] [a; b]
@@ -2265,166 +2595,158 @@ module Term = struct
     let src, dst = match_array_type t in
     apply Const.store [src; dst] [t; idx; value]
 
-  let const value =
-    apply Const.const [Ty.wildcard (); ty value] [value]
-
   (* Bitvectors *)
-  let match_bitv_type t =
-    match ty t with
-    | { descr = App ({ builtin = Bitv i; _ }, _); _ } -> i
-    | _ -> raise (Wrong_type (t, Ty.bitv 0))
+  module Bitv = struct
+    let match_bitv_type t =
+      match ty t with
+      | { descr = App ({ builtin = Bitv i; _ }, _); _ } -> i
+      | _ -> raise (Wrong_type (t, Ty.bitv 0))
+
+    let mk s = apply (Const.Bitv.bitv s) [] []
+
+    let concat u v =
+      let i = match_bitv_type u in
+      let j = match_bitv_type v in
+      apply (Const.Bitv.concat (i, j)) [] [u; v]
+
+    let extract i j t =
+      let n = match_bitv_type t in
+      (* TODO: check that i and j are correct index for a bitv(n) *)
+      apply (Const.Bitv.extract (i, j, n)) [] [t]
+
+    let repeat k t =
+      let n = match_bitv_type t in
+      apply (Const.Bitv.repeat (k, n)) [] [t]
+
+    let zero_extend k t =
+      let n = match_bitv_type t in
+      apply (Const.Bitv.zero_extend (k, n)) [] [t]
+
+    let sign_extend k t =
+      let n = match_bitv_type t in
+      apply (Const.Bitv.sign_extend (k, n)) [] [t]
 
-  let mk_bitv s = apply (Const.bitv s) [] []
+    let rotate_right k t =
+      let n = match_bitv_type t in
+      apply (Const.Bitv.rotate_right (k, n)) [] [t]
 
-  let bitv_concat u v =
-    let i = match_bitv_type u in
-    let j = match_bitv_type v in
-    apply (Const.bitv_concat (i, j)) [] [u; v]
-
-  let bitv_extract i j t =
-    let n = match_bitv_type t in
-    (* TODO: check that i and j are correct index for a bitv(n) *)
-    apply (Const.bitv_extract (i, j, n)) [] [t]
+    let rotate_left k t =
+      let n = match_bitv_type t in
+      apply (Const.Bitv.rotate_left (k, n)) [] [t]
 
-  let bitv_repeat k t =
-    let n = match_bitv_type t in
-    apply (Const.bitv_repeat (k, n)) [] [t]
+    let not t =
+      let n = match_bitv_type t in
+      apply (Const.Bitv.not n) [] [t]
 
-  let zero_extend k t =
-    let n = match_bitv_type t in
-    apply (Const.zero_extend (k, n)) [] [t]
+    let and_ u v =
+      let n = match_bitv_type u in
+      apply (Const.Bitv.and_ n) [] [u; v]
 
-  let sign_extend k t =
-    let n = match_bitv_type t in
-    apply (Const.sign_extend (k, n)) [] [t]
+    let or_ u v =
+      let n = match_bitv_type u in
+      apply (Const.Bitv.or_ n) [] [u; v]
 
-  let rotate_right k t =
-    let n = match_bitv_type t in
-    apply (Const.rotate_right (k, n)) [] [t]
+    let nand u v =
+      let n = match_bitv_type u in
+      apply (Const.Bitv.nand n) [] [u; v]
 
-  let rotate_left k t =
-    let n = match_bitv_type t in
-    apply (Const.rotate_left (k, n)) [] [t]
+    let nor u v =
+      let n = match_bitv_type u in
+      apply (Const.Bitv.nor n) [] [u; v]
 
-  let bvnot t =
-    let n = match_bitv_type t in
-    apply (Const.bvnot n) [] [t]
+    let xor u v =
+      let n = match_bitv_type u in
+      apply (Const.Bitv.xor n) [] [u; v]
 
-  let bvand u v =
-    let n = match_bitv_type u in
-    apply (Const.bvand n) [] [u; v]
+    let xnor u v =
+      let n = match_bitv_type u in
+      apply (Const.Bitv.xnor n) [] [u; v]
 
-  let bvor u v =
-    let n = match_bitv_type u in
-    apply (Const.bvor n) [] [u; v]
+    let comp u v =
+      let n = match_bitv_type u in
+      apply (Const.Bitv.comp n) [] [u; v]
 
-  let bvnand u v =
-    let n = match_bitv_type u in
-    apply (Const.bvnand n) [] [u; v]
-
-  let bvnor u v =
-    let n = match_bitv_type u in
-    apply (Const.bvnor n) [] [u; v]
-
-  let bvxor u v =
-    let n = match_bitv_type u in
-    apply (Const.bvxor n) [] [u; v]
-
-  let bvxnor u v =
-    let n = match_bitv_type u in
-    apply (Const.bvxnor n) [] [u; v]
-
-  let bvcomp u v =
-    let n = match_bitv_type u in
-    apply (Const.bvcomp n) [] [u; v]
-
-  let bvneg t =
-    let n = match_bitv_type t in
-    apply (Const.bvneg n) [] [t]
-
-  let bvadd u v =
-    let n = match_bitv_type u in
-    apply (Const.bvadd n) [] [u; v]
-
-  let bvsub u v =
-    let n = match_bitv_type u in
-    apply (Const.bvsub n) [] [u; v]
-
-  let bvmul u v =
-    let n = match_bitv_type u in
-    apply (Const.bvmul n) [] [u; v]
-
-  let bvudiv u v =
-    let n = match_bitv_type u in
-    apply (Const.bvudiv n) [] [u; v]
-
-  let bvurem u v =
-    let n = match_bitv_type u in
-    apply (Const.bvurem n) [] [u; v]
-
-  let bvsdiv u v =
-    let n = match_bitv_type u in
-    apply (Const.bvsdiv n) [] [u; v]
-
-  let bvsrem u v =
-    let n = match_bitv_type u in
-    apply (Const.bvsrem n) [] [u; v]
-
-  let bvsmod u v =
-    let n = match_bitv_type u in
-    apply (Const.bvsmod n) [] [u; v]
+    let neg t =
+      let n = match_bitv_type t in
+      apply (Const.Bitv.neg n) [] [t]
 
-  let bvshl u v =
-    let n = match_bitv_type u in
-    apply (Const.bvshl n) [] [u; v]
-
-  let bvlshr u v =
-    let n = match_bitv_type u in
-    apply (Const.bvlshr n) [] [u; v]
-
-  let bvashr u v =
-    let n = match_bitv_type u in
-    apply (Const.bvashr n) [] [u; v]
+    let add u v =
+      let n = match_bitv_type u in
+      apply (Const.Bitv.add n) [] [u; v]
 
-  let bvult u v =
-    let n = match_bitv_type u in
-    apply (Const.bvult n) [] [u; v]
+    let sub u v =
+      let n = match_bitv_type u in
+      apply (Const.Bitv.sub n) [] [u; v]
 
-  let bvule u v =
-    let n = match_bitv_type u in
-    apply (Const.bvule n) [] [u; v]
+    let mul u v =
+      let n = match_bitv_type u in
+      apply (Const.Bitv.mul n) [] [u; v]
 
-  let bvugt u v =
-    let n = match_bitv_type u in
-    apply (Const.bvugt n) [] [u; v]
+    let udiv u v =
+      let n = match_bitv_type u in
+      apply (Const.Bitv.udiv n) [] [u; v]
 
-  let bvuge u v =
-    let n = match_bitv_type u in
-    apply (Const.bvuge n) [] [u; v]
+    let urem u v =
+      let n = match_bitv_type u in
+      apply (Const.Bitv.urem n) [] [u; v]
 
-  let bvslt u v =
-    let n = match_bitv_type u in
-    apply (Const.bvslt n) [] [u; v]
+    let sdiv u v =
+      let n = match_bitv_type u in
+      apply (Const.Bitv.sdiv n) [] [u; v]
 
-  let bvsle u v =
-    let n = match_bitv_type u in
-    apply (Const.bvsle n) [] [u; v]
+    let srem u v =
+      let n = match_bitv_type u in
+      apply (Const.Bitv.srem n) [] [u; v]
 
-  let bvsgt u v =
-    let n = match_bitv_type u in
-    apply (Const.bvsgt n) [] [u; v]
+    let smod u v =
+      let n = match_bitv_type u in
+      apply (Const.Bitv.smod n) [] [u; v]
 
-  let bvsge u v =
-    let n = match_bitv_type u in
-    apply (Const.bvsge n) [] [u; v]
+    let shl u v =
+      let n = match_bitv_type u in
+      apply (Const.Bitv.shl n) [] [u; v]
 
-  let classify= fun t ->
-    match t.ty.descr with
-    | Var _ -> `Other
-    | App ({ builtin = Real; _ }, _) -> `Real
-    | App ({ builtin = Bitv s; _ }, _) -> `Bitv s
-    | App ({ builtin = Float (e,s); _ }, _) -> `Float (e,s)
-    | App _ -> `Other
+    let lshr u v =
+      let n = match_bitv_type u in
+      apply (Const.Bitv.lshr n) [] [u; v]
+
+    let ashr u v =
+      let n = match_bitv_type u in
+      apply (Const.Bitv.ashr n) [] [u; v]
+
+    let ult u v =
+      let n = match_bitv_type u in
+      apply (Const.Bitv.ult n) [] [u; v]
+
+    let ule u v =
+      let n = match_bitv_type u in
+      apply (Const.Bitv.ule n) [] [u; v]
+
+    let ugt u v =
+      let n = match_bitv_type u in
+      apply (Const.Bitv.ugt n) [] [u; v]
+
+    let uge u v =
+      let n = match_bitv_type u in
+      apply (Const.Bitv.uge n) [] [u; v]
+
+    let slt u v =
+      let n = match_bitv_type u in
+      apply (Const.Bitv.slt n) [] [u; v]
+
+    let sle u v =
+      let n = match_bitv_type u in
+      apply (Const.Bitv.sle n) [] [u; v]
+
+    let sgt u v =
+      let n = match_bitv_type u in
+      apply (Const.Bitv.sgt n) [] [u; v]
+
+    let sge u v =
+      let n = match_bitv_type u in
+      apply (Const.Bitv.sge n) [] [u; v]
+
+  end
 
   module Float = struct
     (* Floats *)
@@ -2434,11 +2756,9 @@ module Term = struct
       | _ -> raise (Wrong_type (t, Ty.float 0 0))
 
     let fp sign exp significand =
-      let s = match_bitv_type sign in
-      if s <> 1 then raise (Wrong_type (sign, Ty.bitv 1));
-      let e = match_bitv_type exp in
-      let s = match_bitv_type significand in
-      apply (Const.Float.fp (e,s+1)) [] [sign;exp;significand]
+      let e = Bitv.match_bitv_type exp in
+      let s = Bitv.match_bitv_type significand in
+      apply (Const.Float.fp (e, s+1)) [] [sign; exp; significand]
 
     let roundNearestTiesToEven = apply Const.Float.roundNearestTiesToEven [] []
     let roundNearestTiesToAway = apply Const.Float.roundNearestTiesToAway [] []
@@ -2451,93 +2771,93 @@ module Term = struct
     let plus_zero e s = apply (Const.Float.plus_zero (e,s)) [] []
     let minus_zero e s = apply (Const.Float.minus_zero (e,s)) [] []
     let nan e s = apply (Const.Float.nan (e,s)) [] []
-    let fp_abs x =
+    let abs x =
       let es = match_float_type x in
-      apply (Const.Float.fp_abs es) [] [x]
-    let fp_neg x =
+      apply (Const.Float.abs es) [] [x]
+    let neg x =
       let es = match_float_type x in
-      apply (Const.Float.fp_neg es) [] [x]
-    let fp_add rm x y =
+      apply (Const.Float.neg es) [] [x]
+    let add rm x y =
       let es = match_float_type x in
-      apply (Const.Float.fp_add es) [] [rm;x;y]
-    let fp_sub rm x y =
+      apply (Const.Float.add es) [] [rm;x;y]
+    let sub rm x y =
       let es = match_float_type x in
-      apply (Const.Float.fp_sub es) [] [rm;x;y]
-    let fp_mul rm x y =
+      apply (Const.Float.sub es) [] [rm;x;y]
+    let mul rm x y =
       let es = match_float_type x in
-      apply (Const.Float.fp_mul es) [] [rm;x;y]
-    let fp_div rm x y =
+      apply (Const.Float.mul es) [] [rm;x;y]
+    let div rm x y =
       let es = match_float_type x in
-      apply (Const.Float.fp_div es) [] [rm;x;y]
-    let fp_fma rm x y z =
+      apply (Const.Float.div es) [] [rm;x;y]
+    let fma rm x y z =
       let es = match_float_type x in
-      apply (Const.Float.fp_fma es) [] [rm;x;y;z]
-    let fp_sqrt rm x =
+      apply (Const.Float.fma es) [] [rm;x;y;z]
+    let sqrt rm x =
       let es = match_float_type x in
-      apply (Const.Float.fp_sqrt es) [] [rm;x]
-    let fp_rem x y =
+      apply (Const.Float.sqrt es) [] [rm;x]
+    let rem x y =
       let es = match_float_type x in
-      apply (Const.Float.fp_rem es) [] [x;y]
-    let fp_roundToIntegral rm x =
+      apply (Const.Float.rem es) [] [x;y]
+    let roundToIntegral rm x =
       let es = match_float_type x in
-      apply (Const.Float.fp_roundToIntegral es) [] [rm;x]
-    let fp_min x y =
+      apply (Const.Float.roundToIntegral es) [] [rm;x]
+    let min x y =
       let es = match_float_type x in
-      apply (Const.Float.fp_min es) [] [x;y]
-    let fp_max x y =
+      apply (Const.Float.min es) [] [x;y]
+    let max x y =
       let es = match_float_type x in
-      apply (Const.Float.fp_max es) [] [x;y]
-    let fp_leq x y =
+      apply (Const.Float.max es) [] [x;y]
+    let leq x y =
       let es = match_float_type x in
-      apply (Const.Float.fp_leq es) [] [x;y]
-    let fp_lt x y =
+      apply (Const.Float.leq es) [] [x;y]
+    let lt x y =
       let es = match_float_type x in
-      apply (Const.Float.fp_lt es) [] [x;y]
-    let fp_geq x y =
+      apply (Const.Float.lt es) [] [x;y]
+    let geq x y =
       let es = match_float_type x in
-      apply (Const.Float.fp_geq es) [] [x;y]
-    let fp_gt x y =
+      apply (Const.Float.geq es) [] [x;y]
+    let gt x y =
       let es = match_float_type x in
-      apply (Const.Float.fp_gt es) [] [x;y]
-    let fp_eq x y =
+      apply (Const.Float.gt es) [] [x;y]
+    let eq x y =
       let es = match_float_type x in
-      apply (Const.Float.fp_eq es) [] [x;y]
-    let fp_isNormal x =
+      apply (Const.Float.eq es) [] [x;y]
+    let isNormal x =
       let es = match_float_type x in
-      apply (Const.Float.fp_isNormal es) [] [x]
-    let fp_isSubnormal x =
+      apply (Const.Float.isNormal es) [] [x]
+    let isSubnormal x =
       let es = match_float_type x in
-      apply (Const.Float.fp_isSubnormal es) [] [x]
-    let fp_isZero x =
+      apply (Const.Float.isSubnormal es) [] [x]
+    let isZero x =
       let es = match_float_type x in
-      apply (Const.Float.fp_isZero es) [] [x]
-    let fp_isInfinite x =
+      apply (Const.Float.isZero es) [] [x]
+    let isInfinite x =
       let es = match_float_type x in
-      apply (Const.Float.fp_isInfinite es) [] [x]
-    let fp_isNaN x =
+      apply (Const.Float.isInfinite es) [] [x]
+    let isNaN x =
       let es = match_float_type x in
-      apply (Const.Float.fp_isNaN es) [] [x]
-    let fp_isNegative x =
+      apply (Const.Float.isNaN es) [] [x]
+    let isNegative x =
       let es = match_float_type x in
-      apply (Const.Float.fp_isNegative es) [] [x]
-    let fp_isPositive x =
+      apply (Const.Float.isNegative es) [] [x]
+    let isPositive x =
       let es = match_float_type x in
-      apply (Const.Float.fp_isPositive es) [] [x]
+      apply (Const.Float.isPositive es) [] [x]
     let to_real x =
       let es = match_float_type x in
       apply (Const.Float.to_real es) [] [x]
     let ieee_format_to_fp e s bv =
       apply (Const.Float.ieee_format_to_fp (e,s)) [] [bv]
-    let fp_to_fp e2 s2 rm x =
+    let to_fp e2 s2 rm x =
       let (e1,s1) = match_float_type x in
-      apply (Const.Float.fp_to_fp (e1,s1,e2,s2)) [] [rm;x]
+      apply (Const.Float.to_fp (e1,s1,e2,s2)) [] [rm;x]
     let real_to_fp e s rm r =
       apply (Const.Float.real_to_fp (e,s)) [] [rm;r]
     let sbv_to_fp e s rm bv =
-      let n = match_bitv_type bv in
+      let n = Bitv.match_bitv_type bv in
       apply (Const.Float.sbv_to_fp (n,e,s)) [] [rm;bv]
     let ubv_to_fp e s rm bv =
-      let n = match_bitv_type bv in
+      let n = Bitv.match_bitv_type bv in
       apply (Const.Float.ubv_to_fp (n,e,s)) [] [rm;bv]
     let to_ubv m rm x =
       let (e,s) = match_float_type x in
@@ -2547,51 +2867,75 @@ module Term = struct
       apply (Const.Float.to_sbv (e,s,m)) [] [rm;x]
   end
 
+  module String = struct
+
+    let of_ustring s = apply (Const.String.string s) [] []
+    let length s = apply Const.String.length [] [s]
+    let at s i = apply Const.String.at [] [s; i]
+    let is_digit s = apply Const.String.is_digit [] [s]
+    let to_code s = apply Const.String.to_code [] [s]
+    let of_code i = apply Const.String.of_code [] [i]
+    let to_int s = apply Const.String.to_int [] [s]
+    let of_int i = apply Const.String.of_int [] [i]
+    let concat s s' = apply Const.String.concat [] [s;s']
+    let sub s i n = apply Const.String.sub [] [s; i; n]
+    let index_of s s' i = apply Const.String.index_of [] [s; s'; i]
+    let replace s pat by = apply Const.String.replace [] [s; pat; by]
+    let replace_all s pat by = apply Const.String.replace_all [] [s; pat; by]
+    let replace_re s pat by = apply Const.String.replace_re [] [s; pat; by]
+    let replace_re_all s pat by = apply Const.String.replace_re_all [] [s; pat; by]
+    let is_prefix s s' = apply Const.String.is_prefix [] [s; s']
+    let is_suffix s s' = apply Const.String.is_suffix [] [s; s']
+    let contains s s' = apply Const.String.contains [] [s; s']
+    let lt s s' = apply Const.String.lt [] [s; s']
+    let leq s s' = apply Const.String.leq [] [s; s']
+    let in_re s re = apply Const.String.in_re [] [s; re]
+
+    module RegLan = struct
+      let empty = apply Const.String.Reg_Lang.empty [] []
+      let all = apply Const.String.Reg_Lang.all [] []
+      let allchar = apply Const.String.Reg_Lang.allchar [] []
+      let of_string s = apply Const.String.Reg_Lang.of_string [] [s]
+      let range s s' = apply Const.String.Reg_Lang.range [] [s; s']
+      let concat re re' = apply Const.String.Reg_Lang.concat [] [re; re']
+      let union re re' = apply Const.String.Reg_Lang.union [] [re; re']
+      let inter re re' = apply Const.String.Reg_Lang.inter [] [re; re']
+      let diff re re' = apply Const.String.Reg_Lang.diff [] [re; re']
+      let star re = apply Const.String.Reg_Lang.star [] [re]
+      let cross re = apply Const.String.Reg_Lang.cross [] [re]
+      let complement re = apply Const.String.Reg_Lang.complement [] [re]
+      let option re = apply Const.String.Reg_Lang.option [] [re]
+      let power n re = apply (Const.String.Reg_Lang.power n) [] [re]
+      let loop n1 n2 re = apply (Const.String.Reg_Lang.loop (n1, n2)) [] [re]
+    end
+
+  end
+
   (* Wrappers for the tff typechecker *)
   let all _ (tys, ts) body =
-    if Ty.(equal prop) (ty body) then bind (Forall (tys, ts)) body
+    if Ty.(equal prop) (ty body) then mk_bind (Forall (tys, ts)) body
     else raise (Wrong_type (body, Ty.prop))
 
   let ex _ (tys, ts) body =
-    if Ty.(equal prop) (ty body) then bind (Exists (tys, ts)) body
+    if Ty.(equal prop) (ty body) then mk_bind (Exists (tys, ts)) body
     else raise (Wrong_type (body, Ty.prop))
 
-  let letin l body =
-    List.iter (fun ((v : Var.t), t) ->
-        if not (Ty.equal v.ty (ty t)) then raise (Wrong_type (t, v.ty))
-      ) l;
-    bind (Letin l) body
-
   let ite cond t_then t_else =
     let ty = ty t_then in
     apply Const.ite [ty] [cond; t_then; t_else]
 
+  (* let-bindings *)
 
-  (** free variables *)
-  let rec free_vars acc (t : t) = match t.descr with
-    | Var v -> FV.add (FV.Term v) (Ty.free_vars acc v.ty)
-    | App (_, tys, ts) ->
-      List.fold_left free_vars (
-        List.fold_left Ty.free_vars acc tys
-      ) ts
-    | Binder ((Exists (tys, ts) | Forall (tys, ts)), body) ->
-      let fv = free_vars FV.empty body in
-      let fv = FV.remove fv tys in
-      let fv = FV.remove fv ts in
-      FV.merge fv acc
-    | Binder (Letin l, body) ->
-      let fv = free_vars FV.empty body in
-      let fv = List.fold_right (fun (v, t) acc ->
-          let acc = free_vars acc t in
-          let acc = FV.del v acc in
-          let acc = Ty.free_vars acc v.ty in
-          acc
-        ) l fv in
-      FV.merge fv acc
+  let bind v t =
+    let () = Id.tag v Tags.bound t in
+    of_var v
+
+  let letin l body =
+    List.iter (fun ((v : Var.t), t) ->
+        if not (Ty.equal v.ty (ty t)) then raise (Wrong_type (t, v.ty))
+      ) l;
+    mk_bind (Letin l) body
 
-  let fv t =
-    let s = free_vars FV.empty t in
-    FV.to_list s
 
 
 end
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/expr.mli b/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/expr.mli
index 79d1305d4f3a7f2ba525e9ba2b6cc0ba141b7e3d..2c51c4a5ede0bedb33b19f7ab8ec23c4a024795e 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/expr.mli
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/expr.mli
@@ -1,6 +1,11 @@
 
 (* This file is free software, part of dolmen. See file "LICENSE" for more information *)
 
+(* Temporary workaround for the fact that some of the module types included
+   to simplify the documentation of the Term module ovarlap (i.e. multiple
+   included signatures define the same function). *)
+[@@@warning "-32"]
+
 (** {2 Type definitions} *)
 (*  ************************************************************************* *)
 
@@ -51,7 +56,8 @@ and ty_descr =
 (** Type descriptions. *)
 
 and ty = {
-  descr : ty_descr;
+  as_ : ty_var option;
+  mutable descr : ty_descr;
   mutable hash : hash; (* lazy hash *)
   mutable tags : Tag.map;
 }
@@ -65,10 +71,14 @@ type term_var = ty id
 and term_const = (ttype, ty) function_type id
 (** Term symbols, which encode their expected type and term argument lists lengths. *)
 
+and pattern = term
+(** patterns are simply terms *)
+
 and term_descr =
   | Var of term_var                                         (** Variables *)
   | App of term_const * ty list * term list                 (** Application *)
   | Binder of binder * term                                 (** Binders *)
+  | Match of term * (pattern * term) list                   (** Pattern matching *)
 (** Term descriptions. *)
 
 and binder =
@@ -96,8 +106,8 @@ exception Bad_ty_arity of ty_const * ty list
 exception Bad_term_arity of term_const * ty list * term list
 exception Type_already_defined of ty_const
 
-exception Filter_failed_ty of string * ty
-exception Filter_failed_term of string * term
+exception Filter_failed_ty of string * ty * string
+exception Filter_failed_term of string * term * string
 
 (* {2 Builtins} *)
 (* ************************************************************************* *)
@@ -150,6 +160,8 @@ type builtin +=
   | Prop
   (** [Prop: ttype]: the builtin type constant for the type of
       propositions / booleans. *)
+  | Unit
+  (** The unit type, which has only one element (named void). *)
   | Univ
   (** [Univ: ttype]: a builtin type constant used for languages
       with a default type for elements (such as tptp's `$i`). *)
@@ -187,12 +199,25 @@ type builtin +=
   (** [Ite: 'a. Prop -> 'a -> 'a -> 'a]: branching operator. *)
 
 type builtin +=
-  | Constructor of ty_const * int
-  (** [Constructor (t, n)] is the n-th constructor of the algebraic datatype
-      defined by [t]. *)
-  | Destructor of ty_const * term_const * int * int
-  (** [Destructor (t, c, n, k)] is the destructor retuning the k-th argument
-      of the n-th constructor of type [t] which should be [c]. *)
+  | Tester of {
+      cstr : term_const;
+    }
+  (** [Tester { cstr; }] is the tester for constructor [cstr]. *)
+  | Constructor of {
+      adt : ty_const;
+      case : int;
+    }
+  (** [Constructor { adt; case}] is the case-th constructor of the algebraic
+      datatype defined by [adt]. *)
+  | Destructor of {
+      adt : ty_const;
+      cstr : term_const;
+      case : int;
+      field: int;
+    }
+  (** [Destructor { adt; cstr; case; field; }] is the destructor retuning the
+      field-th argument of the case-th constructor of type [adt] which should
+      be [cstr]. *)
 
 type builtin +=
   | Int
@@ -272,8 +297,8 @@ type builtin +=
       (whether integers, rationals, or reals).
       [Div_t (N,D)] is the floor of the real
       division [N/D]. *)
-  | Modulo
-  (** [Modulo:{a=(Int|Rational|Real)} a -> a -> a]:
+  | Modulo_e
+  (** [Modulo_e:{a=(Int|Rational|Real)} a -> a -> a]:
       arithmetic integer euclidian remainder
       (whether integers, rationals, or reals).
       It is defined by the following equation:
@@ -343,8 +368,6 @@ type builtin +=
       select operation on arrays. Returns the value associated to the
       given key. Typically, functional arrays are complete, i.e. all
       keys are mapped to a value. *)
-  | Const
-  (** [Const: 'a 'b. 'b -> ('a,'b) Array]: constant array *)
 
 (* Bitvectors *)
 type builtin +=
@@ -407,9 +430,9 @@ type builtin +=
       [Bitv_or (Bitv_and s t)
                (Bitv_and (Bitv_not s) (Bitv_not t))]. *)
   | Bitv_comp
-  (** [Bitv_comp: Bitv(n) -> Bitv(n) -> Bitv(n)]:
-      TODO: is there a short legible definition of this operator ?
-      see SMTLIB's 2.7 spec *)
+  (** [Bitv_comp: Bitv(n) -> Bitv(n) -> Bitv(1)]:
+      Returns the constant bitvector ["1"] is all bits are equal,
+      and the bitvector ["0"] if not. *)
   | Bitv_neg
   (** [Bitv_neg: Bitv(n) -> Bitv(n)]:
       2's complement unary minus. *)
@@ -494,7 +517,9 @@ type builtin +=
      size [e] and significand of size [s] (hidden bit included). Those size are
      greater than 1 *)
   | Fp of int * int
-  (** [Fp(e,s): build a floating point from a sign an exponent of size e and a significant of size s-1 *)
+  (** [Fp(e, s): Bitv(1) -> Bitv(e) -> Bitv(s-1) -> Fp(e,s)]: bitvector literal.
+      The IEEE-format is used for the conversion [sb^se^ss].
+      All the NaN are converted to the same value. *)
   | Plus_infinity of int * int
   (** [Plus_infinity(s,e) : Fp(s,e)] *)
   | Minus_infinity of int * int
@@ -570,6 +595,155 @@ type builtin +=
   | To_real of int * int
   (** [To_real(s,e,m): RoundingMode -> Fp(s,e) -> Real]: Convert to real *)
 
+(* Strings *)
+type builtin +=
+  | String
+  (** [String: ttype]: type constructor for strings. *)
+  | Str of string
+  (** [Str s: String]: string literals. *)
+  | Str_length
+  (** [Str_length: String -> Int]: string length. *)
+  | Str_at
+  (** [Str_at: String -> Int -> String]:
+      Singleton string containing a character at given position
+      or empty string when position is out of range.
+      The leftmost position is 0. *)
+  | Str_to_code
+  (** [Str_to_code: String -> Int]:
+      [Str_to_code s] is the code point of the only character of s,
+      if s is a singleton string; otherwise, it is -1. *)
+  | Str_of_code
+  (** [Str_of_code: Int -> String]:
+      [Str_of_code n] is the singleton string whose only character is
+      code point n if n is in the range [0, 196607]; otherwise, it is the
+      empty string. *)
+  | Str_is_digit
+  (** [Str_is_digit: String -> Prop]: Digit check
+      [Str.is_digit s] is true iff s consists of a single character which is
+      a decimal digit, that is, a code point in the range 0x0030 ... 0x0039. *)
+  | Str_to_int
+  (** [Str_to_int: String -> Int]: Conversion to integers
+      [Str.to_int s] with s consisting of digits (in the sense of str.is_digit)
+      evaluates to the positive integer denoted by s when seen as a number in
+      base 10 (possibly with leading zeros).
+      It evaluates to -1 if s is empty or contains non-digits. *)
+  | Str_of_int
+  (** [Str_of_int : Int -> String]: Conversion from integers.
+      [Str.from_int n] with n non-negative is the corresponding string in
+      decimal notation, with no leading zeros. If n < 0, it is the empty string. *)
+  | Str_concat
+  (** [Str_concat: String -> String -> String]: string concatenation. *)
+  | Str_sub
+  (** [Str_sub: String -> Int -> Int -> String]:
+      [Str_sub s i n] evaluates to the longest (unscattered) substring
+      of s of length at most n starting at position i.
+      It evaluates to the empty string if n is negative or i is not in
+      the interval [0,l-1] where l is the length of s. *)
+  | Str_index_of
+  (** [Str_index_of: String -> String -> Int -> Int]:
+      Index of first occurrence of second string in first one starting at
+      the position specified by the third argument.
+      [Str_index_of s t i], with 0 <= i <= |s| is the position of the first
+      occurrence of t in s at or after position i, if any.
+      Otherwise, it is -1. Note that the result is i whenever i is within
+      the range [0, |s|] and t is empty. *)
+  | Str_replace
+  (** [Str_replace: String -> String -> String -> String]: Replace
+      [Str_replace s t t'] is the string obtained by replacing the first
+      occurrence of t in s, if any, by t'. Note that if t is empty, the
+      result is to prepend t' to s; also, if t does not occur in s then
+      the result is s. *)
+  | Str_replace_all
+  (** [Str_replace_all: String -> String -> String -> String]:
+      [Str_replace_all s t t’] is s if t is the empty string. Otherwise, it
+      is the string obtained from s by replacing all occurrences of t in s
+      by t’, starting with the first occurrence and proceeding in
+      left-to-right order. *)
+  | Str_replace_re
+  (** [Str_replace_re: String -> String_RegLan -> String -> String]:
+      [Str_replace_re s r t] is the string obtained by replacing the
+      shortest leftmost non-empty match of r in s, if any, by t.
+      Note that if t is empty, the result is to prepend t to s. *)
+  | Str_replace_re_all
+  (** [Str_replace_re_all: String -> String_RegLan -> String -> String]:
+      [Str_replace_re_all s r t] is the string obtained by replacing,
+      left-to right, each shortest *non-empty* match of r in s by t. *)
+  | Str_is_prefix
+  (** [Str_is_prefix: String -> String -> Prop]: Prefix check
+      [Str_is_prefix s t] is true iff s is a prefix of t. *)
+  | Str_is_suffix
+  (** [Str_is_suffix: String -> String -> Prop]: Suffix check
+      [Str_is_suffix s t] is true iff s is a suffix of t. *)
+  | Str_contains
+  (** [Str_contains: String -> String -> Prop]: Inclusion check
+      [Str_contains s t] is true iff s contains t. *)
+  | Str_lexicographic_strict
+  (** [Str_lexicographic_strict: String -> String -> Prop]:
+      lexicographic ordering (strict). *)
+  | Str_lexicographic_large
+  (** [Str_lexicographic_large: String -> String -> Prop]:
+      reflexive closure of the lexicographic ordering. *)
+  | Str_in_re
+  (** [Str_in_re: String -> String_RegLan -> Prop]: set membership. *)
+
+(* String Regular languages *)
+type builtin +=
+  | String_RegLan
+  (** [String_RegLan: ttype]:
+      type constructor for Regular languages over strings. *)
+  | Re_empty
+  (** [Re_empty: String_RegLan]:
+      the empty language. *)
+  | Re_all
+  (** [Re_all: String_RegLan]:
+      the language of all strings. *)
+  | Re_allchar
+  (** [Re_allchar: String_RegLan]:
+      the language of all singleton strings. *)
+  | Re_of_string
+  (** [Re_of_string: String -> String_RegLan]:
+      the singleton language with a single string. *)
+  | Re_range
+  (** [Re_range: String -> String -> String_RegLan]: Language range
+      [Re_range s1 s2] is the set of all *singleton* strings [s] such that
+      [Str_lexicographic_large s1 s s2] provided [s1] and [s1] are singleton.
+      Otherwise, it is the empty language. *)
+  | Re_concat
+  (** [Re_concat: String_RegLan -> String_RegLan -> String_RegLan]:
+      language concatenation. *)
+  | Re_union
+  (** [Re_union: String_RegLan -> String_RegLan -> String_RegLan]:
+      language union. *)
+  | Re_inter
+  (** [Re_inter: String_RegLan -> String_RegLan -> String_RegLan]:
+      language intersection. *)
+  | Re_star
+  (** [Re_star: String_RegLan -> String_RegLan]: Kleen star. *)
+  | Re_cross
+  (** [Re_cross: String_RegLan -> String_RegLan]: Kleen cross. *)
+  | Re_complement
+  (** [Re_complement: String_RegLan -> String_RegLan]: language complement. *)
+  | Re_diff
+  (** [Re_diff: String_RegLan -> String_RegLan -> String_RegLan]:
+      language difference. *)
+  | Re_option
+  (** [Re_option: String_RegLan -> String_RegLan]: language option
+      [Re_option e] abbreviates [Re_union e (Str_to_re "")]. *)
+  | Re_power of int
+  (** [Re_power(n): String_RegLan -> String_RegLan]:
+      [Re_power(n) e] is the nth power of e:
+      - [Re_power(0) e] is [Str_to_re ""]
+      - [Re_power(n+1) e] is [Re_concat e (Re_power(n) e)] *)
+  | Re_loop of int * int
+  (** [Re_loop(n1,n2): String_RegLan -> String_RegLan]:
+      Defined as:
+      - [Re_loop(n₁, n₂) e] is [Re_empty]                   if n₁ > n₂
+      - [Re_loop(n₁, n₂) e] is [Re_power(n₁) e]             if n₁ = n₂
+      - [Re_loop(n₁, n₂) e] is
+        [Re_union ((Re_power(n₁) e) ... (Re_power(n₂) e))]  if n₁ < n₂
+  *)
+
+
 (** {2 Native Tags} *)
 (*  ************************************************************************* *)
 
@@ -578,7 +752,12 @@ module Tags : sig
   type 'a t = 'a tag
   (** Polymorphic tags *)
 
+  val bound : term tag
+  (** Tag used one let-bound variables to reference the defining term for
+      the variable (i.e. the term to which it is let-bound). *)
+
   include Dolmen_intf.Tag.Smtlib_Base with type 'a t := 'a t
+                                       and type term := term
   (** Satsify the Smtlib interface. *)
 
   include Dolmen_intf.Tag.Zf_Base with type 'a t := 'a t
@@ -591,32 +770,20 @@ end
 
 module Filter : sig
 
-  val reset : unit -> unit
-  (** Reset all filters. *)
-
-  module Linear : sig
+  type ty_filter
+  type term_filter
 
-    val active : bool ref
-    (** If [true], only linear terms may be created.
-        Trying to create a non-linear term will raise
-        a [Filter_failed_ty] or [Filter_failed_term]
-        exception. *)
+  (** The common external signature for filters. *)
+  module type S = sig
 
     val name : string
-    (** Name of the filter for linear expressions. *)
-
-  end
+    (** The name of the filter. *)
 
-  module Quantifier : sig
-
-    val allow : bool ref
-    (** If [false], trying to build a quantified term
-        (i.e. contianing a forall or exists), will raise
-        a [Filter_failed_term] exception. *)
-
-    val name : string
-    (** Name of the filter for qunatifier-free expressions. *)
+    val active : bool ref
+    (** Whether the filter is active *)
 
+    val reset : unit -> unit
+    (** Reset the filter to its default state. *)
   end
 
 end
@@ -643,7 +810,6 @@ module Print : sig
       [Pretty.Infix] uses the identifier as a separator when printing th argument list
       [Pretty.Prefix] just ignore type arguments. *)
 
-
   val id : _ id t
   (** Printer for ids *)
 
@@ -757,6 +923,51 @@ module Subst : sig
   module Var : S with type 'a key = 'a id
 end
 
+(** {2 Identifiers} *)
+(*  ************************************************************************* *)
+
+module Id : sig
+
+  type 'a t = 'a id
+  (** The type of identifiers *)
+
+  val hash : 'a t -> int
+  (** Hash function. *)
+
+  val equal : 'a t -> 'b t -> bool
+  (** Equality function. *)
+
+  val compare : 'a t -> 'b t -> int
+  (** Comparison function. *)
+
+  val print : Format.formatter -> 'a t -> unit
+  (** Printing function *)
+
+  val tag : 'a t -> 'b Tag.t -> 'b -> unit
+  (** Add a tag to an identifier *)
+
+  val get_tag : 'a t -> 'b Tag.t -> 'b list
+  (** Get all the tags added to the identifier *)
+
+  val get_tag_last : 'a t -> 'b Tag.t -> 'b option
+  (** Get the last tag added to the identifier *)
+
+  val mk :
+    ?builtin:builtin -> ?tags:Tag.map -> string -> 'a -> 'a t
+  (** Create a new fresh identifier *)
+
+  val const :
+    ?pos:Pretty.pos ->
+    ?name:string ->
+    ?builtin:builtin ->
+    ?tags:Tag.map ->
+    ?ty_filters:Filter.ty_filter list ->
+    ?term_filters:Filter.term_filter list ->
+    string -> 'a t list -> 'b list -> 'b -> ('a, 'b) function_type t
+  (** Create a new function or type constructor identifier *)
+
+end
+
 (** {2 Types} *)
 (*  ************************************************************************* *)
 
@@ -773,6 +984,7 @@ module Ty : sig
   type 'a tag = 'a Tag.t
   (** A type for tags to attach to arbitrary types. *)
 
+
   val hash : t -> int
   (** A hash function for types, should be suitable to create hashtables. *)
 
@@ -786,10 +998,44 @@ module Ty : sig
   (** Printing function. *)
 
 
+  (** {4 View} *)
+
+  type view = [
+    | `Int
+    (** Integers *)
+    | `Rat
+    (** Rationals *)
+    | `Real
+    (** Reals *)
+    | `Array of ty * ty
+    (** Function arrays, from source to destination type. *)
+    | `Bitv of int
+    (** Bitvectors of fixed length. *)
+    | `Float of int * int
+    (** Floating points. *)
+    | `String
+    (** Strings *)
+    | `String_reg_lang
+    (** Regular languages over strings *)
+    | `Var of ty_var
+    (** Variables *)
+    | `App of [
+        | `Generic of ty_const
+        | `Builtin of builtin
+      ] * ty list
+    (** Generic applications. *)
+  ]
+  (** View on types. *)
+
+  val view : t -> view
+  (** View on types. *)
+
+
   (** {4 Type structure definition} *)
 
   type adt_case = {
     cstr : term_const;
+    tester : term_const;
     dstrs : term_const option array;
   }
   (** One case of an algebraic datatype definition. *)
@@ -799,7 +1045,7 @@ module Ty : sig
     | Adt of {
         ty : ty_const;
         record : bool;
-        cstrs : adt_case list;
+        cases : adt_case array;
       } (** *)
   (** The various ways to define a type inside the solver. *)
 
@@ -833,8 +1079,11 @@ module Ty : sig
     val tag : t -> 'a tag -> 'a -> unit
     (** Tag a variable. *)
 
-    val get_tag : t -> 'a tag -> 'a option
-    (** Return the value associated to the tag (if any). *)
+    val get_tag : t -> 'a tag -> 'a list
+    (** Return the list of value associated to the tag. *)
+
+    val get_tag_last : t -> 'a tag -> 'a option
+    (** Return the last value associated to the tag (if any). *)
 
   end
 
@@ -862,8 +1111,11 @@ module Ty : sig
     val tag : t -> 'a tag -> 'a -> unit
     (** Tag a variable. *)
 
-    val get_tag : t -> 'a tag -> 'a option
-    (** Return the value associated to the tag (if any). *)
+    val get_tag : t -> 'a tag -> 'a list
+    (** Return the list of values associated to the tag. *)
+
+    val get_tag_last : t -> 'a tag -> 'a option
+    (** Return the last value associated to the tag (if any). *)
 
     val int : t
     (** The type constant for integers *)
@@ -877,6 +1129,9 @@ module Ty : sig
     val prop : t
     (** The type constant for propositions *)
 
+    val unit : t
+    (** The unit type. *)
+
     val base : t
     (** An arbitrary type constant. *)
 
@@ -886,11 +1141,23 @@ module Ty : sig
     val bitv : int -> t
     (** Bitvectors of the given length. *)
 
+    val string : t
+    (** The type constant for strings *)
+
+    val string_reg_lang : t
+    (** The type constant for regular languages over strings. *)
+
   end
 
   val prop : t
   (** The type of propositions *)
 
+  val bool : t
+  (** Alias for {prop}. *)
+
+  val unit : t
+  (** The unit type. *)
+
   val base : t
   (** An arbitrary type. *)
 
@@ -903,9 +1170,18 @@ module Ty : sig
   val real : t
   (** The type of reals. *)
 
+  val string : t
+  (** The type of strings *)
+
+  val string_reg_lang : t
+  (** The type of regular language over strings. *)
+
   val wildcard : unit -> t
   (** Type wildcard *)
 
+  val as_ : t -> Var.t -> t
+  (** Add a pattern ascription to a type. *)
+
   val of_var : Var.t -> t
   (** Create a type from a variable. *)
 
@@ -926,8 +1202,11 @@ module Ty : sig
   val tag : t -> 'a tag -> 'a -> unit
   (** Annotate the given type with the given tag and value. *)
 
-  val get_tag : t -> 'a tag -> 'a option
-  (** Return the value associated to the tag (if any). *)
+  val get_tag : t -> 'a tag -> 'a list
+  (** Return the list of value associated to the tag. *)
+
+  val get_tag_last : t -> 'a tag -> 'a option
+  (** Return the last value associated to the tag (if any). *)
 
   val subst : ?fix:bool -> subst -> t -> t
   (** Substitution on types. *)
@@ -995,9 +1274,11 @@ module Term : sig
     val tag : t -> 'a tag -> 'a -> unit
     (** Tag a variable. *)
 
-    val get_tag : t -> 'a tag -> 'a option
-    (** Return the value associated to the tag (if any). *)
+    val get_tag : t -> 'a tag -> 'a list
+    (** Return the list of value associated to the tag. *)
 
+    val get_tag_last : t -> 'a tag -> 'a option
+    (** Return the last value associated to the tag (if any). *)
   end
 
   (** A module for constant symbols that occur in terms. *)
@@ -1024,9 +1305,11 @@ module Term : sig
     val tag : t -> 'a tag -> 'a -> unit
     (** Tag a constant. *)
 
-    val get_tag : t -> 'a tag -> 'a option
-    (** Return the value associated to the tag (if any). *)
+    val get_tag : t -> 'a tag -> 'a list
+    (** Return the list of values associated to the tag. *)
 
+    val get_tag_last : t -> 'a tag -> 'a option
+    (** Return the last value associated to the tag (if any). *)
   end
 
   (** A module for Algebraic datatype constructors. *)
@@ -1051,11 +1334,25 @@ module Term : sig
     val arity : t -> int * int
     (** Returns the arity of a constructor. *)
 
+    val void : t
+    (** Only constructor for the type unit. *)
+
+    val pattern_arity : t -> ty -> ty list -> ty list
+    (** Used in the type-checking of pattern matching.
+        [pattern_arity cstr ret ty_args] should return the types of the expected arguments
+        [args] such that [apply_cstr cstr ty_args args] has type [ret].
+        @raise Wrong_sum_type if [ret] cannot be unified with the type of [c]
+        @raise Bad_term_arity if the provided type argument list is not of the correct length
+    *)
+
     val tag : t -> 'a tag -> 'a -> unit
     (** Tag a constant. *)
 
-    val get_tag : t -> 'a tag -> 'a option
-    (** Return the value associated to the tag (if any). *)
+    val get_tag : t -> 'a tag -> 'a list
+    (** Return the list of values associated to the tag. *)
+
+    val get_tag_last : t -> 'a tag -> 'a option
+    (** Return the last value associated to the tag (if any). *)
 
   end
 
@@ -1066,10 +1363,13 @@ module Term : sig
     (** A record field. *)
 
     val hash : t -> int
-    (** A hash function for adt constructors, should be suitable to create hashtables. *)
+    (** A hash function for adt destructors. *)
 
     val equal : t -> t -> bool
-    (** An equality function on adt constructors. Should be compatible with the hash function. *)
+    (** An equality function on adt destructors. *)
+
+    val compare : t -> t -> int
+    (** A comparison function on adt constructors. *)
 
   end
 
@@ -1111,6 +1411,10 @@ module Term : sig
       [Wrong_type (t, ty)] should be raised by term constructor functions when some term [t]
       is expected to have type [ty], but does not have that type. *)
 
+  exception Wrong_sum_type of Cstr.t * ty
+  (** Raised when some constructor was expected to belong to some type but does not
+      belong to the given type. *)
+
   exception Wrong_record_type of Field.t * ty_const
   (** Exception raised in case of typing error during term construction.
       This should be raised when the returned field was expected to be a field
@@ -1140,6 +1444,15 @@ module Term : sig
   val apply_field : Field.t -> t -> t
   (** Field access for a record. *)
 
+  val cstr_tester : Cstr.t -> t -> t
+  (** Test expression for a constructor. *)
+
+  val pattern_match : t -> (pattern * t) list -> t
+  (** Create a pattern match. *)
+
+  val void : t
+  (** The only inhabitant of type unit. *)
+
   val _true : t
   val _false : t
   (** Some usual formulas. *)
@@ -1198,9 +1511,6 @@ module Term : sig
   val store : t -> t -> t -> t
   (** Array store *)
 
-  val const : t -> t
-  (** Constant array *)
-
   val all :
     ty_var list * Var.t list ->
     ty_var list * Var.t list ->
@@ -1217,6 +1527,11 @@ module Term : sig
       The first pair of arguments are the variables that are free in the resulting
       quantified formula, and the second pair are the variables bound. *)
 
+  val bind : Var.t -> t -> t
+  (** Tag the given variable with the term, to mark it has been let-bound.
+      Views might use that information to transparently replace a let-bound
+      variable with its defining term. *)
+
   val letin : (Var.t * t) list -> t -> t
   (** Let-binding. Variabels can be bound to either terms or formulas. *)
 
@@ -1226,8 +1541,11 @@ module Term : sig
   val tag : t -> 'a tag -> 'a -> unit
   (** Annotate the given formula wiht the tag and value. *)
 
-  val get_tag : t -> 'a tag -> 'a option
-  (** Return the value associated to the tag (if any). *)
+  val get_tag : t -> 'a tag -> 'a list
+  (** Return the list of values associated to the tag. *)
+
+  val get_tag_last : t -> 'a tag -> 'a option
+  (** Return the last value associated to the tag (if any). *)
 
   val fv : t -> ty_var list * Var.t list
   (** Returns the list of free variables in the formula. *)
@@ -1235,16 +1553,33 @@ module Term : sig
   val subst : ?fix:bool -> Ty.subst -> subst -> t -> t
   (** Substitution over terms. *)
 
-  include Dolmen_intf.Term.Smtlib_Bitv with type t := t
-  (** Satisfy the required interface for typing smtlib bitvectors. *)
+  (* Bitvector manipulation *)
+  module Bitv : sig
 
-  include Dolmen_intf.Term.Smtlib_Float with type t := t
-  (** Satisfy the required interface for typing smtlib floating points. *)
+    include Dolmen_intf.Term.Smtlib_Bitv with type t := t
+    (** Satisfy the required interface for typing smtlib bitvectors. *)
+
+    include Dolmen_intf.Term.Smtlib_Float_Bitv with type t := t
+    (** Satisfy the required interface for typing smtlib floats. *)
+
+  end
+
+  (* Floating point number manipulations *)
+  module Float : sig
+
+    include Dolmen_intf.Term.Smtlib_Float_Float with type t := t
+    (** Satisfy the required interface for typing smtlib floating points. *)
+
+  end
 
   (** Integer operations. *)
   module Int : sig
+
     include Dolmen_intf.Term.Smtlib_Int with type t := t
+    (** Satisfy the required interface for the typing of smtlib integers. *)
+
     include Dolmen_intf.Term.Tptp_Arith_Common with type t := t
+    (** Satisfy the common interface for TPTP's arithmetic on integers. *)
 
     val div : t -> t -> t
     (** Euclidian division quotient *)
@@ -1268,7 +1603,9 @@ module Term : sig
 
   (** Rational operations *)
   module Rat : sig
+
     include Dolmen_intf.Term.Tptp_Arith_Common with type t := t
+    (** Satisfy the common interface for TPTP's arithmetic over Rationals *)
 
     val div : t -> t -> t
     (** Exact division on rationals. *)
@@ -1276,18 +1613,25 @@ module Term : sig
 
   (** Real operations *)
   module Real : sig
+
     include Dolmen_intf.Term.Smtlib_Real with type t := t
+    (** Satisfy the required interface for the typing of smtlib's reals *)
+
     include Dolmen_intf.Term.Tptp_Arith_Common with type t := t
+    (** Satisfy the common interface for TPTP's arithmetic over reals *)
+
+    include Dolmen_intf.Term.Smtlib_Float_Real with type t := t
+    (** Satisfy the real part of the SMTLIB's Float requirements *)
+
   end
 
-end
+  (** String operations *)
+  module String : sig
 
-module Id: sig
-  val const:
-    ?pos:Pretty.pos ->
-    ?name:string ->
-    ?builtin:builtin ->
-    ?tags:Tag.map ->
-    string -> 'a id list -> 'b list -> 'b -> ('a, 'b) function_type id
+    include Dolmen_intf.Term.Smtlib_String_String with type t := t
+    (** Satisfy the required interface for the typing of smtlib's strings. *)
+
+  end
 
 end
+
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/id.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/id.ml
index d8a01d2f51e81102dac96173e52d1dc15e2c1f62..d8ebf9bf03eb242ecaf85baa8160f7badce32f21 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/id.ml
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/id.ml
@@ -8,6 +8,7 @@ type value =
   | Binary
   | Hexadecimal
   | Bitvector
+  | String
 
 type namespace =
   | Var
@@ -28,16 +29,33 @@ let hash = Hashtbl.hash
 let compare = Stdlib.compare
 let equal = Stdlib.(=)
 
-let pp b { name ; _ } =
-  Printf.bprintf b "%s" name
+(* Name&Printing *)
 
-let split_id = Misc.split_on_char '\000'
+let split { name; _ } =
+  Misc.split_on_char '\000' name
+
+let to_string ({ name; _} as id) =
+  match split id with
+  | [s] -> s
+  | l ->
+    let b = Buffer.create (String.length name + List.length l + 3) in
+    Buffer.add_string b "(_";
+    List.iter (fun s -> Buffer.add_char b ' '; Buffer.add_string b s) l;
+    Buffer.add_char b ')';
+    Buffer.contents b
+
+let pp b id =
+  Printf.bprintf b "%s" (to_string id)
+
+let print fmt id =
+  Format.fprintf fmt "%s" (to_string id)
+
+let full_name = function
+  | { ns = Module m; _ } as id ->
+    Printf.sprintf "%s.%s" m (to_string id)
+  | id ->
+    to_string id
 
-let print fmt { name ; _ } =
-  (* It is bad to print null character *)
-  match split_id name with
-  | [s] -> Format.fprintf fmt "%s" s
-  | l -> Format.fprintf fmt "_ %s" (String.concat " " l)
 
 (* Tracked hashtbl *)
 let trackers = Hashtbl.create 13
@@ -61,12 +79,6 @@ let tracked ~track ns name =
   Hashtbl.add trackeds id track;
   id
 
-let full_name =function
-  | { name; ns = Module m; } ->
-    Printf.sprintf "%s.%s" m name
-  | { name; _ } ->
-    name
-
 (* Standard attributes *)
 let ac_symbol = mk Attr "ac"
 let case_split = mk Decl "case_split"
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/id.mli b/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/id.mli
index 582cd517d6f9a9ccf73ab05a4049dbb542ef9797..c6d3d083bcf37ffb6201b3b1b766bfef0826eced 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/id.mli
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/id.mli
@@ -19,6 +19,9 @@ type value =
   (** Bitvector in hexadecimal notation, e.g. ["0x9a23e5f"] *)
   | Bitvector
   (** Bitvector litteral. *)
+  | String
+  (** String litterals. *)
+(** Types of lexical values typically encountered. *)
 
 type namespace =
   | Var
@@ -76,6 +79,10 @@ val pp : Buffer.t -> t -> unit
 val print : Format.formatter -> t -> unit
 (** Printing functions. *)
 
+val split : t -> string list
+(** Split an id into a list of strings (used notably for SMTLIb). *)
+
+
 
 (** {2 Standard attributes} *)
 
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/loc.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/loc.ml
new file mode 100644
index 0000000000000000000000000000000000000000..a91c28cc742fa3fc647e02bb26d2d4d0e85fd75a
--- /dev/null
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/loc.ml
@@ -0,0 +1,244 @@
+
+(* This file is free software, part of dolmen. See file "LICENSE" for more information *)
+
+
+(* Modules and aliases *)
+(* ************************************************************************* *)
+
+module type S = Dolmen_intf.Location.S
+
+(* Type definitions *)
+(* ************************************************************************* *)
+
+(* Compact representation of locs. This is split into a very
+   compact handcrafted representation, and some file meta-data.
+   Compact locations record the start byte number from the beginning
+   of the file + a byte length for the location span.
+   The file meta-data record at which byte number each line of the file
+   starts. *)
+type file = {
+  name : string;
+  mutable table : int Vec.t;
+}
+
+(* A compact file location has to hold 2 unsigned integers, in as compact
+   a form as possible. This leads to 2 representations used:
+   - an int: the two ints are packed, each in half the bits of the int
+   - if the ints to hold do not fit into half a caml int, then we fallback
+     to a caml block holding the ints separately. In this case, some care
+     is taken to be able to hold big enough ints even on a 32-bit platform *)
+type t = Obj.t (* = int [@unboxed] | Extended of extended *)
+
+(* The block types used when parts of a compact location
+   cannot fit in one caml int. *)
+type extended = {
+  offset : int;
+  length : int;
+}
+
+(* Convenient alias to store a compact location and file info *)
+type full = {
+  file : file;
+  loc : t;
+}
+
+(* A full location (very much not compact) *)
+type loc = {
+  file : string;
+  start_line : int;
+  start_column : int;
+  stop_line : int;
+  stop_column : int;
+}
+
+
+exception Uncaught of t * exn
+exception Lexing_error of t * string
+exception Syntax_error of t * Msg.t
+(** Exceptions that may occur during parsing *)
+
+(* Compact locations *)
+(* ************************************************************************* *)
+
+let compact_part_size = Sys.int_size / 2
+let compact_part_mask = -1 lsr (Sys.int_size - compact_part_size)
+
+let split_compact (c : t) =
+  if Obj.is_int c then begin
+    let i : int = Obj.magic c in
+    let offset = i land compact_part_mask in
+    let length = (i lsr compact_part_size) land compact_part_mask in
+    offset, length
+  end else begin
+    let e : extended = Obj.magic c in
+    e.offset, e.length
+  end
+
+let mk_compact offset length =
+  if 0 <= offset && offset <= compact_part_mask &&
+     0 <= length && length <= compact_part_mask then begin
+    let i = offset + length lsl compact_part_size in
+    (Obj.magic i : t)
+  end else begin
+    let e = { offset; length; } in
+    (Obj.magic e : t)
+  end
+
+(* File table *)
+(* ************************************************************************* *)
+
+let tables = Hashtbl.create 5
+
+let file_name { name; _ } = name
+
+let reset_files () = Hashtbl.reset tables
+
+let mk_file name =
+  try Hashtbl.find tables name
+  with Not_found ->
+    let table = Vec.create () in
+    let () = Vec.push table (-1) in
+    let file = { name; table; } in
+    Hashtbl.add tables name file;
+    file
+
+let new_line file offset =
+  assert (Vec.last file.table < offset);
+  Vec.push file.table (offset - 1)
+
+let newline filename =
+  let file = mk_file filename in
+  (fun lexbuf ->
+     Lexing.new_line lexbuf;
+     let offset = Lexing.lexeme_end lexbuf in
+     new_line file offset)
+
+let find_line file offset =
+  let rec aux vec offset start stop =
+    (* end condition *)
+    if start >= stop then start else begin
+      assert (start < stop);
+      let m = (start + stop) / 2 in
+      let o = Vec.get vec m in
+      if o < offset then begin
+        aux vec offset (m + 1) stop
+      end else begin
+        aux vec offset start m
+      end
+    end
+  in
+  let line = aux file.table offset 0 (Vec.size file.table) in
+  let line_offset = Vec.get file.table (line - 1) in
+  line_offset, line
+
+
+(* Full locations *)
+(* ************************************************************************* *)
+
+let eq a b = a = b
+let hash a = Hashtbl.hash a
+
+(* Constructor functions *)
+let mk file start_line start_column stop_line stop_column =
+  { file; start_line; start_column; stop_line; stop_column; }
+
+let no_loc = mk_compact 0 0
+
+let mk_pos start stop =
+  let open Lexing in
+  let start_offset = start.pos_cnum in
+  let stop_offset = stop.pos_cnum in
+  let length = stop_offset - start_offset in
+  mk_compact start_offset length
+
+let is_dummy loc =
+  loc.start_line = loc.stop_line &&
+  loc.start_column = loc.stop_column
+
+(* location from a lexbuf *)
+let of_lexbuf lexbuf =
+  let start = Lexing.lexeme_start_p lexbuf in
+  let stop = Lexing.lexeme_end_p lexbuf in
+  mk_pos start stop
+
+(* Compact<->full translations *)
+(* ************************************************************************* *)
+
+let loc file c =
+  let start_offset, length = split_compact c in
+  if length = 0 then
+    mk file.name 0 0 0 0
+  else begin
+    let stop_offset = start_offset + length in
+    let start_line_offset, start_line = find_line file start_offset in
+    let start_column = start_offset - start_line_offset - 1 in
+    let stop_line_offset, stop_line = find_line file stop_offset in
+    let stop_column = stop_offset - stop_line_offset - 1 in
+    mk file.name start_line start_column stop_line stop_column
+  end
+
+let full_loc { file; loc = l; } = loc file l
+
+let compact (t : loc) =
+  let file = mk_file t.file in
+  let start_line_offset = Vec.get file.table t.start_line in
+  let start_offset = start_line_offset + t.start_column + 1 in
+  let stop_line_offset = Vec.get file.table t.stop_line in
+  let stop_offset = stop_line_offset + t.stop_column + 1 in
+  let length = stop_offset - start_offset in
+  file, mk_compact start_offset length
+
+
+(* Printing and lexbuf handling *)
+(* ************************************************************************* *)
+
+let pp buf pos =
+  if pos.start_line = pos.stop_line then
+    if pos.start_column = pos.stop_column then
+      if pos.file = "" then
+        Printf.bprintf buf "<location missing>"
+      else
+        Printf.bprintf buf "File \"%s\", <location missing>" pos.file
+    else
+      Printf.bprintf buf "File \"%s\", line %d, character %d-%d"
+        pos.file pos.start_line pos.start_column pos.stop_column
+  else
+    Printf.bprintf buf "File \"%s\", line %d, character %d to line %d, character %d"
+      pos.file
+      pos.start_line pos.start_column
+      pos.stop_line pos.stop_column
+
+let fmt fmt pos =
+  if pos.start_line = pos.stop_line then
+    if pos.start_column = pos.stop_column then
+      if pos.file = "" then
+        Format.fprintf fmt "<location missing>"
+      else
+        Format.fprintf fmt "File \"%s\", <location missing>" pos.file
+    else
+      Format.fprintf fmt "File \"%s\", line %d, character %d-%d"
+        pos.file pos.start_line pos.start_column pos.stop_column
+  else
+    Format.fprintf fmt "File \"%s\", line %d, character %d to line %d, character %d"
+      pos.file
+      pos.start_line pos.start_column
+      pos.stop_line pos.stop_column
+
+let fmt_hint fmt pos =
+  if pos.start_line = pos.stop_line then
+    Format.fprintf fmt "%s%s"
+      (String.make (pos.start_column) ' ')
+      (String.make (pos.stop_column - pos.start_column) '^')
+
+let fmt_pos fmt pos =
+  if pos.start_line = pos.stop_line then
+    if pos.start_column = pos.stop_column then
+      Format.fprintf fmt "<location missing>"
+    else
+      Format.fprintf fmt "line %d, character %d-%d"
+        pos.start_line pos.start_column pos.stop_column
+  else
+    Format.fprintf fmt "line %d, character %d to line %d, character %d"
+      pos.start_line pos.start_column
+      pos.stop_line pos.stop_column
+
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/loc.mli b/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/loc.mli
new file mode 100644
index 0000000000000000000000000000000000000000..21c4b1e48cdcb9fbdb48f78df290d3260090afde
--- /dev/null
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/loc.mli
@@ -0,0 +1,86 @@
+
+(* This file is free software, part of dolmen. See file "LICENSE" for more information *)
+
+(** Standard implementation of file locations. *)
+
+(** {2 Interface definition} *)
+
+type loc = {
+  file : string;
+  start_line : int;
+  start_column : int;
+  stop_line : int;
+  stop_column : int;
+}
+(** A full location, including file, start position and end position.
+    Dummy positions (i.e. with [start_line = stop_line] and
+    [start_column = stop_column]) are allowed to represent unknown
+    locations. *)
+
+type file
+(** Meta-data about files to enable more compact location storage. *)
+
+type t
+(** A compact representation of locations. *)
+
+type full = {
+  file : file;
+  loc : t;
+}
+(* Convenient alias to store a compact location and file info *)
+
+
+(** {2 Interface definition} *)
+
+module type S = Dolmen_intf.Location.S
+(** An anstract module type for providing locations. Used
+    as argumentby much of the functors provided in Dolmen. *)
+
+include S with type t := t
+(** This module implements the signature {S}. *)
+
+val hash : t -> int
+(** Hashing function. *)
+
+val eq : t -> t -> bool
+(** Location equality. *)
+
+val no_loc : t
+(** An dummy location pointing at the first byte of a file. *)
+
+val is_dummy : loc -> bool
+(** Is the location ana ctual location, or a dummy one ? *)
+
+
+(** {2 Compact location handling} *)
+
+val mk_file : string -> file
+(** Return the meta-data associated to a file. *)
+
+val new_line : file -> int -> unit
+(** Register a new line whose first char is at the given offset. *)
+
+val reset_files : unit -> unit
+(** Reset the meta-data associated to a file *)
+
+(** {2 Compact<->full translations} *)
+
+val loc : file -> t -> loc
+val full_loc : full -> loc
+(** Return a complete location from a compact location and meta-data. *)
+
+val compact : loc -> file * t
+(** Compactify a full location into a compact representation. *)
+
+
+(** {2 Printing locations} *)
+
+val pp : Buffer.t -> loc -> unit
+val fmt : Format.formatter -> loc -> unit
+val fmt_pos : Format.formatter -> loc -> unit
+val fmt_hint : Format.formatter -> loc -> unit
+(** Printing functions *)
+
+val file_name : file -> string
+(** Filename for a file *)
+
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/misc.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/misc.ml
index ffbe1d9227a9cd54fb9a7c8055609f3f7515a90a..70a7c2c757f9e01d60b8d65f225c9298b143a132 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/misc.ml
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/misc.ml
@@ -29,6 +29,16 @@ let split_on_char sep s =
   done;
   String.sub s 0 !j :: !r
 
+let opt_map o f =
+  match o with
+  | None -> None
+  | Some x -> Some (f x)
+
+let opt_bind o f =
+  match o with
+  | None -> None
+  | Some x -> f x
+
 
 (* Option printing *)
 
@@ -59,3 +69,39 @@ let rec print_list ~print_sep ~sep ~print fmt = function
       print h print_sep sep
       (print_list ~print_sep ~sep ~print) r
 
+
+(* Operations on Lexing.lexbuf *)
+let set_file buf filename =
+  let open Lexing in
+  buf.lex_curr_p <- {buf.lex_curr_p with pos_fname=filename;};
+  ()
+
+let filename_of_input = function
+  | `Contents (file, _) -> file
+  | `File file -> file
+  | `Stdin -> "<stdin>"
+
+let filename_of_input_source = function
+  | `Raw (file, _) -> file
+  | `File file -> file
+  | `Stdin -> "<stdin>"
+
+let mk_lexbuf i =
+  let filename = filename_of_input i in
+  match i with
+  | `Contents (_, s) ->
+    let buf = Lexing.from_string s in
+    set_file buf filename;
+    buf, (fun () -> ())
+  | `Stdin ->
+    let ch, cl = stdin, (fun () -> ()) in
+    let buf = Lexing.from_channel ch in
+    set_file buf filename;
+    buf, cl
+  | `File s ->
+    let ch = open_in s in
+    let cl = (fun () -> close_in ch) in
+    let buf = Lexing.from_channel ch in
+    set_file buf filename;
+    buf, cl
+
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/misc.mli b/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/misc.mli
index 97ad879a6044687e2ef97822f886c2e9b2225f8e..272dff980fdd4f1600e7de09ffbd70b532a157c5 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/misc.mli
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/misc.mli
@@ -1,6 +1,7 @@
 
 (* This file is free software, part of dolmen. See file "LICENSE" for more information. *)
 
+
 (** {2 Misc functions} *)
 
 val get_extension : string -> string
@@ -13,6 +14,13 @@ val split_on_char : char -> string -> string list
 val replicate : int -> 'a -> 'a list
 (** Returns a list with [n] times the given value. Returns an empty list if [n] *)
 
+val opt_map : 'a option -> ('a -> 'b) -> 'b option
+(** Map on option. *)
+
+val opt_bind : 'a option -> ('a -> 'b option) -> 'b option
+(** Bind on option. *)
+
+
 (** {2 Printing helpers} *)
 
 val pp_opt :
@@ -35,3 +43,26 @@ val print_list :
   print:(Format.formatter -> 'b -> unit) -> Format.formatter -> 'b list -> unit
 (** Print a list with separator into a buffer *)
 
+
+(** {2 Lexbuf helpers} *)
+
+val filename_of_input :
+  [ `Stdin | `File of string | `Contents of string * string ] ->
+  string
+(** Filename string of an input. *)
+
+val filename_of_input_source :
+  [ `Stdin | `File of string | `Raw of string * string ] ->
+  string
+(** Filename string of an input source. *)
+
+val mk_lexbuf :
+  [ `Stdin | `File of string | `Contents of string * string ] ->
+  Lexing.lexbuf * (unit -> unit)
+(** Returns the lexbuf associetd with the given file or stdin,
+    with the correct filename, together with a function to close
+    the associated file descriptor.
+    The [`Contents] constructor expect first a name for the input
+    stream (to report errors), and then a string with the actual
+    contents to be parsed. *)
+
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/msg.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/msg.ml
new file mode 100644
index 0000000000000000000000000000000000000000..04b502084131dada23aa6f767ccbf34e626b842b
--- /dev/null
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/msg.ml
@@ -0,0 +1,5 @@
+
+(* This file is free software, part of dolmen. See file "LICENSE" for more information *)
+
+type t = Dolmen_intf.Msg.t (* = Format.formatter -> unit *)
+
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/normalize.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/normalize.ml
index 6e0e1ca726d2dcdca5741640e0a0932be91e4b29..e2d7a2a66af03184a1fa0f89f0da6820e22acf11 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/normalize.ml
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/normalize.ml
@@ -6,22 +6,22 @@ module Tptp = struct
   let symbol m ~attr ~loc id =
     let t = match id with
       (* Base builtins *)
-      | { Id.name =  "$_"; ns = Id.Term }     -> Term.(builtin ?loc Wildcard ())
-      | { Id.name = "$tType" ; ns = Id.Term } -> Term.(builtin ?loc Ttype ())
-      | { Id.name = "$o"; ns = Id.Term }      -> Term.(builtin ?loc Prop ())
-      | { Id.name = "$true"; ns = Id.Term }   -> Term.(builtin ?loc True ())
-      | { Id.name = "$false"; ns = Id.Term }  -> Term.(builtin ?loc False ())
+      | { Id.name =  "$_"; ns = Id.Term }     -> Term.(builtin ~loc Wildcard ())
+      | { Id.name = "$tType" ; ns = Id.Term } -> Term.(builtin ~loc Ttype ())
+      | { Id.name = "$o"; ns = Id.Term }      -> Term.(builtin ~loc Prop ())
+      | { Id.name = "$true"; ns = Id.Term }   -> Term.(builtin ~loc True ())
+      | { Id.name = "$false"; ns = Id.Term }  -> Term.(builtin ~loc False ())
       (* Arithmetic builtins *)
-      | { Id.name = "$int"; ns = Id.Term }        -> Term.(builtin ?loc Int ())
-      | { Id.name = "$less"; ns = Id.Term }       -> Term.(builtin ?loc Lt ())
-      | { Id.name = "$lesseq"; ns = Id.Term }     -> Term.(builtin ?loc Leq ())
-      | { Id.name = "$greater"; ns = Id.Term }    -> Term.(builtin ?loc Gt ())
-      | { Id.name = "$greatereq"; ns = Id.Term }  -> Term.(builtin ?loc Geq ())
-      | { Id.name = "$uminus"; ns = Id.Term }     -> Term.(builtin ?loc Minus ())
-      | { Id.name = "$sum"; ns = Id.Term }        -> Term.(builtin ?loc Add ())
-      | { Id.name = "$difference"; ns = Id.Term } -> Term.(builtin ?loc Sub ())
-      | { Id.name = "$product"; ns = Id.Term }    -> Term.(builtin ?loc Mult ())
-      | _ -> Term.(const ?loc id)
+      | { Id.name = "$int"; ns = Id.Term }        -> Term.(builtin ~loc Int ())
+      | { Id.name = "$less"; ns = Id.Term }       -> Term.(builtin ~loc Lt ())
+      | { Id.name = "$lesseq"; ns = Id.Term }     -> Term.(builtin ~loc Leq ())
+      | { Id.name = "$greater"; ns = Id.Term }    -> Term.(builtin ~loc Gt ())
+      | { Id.name = "$greatereq"; ns = Id.Term }  -> Term.(builtin ~loc Geq ())
+      | { Id.name = "$uminus"; ns = Id.Term }     -> Term.(builtin ~loc Minus ())
+      | { Id.name = "$sum"; ns = Id.Term }        -> Term.(builtin ~loc Add ())
+      | { Id.name = "$difference"; ns = Id.Term } -> Term.(builtin ~loc Sub ())
+      | { Id.name = "$product"; ns = Id.Term }    -> Term.(builtin ~loc Mult ())
+      | _ -> Term.(const ~loc id)
     in
     let attrs = List.map (Term.map m) attr in
     Term.add_attrs attrs t
@@ -35,18 +35,18 @@ module Smtlib = struct
 
   let symbol m ~attr ~loc id =
     let t = match id with
-      | { Id.name = "Bool"; ns = Id.Sort }  -> Term.(builtin ?loc Prop ())
-      | { Id.name = "true"; ns = Id.Term }  -> Term.(builtin ?loc True ())
-      | { Id.name = "false"; ns = Id.Term } -> Term.(builtin ?loc False ())
-      | { Id.name = "not"; ns = Id.Term }   -> Term.(builtin ?loc Not ())
-      | { Id.name = "and"; ns = Id.Term }   -> Term.(builtin ?loc And ())
-      | { Id.name = "or"; ns = Id.Term }    -> Term.(builtin ?loc Or ())
-      | { Id.name = "xor"; ns = Id.Term }   -> Term.(builtin ?loc Xor ())
-      | { Id.name = "=>"; ns = Id.Term }    -> Term.(builtin ?loc Imply ())
-      | { Id.name = "="; ns = Id.Term }     -> Term.(builtin ?loc Eq ())
-      | { Id.name = "distinct"; ns = Id.Term } -> Term.(builtin ?loc Distinct ())
-      | { Id.name = "ite"; ns = Id.Term }   -> Term.(builtin ?loc Ite ())
-      | _ -> Term.(const ?loc id)
+      | { Id.name = "Bool"; ns = Id.Sort }  -> Term.(builtin ~loc Prop ())
+      | { Id.name = "true"; ns = Id.Term }  -> Term.(builtin ~loc True ())
+      | { Id.name = "false"; ns = Id.Term } -> Term.(builtin ~loc False ())
+      | { Id.name = "not"; ns = Id.Term }   -> Term.(builtin ~loc Not ())
+      | { Id.name = "and"; ns = Id.Term }   -> Term.(builtin ~loc And ())
+      | { Id.name = "or"; ns = Id.Term }    -> Term.(builtin ~loc Or ())
+      | { Id.name = "xor"; ns = Id.Term }   -> Term.(builtin ~loc Xor ())
+      | { Id.name = "=>"; ns = Id.Term }    -> Term.(builtin ~loc Imply ())
+      | { Id.name = "="; ns = Id.Term }     -> Term.(builtin ~loc Eq ())
+      | { Id.name = "distinct"; ns = Id.Term } -> Term.(builtin ~loc Distinct ())
+      | { Id.name = "ite"; ns = Id.Term }   -> Term.(builtin ~loc Ite ())
+      | _ -> Term.(const ~loc id)
     in
     let attrs = List.map (Term.map m) attr in
     Term.add_attrs attrs t
@@ -54,7 +54,7 @@ module Smtlib = struct
   let binder_let_eq m t =
     match t with
     | { Term.term = Term.Colon (u, v) ; _ } ->
-      Term.eq ?loc:t.Term.loc (Term.map m u) (Term.map m v)
+      Term.eq ~loc:t.Term.loc (Term.map m u) (Term.map m v)
     | _ -> assert false
 
   let binder m ~attr ~loc b l body =
@@ -62,7 +62,7 @@ module Smtlib = struct
     | Term.Let ->
       let attrs = List.map (Term.map m) attr in
       let l' = List.map (binder_let_eq m) l in
-      Term.add_attrs attrs (Term.letin ?loc l' (Term.map m body))
+      Term.add_attrs attrs (Term.letin ~loc l' (Term.map m body))
     | _ -> Term.(id_mapper.binder m ~attr ~loc b l body)
 
   let mapper =
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/parseLocation.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/parseLocation.ml
index ce63503bda8c986c7198f83342fdd123ab636f9a..d3f5167cf08323c6fe0fe92c05caa438721619da 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/parseLocation.ml
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/parseLocation.ml
@@ -126,30 +126,16 @@ let fmt_hint fmt pos =
       (String.make (pos.start_column) ' ')
       (String.make (pos.stop_column - pos.start_column) '^')
 
+let fmt_pos fmt pos =
+  if pos.start_line = pos.stop_line
+  then
+    Format.fprintf fmt "line %d, character %d-%d"
+      pos.start_line pos.start_column pos.stop_column
+  else
+    Format.fprintf fmt "line %d, character %d to line %d, character %d"
+      pos.start_line pos.start_column
+      pos.stop_line pos.stop_column
 
-(* Operations on Lexing.lexbuf *)
-let set_file buf filename =
-  let open Lexing in
-  buf.lex_curr_p <- {buf.lex_curr_p with pos_fname=filename;};
-  ()
-
-let mk_lexbuf i =
-  match i with
-  | `Contents (file, s) ->
-    let buf = Lexing.from_string s in
-    set_file buf file;
-    buf, (fun () -> ())
-  | `Stdin ->
-    let s, ch, cl = "<stdin>", stdin, (fun () -> ()) in
-    let buf = Lexing.from_channel ch in
-    set_file buf s;
-    buf, cl
-  | `File s ->
-    let ch = open_in s in
-    let cl = (fun () -> close_in ch) in
-    let buf = Lexing.from_channel ch in
-    set_file buf s;
-    buf, cl
 
 let of_lexbuf lexbuf =
   let start = Lexing.lexeme_start_p lexbuf in
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/parseLocation.mli b/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/parseLocation.mli
index 5879b7295771ce5bfac6fb78e2db05f1930d5af4..6962e11ab47929a9657a761e5a814e2b898f6e19 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/parseLocation.mli
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/parseLocation.mli
@@ -59,6 +59,7 @@ val mk_pos : Lexing.position -> Lexing.position -> t
 
 val pp : Buffer.t -> t -> unit
 val fmt : Format.formatter -> t -> unit
+val fmt_pos : Format.formatter -> t -> unit
 val fmt_hint : Format.formatter -> t -> unit
 (** Printing functions *)
 
@@ -77,19 +78,6 @@ val smaller : t -> t -> bool
 
 (** {2 Lexbuf} *)
 
-val set_file : Lexing.lexbuf -> string -> unit
-(** Change the file name used for positions in this lexbuf *)
-
-val mk_lexbuf :
-  [ `Stdin | `File of string | `Contents of string * string ] ->
-  Lexing.lexbuf * (unit -> unit)
-(** Returns the lexbuf associetd with the given file or stdin,
-    with the correct filename, together with a function to close
-    the associated file descriptor.
-    The [`Contents] constructor expect first a name for the input
-    stream (to report errors), and then a string with the actual
-    contents to be parsed. *)
-
 val of_lexbuf : Lexing.lexbuf -> t
 (** Recover a position from a lexbuf *)
 
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/statement.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/statement.ml
index 52a8fb0caf1f772a11922a700b1888d3769570ed..cb731e17f21d69041d9886931dd6d87886e3a853 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/statement.ml
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/statement.ml
@@ -3,19 +3,19 @@
 
 (* Type definitions *)
 type term = Term.t
-type location = ParseLocation.t
+type location = Loc.t
 
 type abstract = {
   id : Id.t;
   ty : term;
-  loc : location option;
+  loc : location;
 }
 
 type inductive = {
   id : Id.t;
   vars : term list;
   cstrs : (Id.t * term list) list;
-  loc : location option;
+  loc : location;
   attr : term option;
 }
 
@@ -23,7 +23,7 @@ type record = {
   id : Id.t;
   vars : term list;
   fields : (Id.t * term) list;
-  loc : location option;
+  loc : location;
   attr : term option;
 }
 
@@ -32,6 +32,21 @@ type decl =
   | Record of record
   | Inductive of inductive
 
+type def = {
+  id : Id.t;
+  ty : term;
+  body : term;
+  loc : location;
+}
+
+type 'a group = {
+  contents : 'a list;
+  recursive : bool;
+}
+
+type defs = def group
+type decls = decl group
+
 (* Description of statements. *)
 type descr =
   | Pack of t list
@@ -56,8 +71,8 @@ type descr =
   | Get_option of string
   | Set_option of term
 
-  | Def of Id.t * term
-  | Decls of decl list
+  | Defs of def group
+  | Decls of decl group
 
   | Get_proof
   | Get_unsat_core
@@ -77,9 +92,13 @@ and t = {
   id : Id.t;
   descr : descr;
   attr : term option;
-  loc : location option;
+  loc : location;
 }
 
+(* Dummy location *)
+
+let no_loc = Loc.no_loc
+
 (* Debug printing *)
 
 let pp_abstract b (i : abstract) =
@@ -103,11 +122,21 @@ let pp_record b (i : record) =
            Printf.bprintf b "%a: %a" Id.pp id Term.pp ty
          )) i.fields
 
-let pp_type_def b = function
+let pp_decl b = function
   | Abstract a -> pp_abstract b a
   | Record r -> pp_record b r
   | Inductive i -> pp_inductive b i
 
+let pp_def b (d : def) =
+  Printf.bprintf b "def: %a = %a" Id.pp d.id Term.pp d.body
+
+let pp_group pp b (d: _ group) =
+  let aux = Misc.pp_list ~pp_sep:Buffer.add_string ~sep:"\n" ~pp in
+  if d.recursive then
+    Printf.bprintf b "rec (\n%a)" aux d.contents
+  else
+    aux b d.contents
+
 let rec pp_descr b = function
   | Pack l ->
     Printf.bprintf b "pack(%d):\n" (List.length l);
@@ -134,17 +163,13 @@ let rec pp_descr b = function
   | Set_logic s -> Printf.bprintf b "set-logic: %s" s
 
   | Get_info s -> Printf.bprintf b "get-info: %s" s
-  | Set_info t ->
-    Printf.bprintf b "set-info: %a" Term.pp t
+  | Set_info t -> Printf.bprintf b "set-info: %a" Term.pp t
 
   | Get_option s -> Printf.bprintf b "get-option: %s" s
-  | Set_option t ->
-    Printf.bprintf b "set-option: %a" Term.pp t
+  | Set_option t -> Printf.bprintf b "set-option: %a" Term.pp t
 
-  | Def (id, t) -> Printf.bprintf b "def: %a = %a" Id.pp id Term.pp t
-  | Decls [t] -> pp_type_def b t
-  | Decls l ->
-    Misc.pp_list ~pp_sep:Buffer.add_string ~sep:"\n" ~pp:pp_type_def b l
+  | Defs p -> pp_group pp_def b p
+  | Decls p -> pp_group pp_decl b p
 
   | Get_proof -> Printf.bprintf b "get-proof"
   | Get_unsat_core -> Printf.bprintf b "get-unsat-core"
@@ -186,11 +211,21 @@ let print_record fmt (r : record) =
          Format.fprintf fmt "%a : %a" Id.print f Term.print ty
        )) r.fields
 
-let print_type_def fmt = function
+let print_decl fmt = function
   | Abstract a -> print_abstract fmt a
   | Record r -> print_record fmt r
   | Inductive i -> print_inductive fmt i
 
+let print_def fmt (d : def) =
+  Format.fprintf fmt "@[<hov 2>def:@ %a =@ %a@]" Id.print d.id Term.print d.body
+
+let print_group print fmt (d: _ group) =
+  let aux = Misc.print_list ~print_sep:Format.fprintf ~sep:"@ " ~print in
+  if d.recursive then
+    Format.fprintf fmt "@[<v 2>rec@ %a@]" aux d.contents
+  else
+    aux fmt d.contents
+
 let rec print_descr fmt = function
   | Pack l ->
     Format.fprintf fmt "@[<hov 2>pack(%d):@ %a@]" (List.length l)
@@ -230,13 +265,8 @@ let rec print_descr fmt = function
   | Set_option t ->
     Format.fprintf fmt "@[<hov 2>set-option:@ %a@]" Term.print t
 
-  | Def (id, t) ->
-    Format.fprintf fmt "@[<hov 2>def:@ %a =@ %a@]" Id.print id Term.print t
-  | Decls [t] ->
-    print_type_def fmt t
-  | Decls l ->
-    Format.fprintf fmt "@[<v 2>rec_types:@ %a@]"
-      (Misc.print_list ~print_sep:Format.fprintf ~sep:"@ " ~print:print_type_def) l
+  | Defs d -> print_group print_def fmt d
+  | Decls d -> print_group print_decl fmt d
 
   | Get_proof -> Format.fprintf fmt "get-proof"
   | Get_unsat_core -> Format.fprintf fmt "get-unsat-core"
@@ -259,7 +289,7 @@ and print fmt = function { descr; _ } ->
 let annot = Term.apply
 
 (* Internal shortcut. *)
-let mk ?(id=Id.(mk decl "")) ?loc ?attr descr =
+let mk ?(id=Id.(mk decl "")) ?(loc=Loc.no_loc) ?attr descr =
   { id; descr; loc; attr; }
 
 (* Pack *)
@@ -303,6 +333,57 @@ let echo ?loc s = mk ?loc (Echo s)
 let reset ?loc () = mk ?loc Reset
 let exit ?loc () = mk ?loc Exit
 
+(* decl/def *)
+let def ?(loc=no_loc) id ty body =
+  { id; ty; body; loc; }
+
+let abstract ?(loc=no_loc) id ty =
+  Abstract { id; ty; loc; }
+
+let record ?(attr=None) ?(loc=no_loc) id vars fields =
+  Record { id; vars; fields; loc; attr; }
+
+let inductive ?(attr=None) ?(loc=no_loc) id vars cstrs =
+  Inductive { id; vars; cstrs; loc; attr; }
+
+(* grouping of decls/defs *)
+let mk_decls ?loc ?attr ~recursive decls =
+  mk ?loc ?attr (Decls { recursive; contents = decls; })
+
+let group_decls ?loc ?attr ~recursive l =
+  let decls, others = List.fold_left (fun (decls, others) s ->
+      match s with
+      | { descr = Decls d; _ } ->
+        List.rev_append d.contents decls, others
+      | _ -> decls, s :: others
+    ) ([], []) l in
+  let new_decls = mk_decls ?loc ?attr ~recursive (List.rev decls) in
+  match others with
+  | [] -> new_decls
+  | l -> pack ?loc (new_decls :: List.rev l)
+
+let mk_defs ?loc ?attr ~recursive defs =
+  mk ?loc ?attr (Defs { recursive; contents = defs; })
+
+let group_defs ?loc ?attr ~recursive l =
+  let defs, others = List.fold_left (fun (defs, others) s ->
+      match s with
+      | { descr = Defs d; _ } ->
+        List.rev_append d.contents defs, others
+      | _ -> defs, s :: others
+    ) ([], []) l in
+  let new_defs = mk_defs ?loc ?attr ~recursive (List.rev defs) in
+  match others with
+  | [] -> new_defs
+  | l -> pack ?loc (new_defs :: List.rev l)
+
+
+(* Some helpers *)
+let extract_type = function
+  | { Term.term = Colon (_, ty); _ } -> ty
+  | _ -> assert false
+
+
 (* Alt-ergo wrappers *)
 let logic ?loc ~ac ids ty =
   let attr = if ac then Some (Term.const ?loc Id.ac_symbol) else None in
@@ -314,26 +395,21 @@ let logic ?loc ~ac ids ty =
         ) vars in
       Term.pi ?loc l ty
   in
-  let l = List.map (fun id -> Abstract { id; ty; loc; }) ids in
-  mk ?loc ?attr (Decls l)
+  let l = List.map (fun id -> abstract ?loc id ty) ids in
+  mk_decls ?loc ?attr ~recursive:true l
 
 let abstract_type ?loc id vars =
   let ty = Term.fun_ty ?loc vars (Term.tType ?loc ()) in
-  mk ?loc (Decls [Abstract { id; ty; loc; }])
+  mk_decls ?loc ~recursive:false [abstract ?loc id ty]
 
 let record_type ?loc id vars fields =
-  mk ?loc (Decls [Record { id; vars; fields; loc; attr = None; }])
+  mk_decls ?loc ~recursive:false [ record ?loc id vars fields]
 
 let algebraic_type ?loc id vars cstrs =
-  mk ?loc (Decls [Inductive { id; vars; cstrs; loc; attr = None; }])
+  mk_decls ?loc ~recursive:false [inductive ?loc id vars cstrs]
 
 let rec_types ?loc l =
-  let l = List.map (function
-      | { descr = Decls l'; _ } -> l'
-      | _ -> assert false
-    ) l in
-  let l = List.flatten l in
-  mk ?loc (Decls l)
+  group_decls ?loc ~recursive:true l
 
 let axiom ?loc id t =
   mk ~id ?loc (Antecedent t)
@@ -365,6 +441,9 @@ let p_cnf ?loc nbvar nbclause =
   let attr = Term.colon ?loc i j in
   mk ?loc ~attr (Set_logic "dimacs")
 
+let p_inccnf ?loc () =
+  mk ?loc (Set_logic "icnf")
+
 let clause ?loc l = mk_clause ?loc l
 
 let assumption ?loc l =
@@ -376,32 +455,50 @@ let assert_ ?loc t = antecedent ?loc t
 
 let type_decl ?loc id n =
   let ty = Term.fun_ty ?loc (Misc.replicate n @@ Term.tType ()) @@ Term.tType () in
-  mk ?loc (Decls [ Abstract { id; ty; loc; }])
+  mk_decls ?loc ~recursive:false [abstract ?loc id ty]
 
-let fun_decl ?loc id l t' =
+let fun_decl ?loc id vars l t' =
   let ty = Term.fun_ty ?loc l t' in
-  mk ?loc (Decls [ Abstract { id; ty; loc; }])
+  let ty = match vars with
+    | [] -> ty
+    | vars -> Term.pi ?loc vars ty  in
+  mk_decls ?loc ~recursive:false [abstract ?loc id ty]
 
 let type_def ?loc id args body =
   let l = List.map (fun id -> Term.colon (Term.const id) @@ Term.tType ()) args in
-  let t = Term.lambda l body in
-  mk ?loc (Def (id, t))
+  let ty = Term.pi l (Term.tType ()) in
+  let body = Term.lambda l body in
+  mk_defs ?loc ~recursive:false [def ?loc id ty body]
 
 let datatypes ?loc l =
   let l' = List.map (fun (id, vars, cstrs) ->
-      Inductive {id; vars; cstrs; loc; attr = None;}
+      inductive ?loc id vars cstrs
     ) l in
-  mk ?loc (Decls l')
+  mk_decls ?loc ~recursive:true l'
 
-let fun_def ?loc id args ty_ret body =
+let fun_def_aux ?loc id vars args ty_ret body =
+  let ty = Term.fun_ty (List.map extract_type args) ty_ret in
+  let ty = match vars with
+    | [] -> ty
+    | vars -> Term.pi ?loc vars ty  in
   let t = Term.lambda args (Term.colon body ty_ret) in
-  mk ?loc (Def (id, t))
+  let t = match vars with
+    | [] -> t
+    | vars ->
+      Term.lambda (List.map (fun e -> Term.colon e (Term.tType ?loc ())) vars) t in
+  id, ty, t
+
+let fun_def ?loc id vars args ty_ret body =
+  let id, ty, body = fun_def_aux ?loc id vars args ty_ret body in
+  mk_defs ?loc ~recursive:false [def ?loc id ty body]
 
 let funs_def_rec ?loc l =
-  let l' = List.map (fun (id, args, ty_ret, body) ->
-      fun_def ?loc id args ty_ret body
+  let contents = List.map (fun (id, vars, args, ty_ret, body) ->
+      let id, ty, body = fun_def_aux ?loc id vars args ty_ret body in
+      def ?loc id ty body
     ) l in
-  pack ?loc l'
+  mk_defs ?loc ~recursive:true contents
+
 
 (* Wrappers for Zf *)
 let zf_attr ?loc = function
@@ -412,7 +509,7 @@ let import ?loc s = mk ?loc (Include s)
 
 let defs ?loc ?attrs l =
   let attr = zf_attr ?loc attrs in
-  mk ?loc ?attr (Pack l)
+  group_defs ?loc ?attr ~recursive:true l
 
 let rewrite ?loc ?attrs t =
   let attr = zf_attr ?loc attrs in
@@ -435,7 +532,7 @@ let lemma ?loc ?attrs t =
 
 let decl ?loc ?attrs id ty =
   let attr = zf_attr ?loc attrs in
-  mk ?loc ?attr (Decls [Abstract { id; ty; loc; }])
+  mk_decls ?loc ?attr ~recursive:true [abstract ?loc id ty]
 
 let definition ?loc ?attrs s ty l =
   let attr = zf_attr ?loc attrs in
@@ -446,17 +543,12 @@ let definition ?loc ?attrs s ty l =
 
 let inductive ?loc ?attrs id vars cstrs =
   let attr = zf_attr ?loc attrs in
-  mk ?loc (Decls [Inductive {id; vars; cstrs; loc; attr; }])
+  mk_decls ?loc ~recursive:true [inductive ?loc ~attr id vars cstrs]
 
 let data ?loc ?attrs l =
   (* this is currently only used for mutually recursive datatypes *)
   let attr = zf_attr ?loc attrs in
-  let l = List.map (function
-      | { descr = Decls l'; _ } -> l'
-      | _ -> assert false
-    ) l in
-  let l = List.flatten l in
-  mk ?loc ?attr (Decls l)
+  group_decls ?loc ?attr ~recursive:true l
 
 
 (* Wrappers for tptp *)
@@ -496,7 +588,8 @@ let tptp ?loc ?annot id role body =
     | "type" ->
       begin match body with
         | `Term { Term.term = Term.Colon ({ Term.term = Term.Symbol s; _ }, ty ) ; _ } ->
-          Decls [Abstract { id = s; ty; loc }]
+          Decls { recursive = false;
+                  contents = [abstract ?loc s ty]; }
         | _ ->
           Format.eprintf "WARNING: unexpected type declaration@.";
           Pack []
@@ -529,43 +622,4 @@ let cnf ?loc ?annot id role t =
   in
   tptp ?loc ?annot id role (`Clause (t, l))
 
-(* normalization *)
-let normalize_inductive f i =
-  { i with cstrs = List.map (fun (x, l) -> (x, List.map f l)) i.cstrs; }
-
-let normalize_record f r =
-  { r with fields = List.map (fun (id, ty) -> (id, f ty)) r.fields; }
-
-let normalize_type_def f = function
-  | Abstract { id; ty; loc; } -> Abstract { id; ty = f ty; loc; }
-  | Record r -> Record (normalize_record f r)
-  | Inductive i -> Inductive (normalize_inductive f i)
-
-let rec normalize_descr f = function
-  | Pack l -> Pack (List.map (normalize f) l)
-
-  | Plain t -> Plain (f t)
-
-  | Prove l -> Prove (List.map f l)
-  | Clause l -> Clause (List.map f l)
-  | Antecedent t -> Antecedent (f t)
-  | Consequent t -> Consequent (f t)
-
-  | Set_info t -> Set_info (f t)
-
-  | Set_option t -> Set_option (f t)
-
-  | Def (id, t) -> Def (id, f t)
-  | Decls l -> Decls (List.map (normalize_type_def f) l)
-
-  | Get_value l -> Get_value (List.map f l)
-
-  | descr -> descr
-
-and normalize f s =
-  { s with
-    attr = (match s.attr with
-        | None -> None | Some t -> Some (f t));
-    descr = normalize_descr f s.descr; }
-
 
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/statement.mli b/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/statement.mli
index 735c7cee77bfd0d671e9f633f9fce5d716784717..408475136a39525aa16fe24f31efc38f0f784a04 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/statement.mli
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/statement.mli
@@ -14,13 +14,13 @@
 (** {2 Type definitions} *)
 
 type term = Term.t
-type location = ParseLocation.t
+type location = Loc.t
 (** Type aliases for readability. *)
 
 type abstract = {
   id : Id.t;
   ty : term;
-  loc : location option;
+  loc : location;
 }
 (** The type for abstract type definitions. *)
 
@@ -28,7 +28,7 @@ type inductive = {
   id : Id.t;
   vars : term list;
   cstrs : (Id.t * term list) list;
-  loc : location option;
+  loc : location;
   attr : term option;
 }
 (** The type for inductive type declarations. The "vars" field if used
@@ -45,7 +45,7 @@ type record = {
   id : Id.t;
   vars : term list;
   fields : (Id.t * term) list;
-  loc : location option;
+  loc : location;
   attr : term option;
 }
 (** The type of record definitions. *)
@@ -54,7 +54,25 @@ type decl =
   | Abstract of abstract
   | Record of record
   | Inductive of inductive (**)
-(** Type definitions. *)
+(** Type definitions, type declarations, and term declaration. *)
+
+type def = {
+  id : Id.t;
+  ty : term;
+  body : term;
+  loc : location;
+}
+(** Term definition. *)
+
+type 'a group = {
+  contents : 'a list;
+  recursive : bool;
+}
+(** Groups of declarations or definitions, which can be recursive or not. *)
+
+type defs = def group
+type decls = decl group
+(** Convenient aliases *)
 
 type descr =
   | Pack of t list
@@ -96,9 +114,9 @@ type descr =
   | Set_option of term
   (** Set the option value. *)
 
-  | Def of Id.t * term
+  | Defs of def group
   (** Symbol definition, i.e the symbol is equal to the given term. *)
-  | Decls of decl list
+  | Decls of decl group
   (** A list of potentially recursive type definitions. *)
 
   | Get_proof
@@ -128,7 +146,7 @@ and t = {
   id : Id.t;
   descr : descr;
   attr : term option;
-  loc : location option;
+  loc : location;
 }
 (** The type of statements. Statements have optional location and attributes (or annotations).
     Additionally the each have a name (which mainly comes from tptp statements), that can
@@ -144,9 +162,13 @@ include Dolmen_intf.Stmt.Logic
 
 (** {2 Additional functions} *)
 
-val pp : Buffer.t -> t -> unit
-val print : Format.formatter -> t -> unit
-(** Printing functions for statements. *)
+val mk_decls :
+  ?loc:location -> ?attr:term -> recursive:bool -> decl list -> t
+(** Create a group of declarations *)
+
+val mk_defs :
+  ?loc:location -> ?attr:term -> recursive:bool -> def list -> t
+(** Create a group of declarations *)
 
 val prove : ?loc:location -> unit -> t
 (** Emit a [Prove] statement. *)
@@ -154,6 +176,24 @@ val prove : ?loc:location -> unit -> t
 val pack : ?id:Id.t -> ?loc:location -> ?attr:term -> t list -> t
 (** Pack a list of statements into a single one. *)
 
-val normalize : (Term.t -> Term.t) -> t -> t
-(** Normalize statements with regards to a normalization function on terms. *)
+
+(** {2 Printing functions} *)
+
+val pp : Buffer.t -> t -> unit
+val print : Format.formatter -> t -> unit
+(** Printing functions for statements. *)
+
+val pp_decl : Buffer.t -> decl -> unit
+val print_decl : Format.formatter -> decl -> unit
+(* Printer for declarations. *)
+
+val pp_def : Buffer.t -> def -> unit
+val print_def : Format.formatter -> def -> unit
+(* Printer for declarations. *)
+
+val pp_group : (Buffer.t -> 'a -> unit) -> Buffer.t -> 'a group -> unit
+val print_group :
+  (Format.formatter -> 'a -> unit) ->
+  Format.formatter -> 'a group -> unit
+(* Printer for groups. *)
 
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/tag.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/tag.ml
index e5d05d397139745b688eb65955c8e7509493fa24..526d39d5eb6a5dfb5276df15aaf0aaeb680ad3b3 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/tag.ml
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/tag.ml
@@ -77,7 +77,7 @@ type map = M.t
 
 type 'a t = {
   id : int;
-  inj : 'a injection;
+  inj : 'a list injection;
 }
 
 let equal k k' = k.id = k'.id
@@ -92,6 +92,19 @@ let create () =
 
 let empty = M.empty
 
-let get m k = M.get ~inj:k.inj k.id m
-let add m k v = M.add ~inj:k.inj k.id v m
+let get m k =
+  match M.get ~inj:k.inj k.id m with
+  | None -> []
+  | Some l -> l
+
+let last m k =
+  match get m k with
+  | x :: _ -> Some x
+  | [] -> None
+
+let replace m k l =
+  M.add ~inj:k.inj k.id l m
+
+let add m k v =
+  replace m k (v :: get m k)
 
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/tag.mli b/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/tag.mli
index 3118fc7e91d4294c3d00b3a143c227941d35a80f..c42c6c88f75eb279254759e88e1720d75519303c 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/tag.mli
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/tag.mli
@@ -23,10 +23,18 @@ val empty : map
 val create : unit -> 'a t
 (** Create a new tag. *)
 
-val get : map -> 'a t -> 'a option
-(** Get the value of a tag (if it exists). *)
+val get : map -> 'a t -> 'a list
+(** Get the list of values associated to a tag
+    (can be the empty list). *)
+
+val last : map -> 'a t -> 'a option
+(** Return the last value associated to a tag (i.e. the head of the
+    list returned by {get} if it exists). *)
 
 val add : map -> 'a t -> 'a -> map
-(** Add a value to a tag in a map. *)
+(** Add a value to a tag in a map. If some values were previously bound,
+    this adds the new value to the head of the value list. *)
 
+val replace : map -> 'a t -> 'a list -> map
+(** Replace the set of values associated to a tag in a map. *)
 
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/term.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/term.ml
index 49461ecd2ac4c720548728d8e89ad45d1632c5e5..9c0d4dee13b4259290a4b6aaaee1ac70904b3106 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/term.ml
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/term.ml
@@ -1,7 +1,7 @@
 
 (* This file is free software, part of dolmen. See file "LICENSE" for more information. *)
 
-type location = ParseLocation.t
+type location = Loc.t
 
 type builtin =
   | Wildcard
@@ -68,7 +68,7 @@ type descr =
 and t = {
   term : descr;
   attr : t list;
-  loc : location option;
+  loc : location;
 }
 
 (* Printing info *)
@@ -222,10 +222,21 @@ let rec print_descr fmt = function
 and print_match_case fmt (pattern, branch) =
   Format.fprintf fmt "%a => %a" print pattern print branch
 
+and print_attr fmt = function
+  | [] -> ()
+  | a :: r ->
+    Format.fprintf fmt "{%a}@,%a" print a print_attr r
+
 and print fmt = function
-  | { term = (Symbol _) as d ; _ }
-  | { term = (Builtin _) as d ; _ } -> print_descr fmt d
-  | e -> Format.fprintf fmt "@[<hov 2>(%a)@]" print_descr e.term
+  | { term = (Symbol _) as d ; attr; _ }
+  | { term = (Builtin _) as d ; attr; _ } ->
+    Format.fprintf fmt "@[<hov 2>%a@,%a@]"
+      print_descr d
+      print_attr attr
+  | e ->
+    Format.fprintf fmt "@[<hov 2>(%a)@,%a@]"
+      print_descr e.term
+      print_attr e.attr
 
 (* Comparison *)
 let _descr = function
@@ -289,7 +300,7 @@ let set_attrs l t =
   { t with attr = l }
 
 (* Make a term from its description *)
-let make ?loc ?(attr=[]) term = { term; attr; loc; }
+let make ?(loc=Loc.no_loc) ?(attr=[]) term = { term; attr; loc; }
 
 let builtin b ?loc () = make ?loc (Builtin b)
 
@@ -298,7 +309,7 @@ let mk_bind binder ?loc vars t =
   make ?loc (Binder (binder, vars, t))
 
 (* Attach an attribute list to a term *)
-let annot ?loc t l =
+let annot ?(loc=Loc.no_loc) t l =
   { t with attr = t.attr @ l; loc }
 
 (* Create a constant and/or variable, that is a leaf
@@ -472,9 +483,11 @@ let rec free_vars acc t =
     List.fold_left free_vars (free_vars acc t) l
   | Binder (_, l, t) ->
     let s = free_vars S.empty t in
-    let bound = List.fold_left free_vars S.empty l in
+    let bound, free =
+      List.fold_left free_vars_bound (S.empty, S.empty) l
+    in
     let s' = S.filter (fun x -> not (S.mem x bound)) s in
-    S.union acc s'
+    S.union acc (S.union s' free)
   | Match (t, l) ->
     let acc = List.fold_left (fun acc (pattern, branch) ->
         let s = free_vars S.empty branch in
@@ -484,6 +497,11 @@ let rec free_vars acc t =
       ) acc l in
     free_vars acc t
 
+and free_vars_bound (bound, free) t =
+  match t.term with
+  | Colon (v, ty) -> free_vars bound v, free_vars free ty
+  | _ -> free_vars bound t, free
+
 let fv t =
   S.elements (free_vars S.empty t)
 
@@ -533,6 +551,7 @@ let atom ?loc i =
 
 (* {2 Wrappers for smtlib} *)
 
+let str ?loc s = const ?loc Id.(mk (Value String) s)
 let int ?loc s = const ?loc Id.(mk (Value Integer) s)
 let real ?loc s = const ?loc Id.(mk (Value Real) s)
 let hexa ?loc s = const ?loc Id.(mk (Value Hexadecimal) s)
@@ -566,12 +585,12 @@ let quoted ?loc name =
 (* {2 Term traversal} *)
 
 type 'a mapper = {
-  symbol    : 'a mapper -> attr:t list -> loc:location option -> Id.t -> 'a;
-  builtin   : 'a mapper -> attr:t list -> loc:location option -> builtin -> 'a;
-  colon     : 'a mapper -> attr:t list -> loc:location option -> t -> t -> 'a;
-  app       : 'a mapper -> attr:t list -> loc:location option -> t -> t list -> 'a;
-  binder    : 'a mapper -> attr:t list -> loc:location option -> binder -> t list -> t -> 'a;
-  pmatch    : 'a mapper -> attr:t list -> loc:location option -> t -> (t * t) list -> 'a;
+  symbol    : 'a mapper -> attr:t list -> loc:location -> Id.t -> 'a;
+  builtin   : 'a mapper -> attr:t list -> loc:location -> builtin -> 'a;
+  colon     : 'a mapper -> attr:t list -> loc:location -> t -> t -> 'a;
+  app       : 'a mapper -> attr:t list -> loc:location -> t -> t list -> 'a;
+  binder    : 'a mapper -> attr:t list -> loc:location -> binder -> t list -> t -> 'a;
+  pmatch    : 'a mapper -> attr:t list -> loc:location -> t -> (t * t) list -> 'a;
 }
 
 let map mapper t =
@@ -585,16 +604,18 @@ let map mapper t =
   | Match (e, l) -> wrap mapper.pmatch e l
 
 let id_mapper = {
-  symbol = (fun m ~attr ~loc id -> set_attrs (List.map (map m) attr) @@ const ?loc id);
-  builtin = (fun m ~attr ~loc b -> set_attrs (List.map (map m) attr) @@ builtin ?loc b ());
+  symbol = (fun m ~attr ~loc id ->
+      set_attrs (List.map (map m) attr) @@ const ~loc id);
+  builtin = (fun m ~attr ~loc b ->
+      set_attrs (List.map (map m) attr) @@ builtin ~loc b ());
   colon = (fun m ~attr ~loc u v ->
-      set_attrs (List.map (map m) attr) @@ colon ?loc (map m u) (map m v));
+      set_attrs (List.map (map m) attr) @@ colon ~loc (map m u) (map m v));
   app = (fun m ~attr ~loc f args ->
-      set_attrs (List.map (map m) attr) @@ apply ?loc (map m f) (List.map (map m) args));
+      set_attrs (List.map (map m) attr) @@ apply ~loc (map m f) (List.map (map m) args));
   binder = (fun m ~attr ~loc b vars body ->
-      set_attrs (List.map (map m) attr) @@ mk_bind ?loc b (List.map (map m) vars) (map m body));
+      set_attrs (List.map (map m) attr) @@ mk_bind ~loc b (List.map (map m) vars) (map m body));
   pmatch = (fun m ~attr ~loc e l ->
-      set_attrs (List.map (map m) attr) @@ match_ ?loc (map m e)
+      set_attrs (List.map (map m) attr) @@ match_ ~loc (map m e)
         (List.map (fun (pat, body) -> (map m pat, map m body)) l));
 }
 
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/term.mli b/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/term.mli
index ed0d2a9859e9b037009a9da3198918d70e2c94bc..e76f2e3c662fb238c9cc074676116c1f9a91d6ad 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/term.mli
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/term.mli
@@ -5,7 +5,7 @@
 
 (** {2 Type definitions} *)
 
-type location = ParseLocation.t
+type location = Loc.t
 
 type builtin =
   | Wildcard
@@ -148,7 +148,7 @@ type binder =
   (** The arrow binder, for function types. Allows for curified types, if wanted. *)
   | Let
   (** Let bindings (either propositional or for terms).
-      Term boud by a let can have many forms depending on the language, but usual
+      Term bound by a let can have many forms depending on the language, but usual
       shapes are:
       - an equality (using the builtin {!Eq}) between a variable
         (optionnally typed using the {!Colon} constructor),
@@ -160,14 +160,14 @@ type binder =
   *)
   | Fun
   (** Lambda, i.e function abstraction binder.
-      Boud terms are the variables bound by the lambda, optionnally typed
+      Bound terms are the variables bound by the lambda, optionnally typed
       using the {!Colon} constructor. *)
   | Choice
   (** Indefinite description, or epsilon terms.
-      Likely to have its usual shape change fllowing tptp's recent changes. *)
+      Likely to have its usual shape change following tptp's recent changes. *)
   | Description
   (** Definite description.
-      Likely to have its usual shape change fllowing tptp's recent changes. *)
+      Likely to have its usual shape change following tptp's recent changes. *)
 (** The type of binders, these are pretty much always builtin in all languages. *)
 
 type descr =
@@ -191,7 +191,7 @@ type descr =
 and t = {
   term : descr;
   attr : t list;
-  loc : location option;
+  loc : location;
 }
 (** The type of terms. A record containing an optional location,
     and a description of the term. *)
@@ -219,6 +219,13 @@ include Dolmen_intf.Term.Logic
     functions that you may want to use. *)
 
 
+(** {2 Term constructor not in implemented interfaces} *)
+
+val ite_t : ?loc:location -> unit -> t
+(** The standalone term corresponding to the if-then-else builtin
+    construction. *)
+
+
 (** {2 Term inspection} *)
 
 val fv : t -> Id.t list
@@ -256,12 +263,12 @@ val set_attrs : t list -> t -> t
 *)
 
 type 'a mapper = {
-  symbol    : 'a mapper -> attr:t list -> loc:location option -> Id.t -> 'a;
-  builtin   : 'a mapper -> attr:t list -> loc:location option -> builtin -> 'a;
-  colon     : 'a mapper -> attr:t list -> loc:location option -> t -> t -> 'a;
-  app       : 'a mapper -> attr:t list -> loc:location option -> t -> t list -> 'a;
-  binder    : 'a mapper -> attr:t list -> loc:location option -> binder -> t list -> t -> 'a;
-  pmatch    : 'a mapper -> attr:t list -> loc:location option -> t -> (t * t) list -> 'a;
+  symbol    : 'a mapper -> attr:t list -> loc:location -> Id.t -> 'a;
+  builtin   : 'a mapper -> attr:t list -> loc:location -> builtin -> 'a;
+  colon     : 'a mapper -> attr:t list -> loc:location -> t -> t -> 'a;
+  app       : 'a mapper -> attr:t list -> loc:location -> t -> t list -> 'a;
+  binder    : 'a mapper -> attr:t list -> loc:location -> binder -> t list -> t -> 'a;
+  pmatch    : 'a mapper -> attr:t list -> loc:location -> t -> (t * t) list -> 'a;
 }
 (** The type of a mapper on terms. *)
 
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/tok.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/tok.ml
new file mode 100644
index 0000000000000000000000000000000000000000..d30721bb1cd222d3259f893967020b71d02e14b4
--- /dev/null
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/tok.ml
@@ -0,0 +1,22 @@
+
+(* This file is free software, part of dolmen. See file "LICENSE" for more information *)
+
+type descr = Dolmen_intf.Tok.descr = {
+  article : string;
+  kind : string;
+  lexeme : string;
+  hint : string option;
+}
+
+let descr ?hint ?(article="the") ~kind lexeme = { article; kind; lexeme; hint; }
+
+let print fmt { article; kind; lexeme; _ } =
+  let lxm =
+    if String.length lexeme < 15
+    then lexeme
+    else String.sub lexeme 0 14 ^ "…"
+  in
+  match lxm with
+  | "" -> Format.fprintf fmt "%s %s" article kind
+  | s -> Format.fprintf fmt "%s %s '%s'" article kind s
+
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/transformer.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/transformer.ml
index 6451c071bfb047394802a4e3d5b196b68b203de4..5ca22e28de3f6d18c9593e3e6884843073191ebf 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/transformer.ml
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/transformer.ml
@@ -2,7 +2,7 @@
 (* This file is free software, part of dolmen. See file "LICENSE" formore information *)
 
 module Make
-    (Loc    : ParseLocation.S)
+    (Loc    : Loc.S)
     (Ty     : sig
        type token
        type statement
@@ -56,35 +56,64 @@ module Make
      --------------------------------------- *)
 
   let state checkpoint =
-     match (checkpoint : _ Parse.MenhirInterpreter.checkpoint) with
+     match (checkpoint : _ Parser.MenhirInterpreter.checkpoint) with
      | HandlingError env ->
-       Parse.MenhirInterpreter.current_state_number env
+       Parser.MenhirInterpreter.current_state_number env
      | _ -> assert false (* this cannot happen, I promise *)
 
-  let error_message checkpoint =
+  let error_message token checkpoint =
     let s = state checkpoint in
-    match String.trim (Ty.error s) with
-    | exception Not_found -> ""
-    | "<YOUR SYNTAX ERROR MESSAGE HERE>" -> ""
-    | msg -> msg
+    match token with
+    | None ->
+      (fun fmt -> Format.fprintf fmt "Syntax error@ with@ missing@ token@ read,@ \
+                                      please@ report upstream,@ ^^")
+    | Some tok ->
+      let tok_descr = Lexer.descr tok in
+      begin match String.trim (Ty.error s) with
+        | exception Not_found ->
+          (fun fmt -> Format.fprintf fmt "Missing@ syntax@ error@ message (state %d),@ \
+                                      please@  report@ upstream,@ ^^" s)
+        | "<YOUR SYNTAX ERROR MESSAGE HERE>" ->
+          (fun fmt -> Format.fprintf fmt "Syntax error (state %d)@ while reading %a."
+              s Tok.print tok_descr)
+        | msg ->
+          begin match Misc.split_on_char '\n' msg with
+            | error_no :: production :: l ->
+              let expected = String.concat " " l in
+              (fun fmt -> Format.fprintf fmt
+                  "@[<v>@[<hv>(%s) while parsing %s,@ read %a,@]@ @[<hov>but expected %a.@]@]"
+                  error_no production Tok.print tok_descr
+                  Format.pp_print_text expected)
+            | _ ->
+              (fun fmt -> Format.fprintf fmt "Syntax error (state %d)." s)
+          end
+      end
 
 
   (* Parsing loop
      ------------ *)
 
-   let parse_aux ~k_exn lexbuf checkpoint =
+  let parse_aux ~k_exn newline lexbuf checkpoint =
     (* Token supplier *)
-    let supplier = Parser.MenhirInterpreter.lexer_lexbuf_to_supplier
-        Lexer.token lexbuf in
+    let last_token = ref None in
+    let aux =
+      Parser.MenhirInterpreter.lexer_lexbuf_to_supplier
+        (Lexer.token newline) lexbuf
+    in
+    let supplier () =
+      let (t, _, _) as res = aux () in
+      last_token := Some t;
+      res
+    in
     (* Incremental loop *)
     let succeed res = res in
     let fail checkpoint =
       let pos = Loc.of_lexbuf lexbuf in
-      let msg = error_message checkpoint in
+      let msg = error_message !last_token checkpoint in
       let () = k_exn () in
       raise (Loc.Syntax_error (pos, msg))
     in
-    let loop = Parse.MenhirInterpreter.loop_handle succeed fail supplier in
+    let loop = Parser.MenhirInterpreter.loop_handle succeed fail supplier in
     (* Run the loop *)
     let aux () =
       begin match loop (checkpoint Lexing.(lexbuf.lex_curr_p)) with
@@ -100,8 +129,9 @@ module Make
           raise (Loc.Lexing_error (pos, err))
         | exception Parser.Error ->
           let pos = Loc.of_lexbuf lexbuf in
+          let msg fmt = Format.fprintf fmt "" in
           let () = k_exn () in
-          raise (Loc.Syntax_error (pos, ""))
+          raise (Loc.Syntax_error (pos, msg))
         | exception e ->
           let pos = Loc.of_lexbuf lexbuf in
           let () = k_exn () in
@@ -114,22 +144,27 @@ module Make
      ---------------------------------- *)
 
   let parse_file file =
-    let lexbuf, cleanup = ParseLocation.mk_lexbuf (`File file) in
+    let lexbuf, cleanup = Misc.mk_lexbuf (`File file) in
+    let newline = Loc.newline file in
     let k_exn () = cleanup () in
-    let aux = parse_aux ~k_exn lexbuf Parse.Incremental.file in
+    let aux = parse_aux ~k_exn newline lexbuf Parser.Incremental.file in
     let res = aux () in
     let () = cleanup () in
     res
 
   let parse_input i =
-    let lexbuf, cleanup = ParseLocation.mk_lexbuf i in
-    if not Ty.incremental then
+    let lexbuf, cleanup = Misc.mk_lexbuf i in
+    let newline = Loc.newline (Misc.filename_of_input i) in
+    if not Ty.incremental then begin
       (* If incremental mode is not supported, raise an error rather than
          do weird things. *)
-      raise (Loc.Syntax_error (Loc.of_lexbuf lexbuf,
-                               "Input format does not support incrmental parsing"));
+      let msg fmt = Format.fprintf fmt ": @[<hov>%a@]"
+          Format.pp_print_text "Input format does not support incremental parsing"
+      in
+      raise (Loc.Syntax_error (Loc.of_lexbuf lexbuf, msg))
+    end;
     let k_exn () = Dolmen_line.consume lexbuf in
-    let aux = parse_aux ~k_exn lexbuf Parse.Incremental.input in
+    let aux = parse_aux ~k_exn newline lexbuf Parser.Incremental.input in
     aux, cleanup
 
 end
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/vec.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/vec.ml
new file mode 100644
index 0000000000000000000000000000000000000000..36d7085cc02b28943a5c68c07ddf21a6b92a23c4
--- /dev/null
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/vec.ml
@@ -0,0 +1,79 @@
+
+(* This file is free software, part of dolmen. See file "LICENSE" for more information *)
+
+
+(* Modules and aliases *)
+(* ************************************************************************* *)
+
+type 'a t = {
+  mutable data : 'a array;
+  mutable sz : int;
+}
+
+let make n x =
+  { data = Array.make n x; sz = 0 }
+
+let[@inline] create () =
+  { data = [||]; sz = 0}
+
+let[@inline] clear s =
+  s.data <- [||];
+  s.sz <- 0
+
+let[@inline] shrink t i =
+  assert (i >= 0);
+  assert (i<=t.sz);
+  t.sz <- i
+
+let[@inline] pop t =
+  if t.sz = 0 then invalid_arg "vec.pop";
+  let x = Array.unsafe_get t.data (t.sz - 1) in
+  t.sz <- t.sz - 1;
+  x
+
+let[@inline] size t = t.sz
+
+let[@inline] is_empty t = t.sz = 0
+
+let[@inline] is_full t = Array.length t.data = t.sz
+
+let[@inline] copy t : _ t =
+  let data = Array.copy t.data in
+  {t with data}
+
+(* grow the array *)
+let[@inline never] grow_to_double_size t x : unit =
+  if Array.length t.data = Sys.max_array_length then (
+    failwith "vec: cannot resize";
+  );
+  let size =
+    min Sys.max_array_length (max 4 (2 * Array.length t.data))
+  in
+  let arr' = Array.make size x in
+  Array.blit t.data 0 arr' 0 (Array.length t.data);
+  t.data <- arr';
+  assert (Array.length t.data > t.sz);
+  ()
+
+let[@inline] get t i =
+  if i < 0 || i >= t.sz then invalid_arg "vec.get";
+  Array.unsafe_get t.data i
+
+let[@inline] last t =
+  if t.sz = 0 then invalid_arg "vec.last";
+  Array.unsafe_get t.data (t.sz - 1)
+
+let[@inline] push t x : unit =
+  if is_full t then grow_to_double_size t x;
+  Array.unsafe_set t.data t.sz x;
+  t.sz <- t.sz + 1
+
+let[@inline] set t i v =
+  if i < 0 || i > t.sz then invalid_arg "vec.set";
+  if i = t.sz then (
+    push t v
+  ) else (
+    Array.unsafe_set t.data i v
+  )
+
+
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/vec.mli b/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/vec.mli
new file mode 100644
index 0000000000000000000000000000000000000000..81b0f17879b055a1ce575635d14c811b9ac8f749
--- /dev/null
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/standard/vec.mli
@@ -0,0 +1,66 @@
+
+(* This file is free software, part of dolmen. See file "LICENSE" for more information *)
+
+(** Resieable arrays
+
+    This is a minimalistic implementation of resizeable arrays. *)
+
+
+(** {1 Type and array creation} *)
+
+type 'a t
+(** Abstract type of vectors of 'a *)
+
+val make : int -> 'a -> 'a t
+(** [make cap dummy] creates a new vector filled with [dummy]. The vector
+    is initially empty but its underlying array has capacity [cap].
+    [dummy] will stay alive as long as the vector *)
+
+val create : unit -> 'a t
+(** Create a fresh vector. *)
+
+val copy : 'a t -> 'a t
+(** Fresh copy *)
+
+
+(** {1 Size manipulation} *)
+
+val size : 'a t -> int
+(** Size of the vector, aka number of elements in the vector. *)
+
+val is_empty : 'a t -> bool
+(** Is the vector empty ? *)
+
+val is_full : 'a t -> bool
+(** Is the capacity of the vector equal to the number of its elements? *)
+
+val clear : 'a t -> unit
+(** Set size to 0, doesn't free elements *)
+
+val shrink : 'a t -> int -> unit
+(** [shrink vec sz] resets size of [vec] to [sz].
+    Assumes [sz >=0 && sz <= size vec] *)
+
+
+(** {Get/Set operations} *)
+
+val get : 'a t -> int -> 'a
+(** get the element at the given index, or
+    @raise Invalid_argument if the index is not valid *)
+
+val last : 'a t -> 'a
+(** get the last element, or
+    @raise Invalid_argument if the vector is empty *)
+
+val set : 'a t -> int -> 'a -> unit
+(** set the element at the given index, either already set or the first
+    free slot if [not (is_full vec)], or
+    @raise Invalid_argument if the index is not valid *)
+
+val push : 'a t -> 'a -> unit
+(** Push element into the vector *)
+
+val pop : 'a t -> 'a
+(** Pop last element and return it.
+    @raise Invalid_argument if the vector is empty *)
+
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/arith.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/arith.ml
index 9c50eb48833e159242ecdf4117fffcdefe509abb..930690bfc3917bd03fea2ff195ced80398406daa 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/arith.ml
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/arith.ml
@@ -1,11 +1,527 @@
 
-open Dolmen
+module Id = Dolmen.Std.Id
+module Term = Dolmen.Std.Term
 
 (* Smtlib arithmetic (integer and reals) *)
 (* ************************************************************************ *)
 
 module Smtlib2 = struct
 
+  (* Classification of terms w.r.t. linearity, as per the specification
+     of the SMTLIB. Note that there exists 2 "versions" of linearity in the
+     SMTLIB: most of the linear arithmetic logics (e.g. AUFLIRA, LIA, LRA,
+     QF_LIA, QF_UFLIA, QF_UFLRA, QF_LRA, UFLRA)
+     specify linear terms as terms of the form c, ( * x c), ( * c x) where:
+       - x is a free constant of sort Int or Real and
+       - c is an integer or rational coefficient, respectively.
+     Whereas some logics (e.g. AUFLIA, QF_AUFLIA), use the following:
+       - x is a free constant or a term with top symbol not in Ints, and
+       - c is a term of the form n or (- n) for some numeral n.
+
+     Note that in this context "symbol" actually means a constant or
+     quantified variable.
+
+
+     Additionally, difference logic is a hell of specification. There are
+     about as many specs of difference logic than logics that use it.
+     Currently, there are three different difference logics:
+     - integer difference logic, as per the spec of QF_IDL
+     - real difference logic, as per the spec of QF_RDL
+     - UFIDL difference logic, as per the spec of QF_UFIDL
+
+     There are therefore a few different "variants" of arithmetic that one
+     can typecheck for:
+     - regular arithmetic where everything is allowed
+     - lenient linear arithmetic (as specified by AUFLIA)
+     - strict linear arithmetic (as specified by other logics)
+     - integer difference logic
+     - real difference logic
+     - difference logic in UFIDL
+  *)
+  type arith =
+    | Regular
+    | Linear of [ `Large | `Strict ]
+    | Difference of [ `IDL | `RDL | `UFIDL ]
+
+  (* In order to establish the needed classification and correctly raise warnings
+     or errors, we first need a fine-grained view of terms according to an arithmetic
+     point of view, which is what the following represent. *)
+  type view =
+    | Numeral of string
+    | Decimal of string
+    | Negation of Term.t
+    | Addition of Term.t list
+    | Subtraction of Term.t list
+    | Division of Term.t * Term.t
+    | Complex_arith
+    | Variable of Id.t
+    | Constant of Id.t
+    | Top_symbol_not_in_arith
+
+  (* Results of filters that enforce restrictions such as linearity. Due to the
+     confusion created by the 2 different specs, some breach of restrictions
+     can be classified as warnings so that they can be recovered from. *)
+  type filter_res =
+    | Ok
+    | Warn of string
+    | Error of string
+
+  (* Low-level arithmetic view of terms *)
+  module View(Type : Tff_intf.S) = struct
+
+    (* View of arithmetic expressions *)
+    type t = view
+
+    let print fmt (t : t) =
+      match t with
+      | Numeral s -> Format.fprintf fmt "the numeral '%s'" s
+      | Decimal s -> Format.fprintf fmt "the decimal '%s'" s
+      | Negation _ -> Format.fprintf fmt "a negation"
+      | Addition _ -> Format.fprintf fmt "an addition"
+      | Subtraction _ -> Format.fprintf fmt "a subtraction"
+      | Division _ -> Format.fprintf fmt "a division"
+      | Complex_arith -> Format.fprintf fmt "a complex arithmetic expression"
+      | Variable v -> Format.fprintf fmt "the quantified variable %a" Id.print v
+      | Constant c -> Format.fprintf fmt "the constant symbol %a" Id.print c
+      | Top_symbol_not_in_arith ->
+        Format.fprintf fmt "an arbitrary (not arithmetic) expression"
+
+    let expect_error v v' expected =
+      Format.asprintf "expects %s but was given:\n- %a\n- %a"
+        expected print v print v'
+
+    let rec view ~parse version env (t : Term.t) =
+      match t.term with
+      | Symbol { Id.ns = Id.Value Id.Integer; name } -> Numeral name
+      | Symbol { Id.ns = Id.Value Id.Real; name } -> Decimal name
+
+      | App ({ term = Symbol { Id.ns = Id.Term; name = "-"; }; _ }, [e])
+        -> Negation e
+
+      | App ({ term = Symbol { Id.ns = Id.Term; name = "+"; }; _ }, ((_ :: _) as args))
+        -> Addition args
+
+      | App ({ term = Symbol { Id.ns = Id.Term; name = "-"; }; _ }, ((_ :: _) as args))
+        -> Subtraction args
+
+      | App ({ term = Symbol { Id.ns = Id.Term; name = "/"; }; _ }, [a; b])
+        -> Division (a, b)
+
+      | Symbol id -> view_id ~parse version env id []
+      | App ({ term = Symbol id; _}, args) -> view_id ~parse version env id args
+
+      | Builtin b | App ({ term = Builtin b; _ }, _) ->
+        begin match parse version env (Type.Builtin b) with
+          | #Type.builtin_res -> Complex_arith
+          | #Type.not_found -> Top_symbol_not_in_arith
+        end
+
+      (* Catch-all *)
+      | _ -> Top_symbol_not_in_arith
+
+    (* We here use the fact that smtlib forbids shadowing, hence the order
+       of the lookups does not matter.
+       Additionally, we do not want the lookup to go through all the
+       builtins as it is not necessary, hence the manual unfolding of
+       the Type.find_bound function. *)
+    and view_id ~parse version env id args =
+      match Type.find_var env id with
+      | `Letin (e, _, _) -> view ~parse version env e
+      | #Type.var ->
+        begin match args with
+          | [] -> Variable id
+          | _ -> Top_symbol_not_in_arith
+        end
+      | #Type.not_found ->
+        begin match Type.find_global env id with
+          | #Type.cst ->
+            begin match args with
+              | [] -> Constant id
+              | _ -> Top_symbol_not_in_arith
+            end
+          | #Type.not_found ->
+            begin match parse version env (Type.Id id) with
+              | #Type.builtin_res -> Complex_arith
+              | #Type.not_found -> Top_symbol_not_in_arith
+            end
+        end
+
+    let rec difference_count view t :
+      [ `Ok of Id.t * int | `Error of string ] =
+      match (view t : view) with
+      | Variable v -> `Ok (v, 1)
+      | Constant c -> `Ok (c, 1)
+      | Addition l -> difference_count_list view l
+      | v -> `Error (
+          Format.asprintf "addition in real difference logic expects \
+                           either variables/constants or an addition of \
+                           variables/constants, but was here given %a" print v)
+
+    and difference_count_list view = function
+      | h :: r ->
+        begin match difference_count view h with
+          | (`Error _) as res -> res
+          | `Ok (symb, n) ->
+            difference_count_list_aux view n symb r
+          end
+      | [] -> assert false
+
+    and difference_count_list_aux view n s = function
+      | [] -> `Ok (s, n)
+      | t :: r ->
+        begin match difference_count view t with
+          | (`Error _) as res -> res
+          | `Ok (s', n') ->
+            if Id.equal s s' then
+              difference_count_list_aux view (n + n') s r
+            else
+              `Error (
+                Format.asprintf "addition in real difference logic expects
+                                 n-th times the same variable/constant, but was
+                                 here applied to %a and %a which are different"
+                  Id.print s Id.print s')
+        end
+
+
+  end
+
+  module Classification = struct
+
+    (* We can now classify terms according to the following kinds:
+       - coefficients, i.e. integer or rational literals, as per the spec above.
+       Coefficients consists of:
+         + raw literals (i.e. in the Id.Value namespace)
+         + the negation of (i.e. application of term symbol "-" to) a raw literal
+         + the division of (i.e. an application of term symbol "/" to) of an
+           integer coeficient by a raw literal different from zero.
+       - complex arithmetic expressions, i.e. expressions whose top-level symbol
+         is a builtin symbol of arithmetic (e.g. '+', '-', '*', ...), but that
+         are not coefficients.
+       - nullary constant symbols (standalone, or applied to the empty list),
+         and quantified variables
+       - all other expressions *)
+    type t =
+      | Int_coefficient
+      | Rat_coefficient
+      | Complex_arith
+      | Variable_or_constant
+      | Top_symbol_not_in_arith
+
+    let print fmt (t: t) =
+      match t with
+      | Int_coefficient -> Format.fprintf fmt "an integer coefficient"
+      | Rat_coefficient -> Format.fprintf fmt "a rational coefficient"
+      | Complex_arith -> Format.fprintf fmt "a complex arithmetic expression"
+      | Variable_or_constant -> Format.fprintf fmt "a symbol (or quantified variable)"
+      | Top_symbol_not_in_arith ->
+        Format.fprintf fmt "an arbitrary expression with top symbol not in Arithmetic"
+
+    let expect_error c c' expected =
+      Format.asprintf "expects %s but was given:\n- %a\n- %a"
+        expected print c print c'
+
+    let rec classify view t =
+      match (view t: view) with
+      | Numeral _ -> Int_coefficient
+      | Decimal _ -> Rat_coefficient
+      | Addition _ -> Complex_arith
+      | Subtraction _ -> Complex_arith
+      | Negation t' ->
+        begin match (view t': view) with
+          | Numeral _ -> Int_coefficient
+          | Decimal _ -> Rat_coefficient
+          | _ -> Complex_arith
+        end
+      | Division (numerator, denominator) ->
+        begin match (classify view numerator, view denominator) with
+          | Int_coefficient, Numeral s when s <> "0"
+            -> Rat_coefficient
+          | _ -> Complex_arith
+        end
+      | Complex_arith -> Complex_arith
+      | Variable _ | Constant _ -> Variable_or_constant
+      | Top_symbol_not_in_arith -> Top_symbol_not_in_arith
+
+
+  end
+
+  (* Filter for arithmetic *)
+  module Filter(Type : Tff_intf.S) = struct
+
+    module V = View(Type)
+
+    let bad_arity operator logic n =
+      Error (Format.asprintf
+               "%s in %s must have exactly %d arguments" operator logic n)
+
+    let forbidden operator logic =
+      Error (Format.asprintf "%s is not allowed in %s" operator logic)
+
+    (* Filter helpers / Individual restriction filters *)
+
+    let minus_dl parse version env = function
+      | [ a ] ->
+        begin match V.view ~parse version env a with
+          | Numeral _
+          | Decimal _ -> Ok
+          | v ->
+            Error (Format.asprintf
+                     "unary subtraction in difference logic expects \
+                      a literal, but was given %a"
+                     V.print v)
+        end
+      | _ -> bad_arity "unary subtraction" "difference logic" 1
+
+    let sub_idl parse version env = function
+      | [ a; b ] ->
+        begin match Classification.classify (V.view ~parse version env) a,
+                    Classification.classify (V.view ~parse version env) b with
+        | Variable_or_constant, Variable_or_constant -> Ok
+        | v, v' ->
+          Error (Format.asprintf "subtraction in difference logic %s"
+                   (Classification.expect_error v v' "two constants/variables"))
+        end
+      | _ -> bad_arity "subtraction" "integer difference logic" 2
+
+    let sub_rdl parse version env = function
+      | [ a; b ] ->
+        begin match V.difference_count (V.view ~parse version env) a,
+                    V.difference_count (V.view ~parse version env) b with
+        | `Error msg, _
+        | _, `Error msg
+          -> Error msg
+        | `Ok (_, n), `Ok (_, n') ->
+          if n = n' then Ok
+          else Error (
+              Format.asprintf "subtraction in real difference logic \
+                               expects both sides to be sums of the same \
+                               length, but here the sums have lengths \
+                               %d and %d" n n')
+        end
+      | _ -> bad_arity "subtraction" "real difference logic" 2
+
+    let op_ufidl parse version env args =
+      let rec aux non_numeral_seen = function
+        | [] -> Ok
+        | t :: r ->
+          begin match V.view ~parse version env t with
+            | Numeral _ -> aux non_numeral_seen r
+            | _ ->
+              if non_numeral_seen then
+                Error (Format.asprintf "subtraction in difference logic (QF_UFIDL version) \
+                                        expects all but at most one of its arguments to be \
+                                        numerals")
+              else
+                aux true r
+          end
+      in
+      aux false args
+
+    let add_rdl parse version env args =
+      match V.difference_count_list (V.view ~parse version env) args with
+      | `Ok _ -> Ok
+      | `Error msg -> Error msg
+
+    let div_linear parse version env = function
+      | [ a; b ] ->
+        begin match Classification.classify (V.view ~parse version env) a with
+          | Int_coefficient ->
+            begin match V.view ~parse version env b with
+              | Numeral "0" ->
+                Error (Format.asprintf "division in linear arithmetic \
+                                        expects a non-zero denominator")
+              | Numeral _ -> Ok
+              | v ->
+                Error (Format.asprintf "division in linear arithmetic \
+                                        expects a constant positive \
+                                        integer literal as denominator, \
+                                        but was given %a"
+                         V.print v)
+            end
+          | _ ->
+            let v = V.view ~parse version env a in
+            let msg =
+              Format.asprintf "division in linear arithmetic \
+                               expects as first argument an integer \
+                               coeficient, i.e. either an integer  \
+                               numeral or the negation of one, but \
+                               here was given %a" V.print v
+            in
+            begin match v with
+              (* Allow "xxx.0" rationals with a warning *)
+              | Decimal s when Misc.Strings.is_suffix s ~suffix:".0" -> Warn msg
+              | _ -> Error msg
+            end
+        end
+      | _ -> bad_arity "division" "linear arithmetic" 2
+
+    let mul_linear_msg ~strict c c' =
+      Format.asprintf "multiplication in %slinear arithmetic %s"
+        (if strict then "strict " else "")
+        (Classification.expect_error c c'
+           (if strict
+            then "an integer or rational literal and a symbol (variable or constant)"
+            else "an integer or rational literal and a non-arithmetic expression"))
+
+    let mul_linear ~strict parse version env = function
+      | [ a; b ] ->
+        begin match Classification.classify (V.view ~parse version env) a,
+                    Classification.classify (V.view ~parse version env) b with
+        | (Int_coefficient | Rat_coefficient), Variable_or_constant
+        | Variable_or_constant, (Int_coefficient | Rat_coefficient)
+          -> Ok
+        | ((Int_coefficient | Rat_coefficient) as c), (Top_symbol_not_in_arith as c')
+        | (Top_symbol_not_in_arith as c), ((Int_coefficient | Rat_coefficient) as c')
+          ->
+          if strict then Warn (mul_linear_msg ~strict c c') else Ok
+        | ((Int_coefficient | Rat_coefficient) as c),
+          ((Int_coefficient | Rat_coefficient | Complex_arith) as c')
+        | (Complex_arith as c'), ((Int_coefficient | Rat_coefficient) as c) ->
+          Warn (mul_linear_msg ~strict c c')
+        | c, c' ->
+          Error (mul_linear_msg ~strict c c')
+        end
+      | _ -> bad_arity "multiplication" "linear arithmetic" 2
+
+    let comp_idl parse version env = function
+      | [ a; b ] ->
+        begin match V.view ~parse version env a,
+                    V.view ~parse version env b with
+        | (Variable _ | Constant _),
+          (Variable _ | Constant _) -> Ok
+        (* If the first argument is a subtraction, it must have passed
+           the sub_wrapper filter, which means both its side must be
+           constants, so no need to check it here again. *)
+        | Subtraction _, Numeral _ -> Ok
+        | Subtraction _, Negation _ -> Ok
+        (* error case *)
+        | v, v' ->
+          Error (Format.asprintf "comparison in integer difference logic %s"
+                   (V.expect_error v v'
+                      "a substraction on the left and a (possibly negated) \
+                       integer literal on the right"))
+        end
+      | _ -> bad_arity "comparison" "integer difference logic" 2
+
+    let comp_rdl parse version env = function
+      | [ a; b ] ->
+        begin match V.view ~parse version env a,
+                    V.view ~parse version env b with
+        | (Variable _ | Constant _),
+          (Variable _ | Constant _) -> Ok
+        (* If the first argument is a subtraction, it must have passed
+           the sub_wrapper filter, which means both its side must be
+           constants, so no need to check it here again. *)
+        | Subtraction _, Numeral _ -> Ok
+        | Subtraction _, Negation _ -> Ok
+        (* Syntactic sugar *)
+        | Subtraction [x; y], Division _ ->
+          begin match V.difference_count (V.view ~parse version env) x,
+                      V.difference_count (V.view ~parse version env) y with
+          | `Error msg, _
+          | _, `Error msg -> Error msg
+          | `Ok (_, n), `Ok (_, n') ->
+            (* since the sub filter passed, we should have n = n' *)
+            if n = 1 && n' = 1 then Ok
+            else
+              Error (
+                Format.asprintf "in real difference logic, when comparing \
+                                 the result of a subtraction with a rational \
+                                 number, each side of the subtraction can only \
+                                 contain a single variable/constant, but here there
+                                 was %d" n)
+          end
+        (* Error case *)
+        | v, v' ->
+          Error (
+            Format.asprintf "comparison in difference logic %s"
+              (V.expect_error v v'
+                 "a subtraction on the left and a (possibly negated) \
+                  integer literal on the right"))
+        end
+      | _ -> bad_arity "comparison" "real difference logic" 2
+
+
+    (* Global filters *)
+
+    let minus arith parse version env args =
+      match arith with
+      | Regular -> Ok
+      | Linear _ -> Ok
+      | Difference (`IDL | `RDL) ->
+        minus_dl parse version env args
+      | Difference `UFIDL ->
+        forbidden "unary subtraction" "difference logic (QF_UFIDL variant)"
+
+    let sub arith parse version env args =
+      match arith with
+      | Regular -> Ok
+      | Linear _ -> Ok
+      | Difference `IDL -> sub_idl parse version env args
+      | Difference `RDL -> sub_rdl parse version env args
+      | Difference `UFIDL -> op_ufidl parse version env args
+
+    let add arith parse version env args =
+      match arith with
+      | Regular -> Ok
+      | Linear _ -> Ok
+      | Difference `IDL -> forbidden "addition" "integer difference logic"
+      | Difference `RDL -> add_rdl parse version env args
+      | Difference `UFIDL -> op_ufidl parse version env args
+
+    let mul arith parse version env args =
+      match arith with
+      | Regular -> Ok
+      | Linear `Strict -> mul_linear ~strict:true parse version env args
+      | Linear `Large -> mul_linear ~strict:false parse version env args
+      | Difference `IDL -> forbidden "multiplication" "integer difference logic"
+      | Difference `RDL -> forbidden "multiplication" "real difference logic"
+      | Difference `UFIDL -> forbidden "multiplication" "difference logic (QF_UFIDL variant)"
+
+    let div arith parse version env args =
+      match arith with
+      | Regular -> Ok
+      | Linear _ -> div_linear parse version env args
+      | Difference `IDL -> forbidden "division" "integer difference logic"
+      | Difference `RDL -> div_linear parse version env args
+      | Difference `UFIDL -> forbidden "division" "difference logic (QF_UFIDL variant)"
+
+    let ediv arith _args =
+      match arith with
+      | Regular -> Ok
+      | Linear _ -> forbidden "euclidean division" "linear arithmetic"
+      | Difference _ -> forbidden "euclidean division" "difference logic"
+
+    let mod_ arith _args =
+      match arith with
+      | Regular -> Ok
+      | Linear _ -> forbidden "mod" "linear arithmetic"
+      | Difference _ -> forbidden "mod" "difference logic"
+
+    let abs arith _args =
+      match arith with
+      | Regular -> Ok
+      | Linear _ -> forbidden "abs" "linear arithmetic"
+      | Difference _ -> forbidden "abs" "difference logic"
+
+    let comp arith parse version env args =
+      match arith with
+      | Regular -> Ok
+      | Linear _ -> Ok
+      | Difference `IDL -> comp_idl parse version env args
+      | Difference `RDL -> comp_rdl parse version env args
+      | Difference `UFIDL -> Ok
+
+    let divisible arith _args =
+      match arith with
+      | Regular -> Ok
+      | Linear _ -> forbidden "divisible" "linear arithmetic"
+      | Difference _ -> forbidden "divisible" "difference logic"
+
+  end
+
+  (* Integer arithmetics *)
+
   module Int = struct
 
     module Tff
@@ -13,66 +529,82 @@ module Smtlib2 = struct
         (Ty : Dolmen.Intf.Ty.Smtlib_Int with type t := Type.Ty.t)
         (T : Dolmen.Intf.Term.Smtlib_Int with type t := Type.T.t) = struct
 
-      let app1 env ast args name mk =
-        Base.make_op1 (module Type) env ast name args
-          (fun t -> Type.Term (mk (Type.parse_term env t)))
+      module F = Filter(Type)
 
-      let app2 env ast args name mk =
-        Base.make_op2 (module Type) env ast name args
-          (fun (a, b) ->
-             Type.Term (mk (Type.parse_term env a) (Type.parse_term env b)))
+      type _ Type.warn +=
+        | Restriction : string -> Term.t Type.warn
 
-      let app_left env ast args name mk =
-        Base.make_assoc (module Type) env ast name args
-          (fun l -> Type.Term (Base.fold_left_assoc mk (List.map (Type.parse_term env) l)))
+      type _ Type.err +=
+        | Forbidden : string -> Term.t Type.err
 
-      let app_chain env ast args name mk =
-        Base.make_chain (module Type) env ast name args (fun l ->
-            let l' = List.map (Type.parse_term env) l in
-            Type.Term (Base.map_chain (module Type) mk l')
-          )
+      let check env filter ast args =
+        match filter args with
+        | Ok -> ()
+        | Warn msg -> Type._warn env (Ast ast) (Restriction msg)
+        | Error msg -> Type._error env (Ast ast) (Forbidden msg)
 
-      let split_id = Dolmen_std.Misc.split_on_char '\000'
+      let check1 env filter ast a = check env filter ast [a]
+      let check2 env filter ast a b = check env filter ast [a; b]
 
-      let parse _version env ast s args =
+      let rec parse ~arith version env s =
         match s with
         (* type *)
         | Type.Id { Id.ns = Id.Sort; name = "Int"; } ->
-          Base.make_op0 (module Type) env ast "Int" args
-            (fun () -> Type.Ty Ty.int)
+          `Ty (Base.app0 (module Type) env "Int" Ty.int)
         (* values *)
         | Type.Id { Id.ns = Id.Value Id.Integer; name; } ->
-          Base.make_op0 (module Type) env ast name args
-            (fun () -> Type.Term (T.int name))
+          `Term (Base.app0 (module Type) env name (T.mk name))
         (* terms *)
-        | Type.Id { Id.ns = Id.Term; name; } ->
-          begin match name, args with
-            | "-", [x] ->
-              Some (Type.Term (T.minus (Type.parse_term env x)))
-            | "-", _ -> app_left env ast args "-" T.sub
-            | "+", _ -> app_left env ast args "+" T.add
-            | "*", _ -> app_left env ast args "*" T.mul
-            | "div", _ -> app_left env ast args "div" T.div
-            | "mod", _ -> app2 env ast args "mod" T.rem
-            | "abs", _ -> app1 env ast args "abs" T.abs
-            | "<=", _ -> app_chain env ast args "<=" T.le
-            | "<", _ -> app_chain env ast args "<" T.lt
-            | ">=", _ -> app_chain env ast args ">=" T.ge
-            | ">", _ -> app_chain env ast args ">" T.gt
-            | _ -> begin match split_id name with
-                | "divisible" :: r ->
-                  begin match r with
-                    | [n] ->
-                      Base.make_op1 (module Type) env ast "divisible" args
-                        (fun t -> Type.Term (T.divisible n (Type.parse_term env t)))
-                    | _ ->
-                      let err = Type.Bad_op_arity ("divisible", 1, List.length r) in
-                      raise (Type.Typing_error (err, env, ast))
-                  end
-                | _ -> None
-              end
+        | Type.Id ({ Id.ns = Id.Term; name; } as id) ->
+          begin match name with
+            | "-" ->
+              `Term (fun ast args -> match args with
+                  | [x] ->
+                    check env (F.minus arith (parse ~arith) version env) ast args;
+                    T.minus (Type.parse_term env x)
+                  | _ ->
+                    Base.term_app_left (module Type) env "-" T.sub ast args
+                      ~check:(check env (F.sub arith (parse ~arith) version env))
+                )
+            | "+" ->
+              `Term (Base.term_app_left (module Type) env "+" T.add
+                    ~check:(check env (F.add arith (parse ~arith) version env)))
+            | "*" ->
+              `Term (Base.term_app_left (module Type) env "*" T.mul
+                       ~check:(check env (F.mul arith (parse ~arith) version env)))
+            | "div" ->
+              `Term (Base.term_app_left (module Type) env "div" T.div
+                       ~check:(check env (F.ediv arith)))
+            | "mod" ->
+              `Term (Base.term_app2 (module Type) env "mod" T.rem
+                    ~check:(check2 env (F.mod_ arith)))
+            | "abs" ->
+              `Term (Base.term_app1 (module Type) env "abs" T.abs
+                    ~check:(check1 env (F.abs arith)))
+            | "<=" ->
+              `Term (Base.term_app_chain (module Type) env "<=" T.le
+                    ~check:(check env (F.comp arith (parse ~arith) version env)))
+            | "<" ->
+              `Term (Base.term_app_chain (module Type) env "<" T.lt
+                    ~check:(check env (F.comp arith (parse ~arith) version env)))
+            | ">=" ->
+              `Term (Base.term_app_chain (module Type) env ">=" T.ge
+                    ~check:(check env (F.comp arith (parse ~arith) version env)))
+            | ">" ->
+              `Term (Base.term_app_chain (module Type) env ">" T.gt
+                    ~check:(check env (F.comp arith (parse ~arith) version env)))
+            | _ -> Base.parse_id id
+                     ~k:(function _ -> `Not_found)
+                     ~err:(Base.bad_ty_index_arity (module Type) env)
+                     [
+                       "divisible", `Unary (function n ->
+                           `Term (Base.term_app1 (module Type) env
+                                    "divisible" (T.divisible n)
+                                    ~check:(check1 env (F.divisible arith)))
+                         );
+                     ]
           end
-        | _ -> None
+        | _ -> `Not_found
 
     end
   end
@@ -84,42 +616,64 @@ module Smtlib2 = struct
         (Ty : Dolmen.Intf.Ty.Smtlib_Real with type t := Type.Ty.t)
         (T : Dolmen.Intf.Term.Smtlib_Real with type t := Type.T.t) = struct
 
-      let app_left env ast args name mk =
-        Base.make_assoc (module Type) env ast name args
-          (fun l -> Type.Term (Base.fold_left_assoc mk (List.map (Type.parse_term env) l)))
+      module F = Filter(Type)
+
+      type _ Type.warn +=
+        | Restriction : string -> Term.t Type.warn
+
+      type _ Type.err +=
+        | Forbidden : string -> Term.t Type.err
 
-      let app_chain env ast args name mk =
-        Base.make_chain (module Type) env ast name args (fun l ->
-            let l' = List.map (Type.parse_term env) l in
-            Type.Term (Base.map_chain (module Type) mk l')
-          )
+      let check env filter ast args =
+        match filter args with
+        | Ok -> ()
+        | Warn msg -> Type._warn env (Ast ast) (Restriction msg)
+        | Error msg -> Type._error env (Ast ast) (Forbidden msg)
 
-      let parse _version env ast s args =
+      let rec parse ~arith version env s =
         match s with
         (* type *)
         | Type.Id { Id.ns = Id.Sort; name = "Real"; } ->
-          Base.make_op0 (module Type) env ast "Real" args
-            (fun () -> Type.Ty Ty.real)
+          `Ty (Base.app0 (module Type) env "Real" Ty.real)
         (* values *)
         | Type.Id { Id.ns = Id.Value (Id.Integer | Id.Real); name; } ->
-          Base.make_op0 (module Type) env ast name args
-            (fun () -> Type.Term (T.real name))
+          `Term (Base.app0 (module Type) env name (T.mk name))
         (* terms *)
         | Type.Id { Id.ns = Id.Term; name; } ->
-          begin match name, args with
-            | "-", [x] ->
-              Some (Type.Term (T.minus (Type.parse_term env x)))
-            | "-", _ -> app_left env ast args "-" T.sub
-            | "+", _ -> app_left env ast args "+" T.add
-            | "*", _ -> app_left env ast args "*" T.mul
-            | "/", _ -> app_left env ast args "/" T.div
-            | "<=", _ -> app_chain env ast args "<=" T.le
-            | "<", _ -> app_chain env ast args "<" T.lt
-            | ">=", _ -> app_chain env ast args ">=" T.ge
-            | ">", _ -> app_chain env ast args ">" T.gt
-            | _ -> None
+          begin match name with
+            | "-" -> `Term (fun ast args ->
+                match args with
+                | [x] ->
+                  check env (F.minus arith (parse ~arith) version env) ast args;
+                  T.minus (Type.parse_term env x)
+                | _ ->
+                  Base.term_app_left (module Type) env "-" T.sub ast args
+                    ~check:(check env (F.sub arith (parse ~arith) version env))
+              )
+            | "+" ->
+              `Term (Base.term_app_left (module Type) env "+" T.add
+                       ~check:(check env (F.add arith (parse ~arith) version env)))
+            | "*" ->
+              `Term (Base.term_app_left (module Type) env "*" T.mul
+                       ~check:(check env (F.mul arith (parse ~arith) version env)))
+            | "/" ->
+              `Term (Base.term_app_left (module Type) env "/" T.div
+                       ~check:(check env (F.div arith (parse ~arith) version env)))
+            | "<=" ->
+              `Term (Base.term_app_chain (module Type) env "<=" T.le
+                       ~check:(check env (F.comp arith (parse ~arith) version env)))
+            | "<" ->
+              `Term (Base.term_app_chain (module Type) env "<" T.lt
+                       ~check:(check env (F.comp arith (parse ~arith) version env)))
+            | ">=" ->
+              `Term (Base.term_app_chain (module Type) env ">=" T.ge
+                       ~check:(check env (F.comp arith (parse ~arith) version env)))
+            | ">" ->
+              `Term (Base.term_app_chain (module Type) env ">" T.gt
+                       ~check:(check env (F.comp arith (parse ~arith) version env)))
+            | _ -> `Not_found
           end
-        | _ -> None
+        | _ -> `Not_found
 
     end
   end
@@ -132,131 +686,129 @@ module Smtlib2 = struct
         (T : Dolmen.Intf.Term.Smtlib_Real_Int with type t := Type.T.t
                                                and type ty := Type.Ty.t) = struct
 
-      type Type.err +=
-        | Expected_arith_type of Type.Ty.t
-
-      let dispatch1 env ast (mk_int, mk_real) t =
-        let ty = T.ty t in
-        if Ty.(equal int) ty then mk_int t
-        else if Ty.(equal real) ty then mk_real t
-        else begin
-          let err = Expected_arith_type ty in
-          raise (Type.Typing_error (err, env, ast))
-        end
-
-      let dispatch2 env ast (mk_int, mk_real) a b =
-        let a_ty = T.ty a in
-        let b_ty = T.ty b in
-        if Ty.(equal int) a_ty then
-          if Ty.(equal real) b_ty then
-            mk_real (T.Int.to_real a) b
-          else
-            mk_int a b
-        else if Ty.(equal real) a_ty then
-          if Ty.(equal int) b_ty then
-            mk_real a (T.Int.to_real b)
-          else
-            mk_real a b
-        else begin
-          let err = Expected_arith_type a_ty in
-          raise (Type.Typing_error (err, env, ast))
-        end
-
-      let promote_int_to_real _env _ast mk_real a b =
-        let a_ty = T.ty a in
-        let b_ty = T.ty b in
-        let c, d =
-          if Ty.(equal int a_ty) && Ty.(equal int b_ty) then
-            (T.Int.to_real a), (T.Int.to_real b)
-          else
-            a, b
-        in
-        mk_real c d
-
-      let app1 env ast args name mk =
-        Base.make_op1 (module Type) env ast name args
-        (fun t -> Type.Term (mk (Type.parse_term env t)))
-
-      let app2 env ast args name mk =
-        Base.make_op2 (module Type) env ast name args
-          (fun (a, b) ->
-             Type.Term (mk (Type.parse_term env a) (Type.parse_term env b)))
-
-      let app_left env ast args name mk =
-        Base.make_assoc (module Type) env ast name args
-          (fun l -> Type.Term (Base.fold_left_assoc mk (List.map (Type.parse_term env) l)))
-
-      let app_chain env ast args name mk =
-        Base.make_chain (module Type) env ast name args (fun l ->
-            let l' = List.map (Type.parse_term env) l in
-            Type.Term (Base.map_chain (module Type) mk l')
-          )
-
-      let split_id = Dolmen_std.Misc.split_on_char '\000'
-
-      let parse _version env ast s args =
+      module F = Filter(Type)
+
+      type _ Type.warn +=
+        | Restriction : string -> Term.t Type.warn
+
+      type _ Type.err +=
+        | Forbidden : string -> Term.t Type.err
+        | Expected_arith_type : Type.Ty.t -> Term.t Type.err
+
+      let check env filter ast args =
+        match filter args with
+        | Ok -> ()
+        | Warn msg -> Type._warn env (Ast ast) (Restriction msg)
+        | Error msg -> Type._error env (Ast ast) (Forbidden msg)
+
+      let check1 env filter ast a = check env filter ast [a]
+      let check2 env filter ast a b = check env filter ast [a; b]
+
+      let dispatch1 env (mk_int, mk_real) ast t =
+        match Ty.view @@ T.ty t with
+        | `Int -> mk_int t
+        | `Real -> mk_real t
+        | _ -> Type._error env (Ast ast) (Expected_arith_type (T.ty t))
+
+      let dispatch2 env (mk_int, mk_real) ast a b =
+        match Ty.view @@ T.ty a, Ty.view @@ T.ty b with
+        | `Int, `Int -> mk_int a b
+        | `Int, `Real -> mk_real (T.Int.to_real a) b
+        | `Real, `Int -> mk_real a (T.Int.to_real b)
+        | `Real, `Real -> mk_real a b
+        | (`Int | `Real), _ -> Type._error env (Ast ast) (Expected_arith_type (T.ty b))
+        | _, (`Int | `Real) -> Type._error env (Ast ast) (Expected_arith_type (T.ty a))
+        | _, _ -> Type._error env (Ast ast) (Expected_arith_type (T.ty a))
+
+      let promote_int_to_real _env mk_real _ast a b =
+        match Ty.view @@ T.ty a, Ty.view @@ T.ty b with
+        | `Int, `Int -> mk_real (T.Int.to_real a) (T.Int.to_real b)
+        | _ -> mk_real a b
+
+      let rec parse ~arith version env s =
         match s with
+
         (* type *)
         | Type.Id { Id.ns = Id.Sort; name = "Int"; } ->
-          Base.make_op0 (module Type) env ast "Int" args
-            (fun () -> Type.Ty Ty.int)
+          `Ty (Base.app0 (module Type) env "Int" Ty.int)
         | Type.Id { Id.ns = Id.Sort; name = "Real"; } ->
-          Base.make_op0 (module Type) env ast "Real" args
-            (fun () -> Type.Ty Ty.real)
+          `Ty (Base.app0 (module Type) env "Real" Ty.real)
+
         (* values *)
         | Type.Id { Id.ns = Id.Value Id.Integer; name; } ->
-          Base.make_op0 (module Type) env ast name args
-            (fun () -> Type.Term (T.Int.int name))
+          `Term (Base.app0 (module Type) env name (T.Int.mk name))
         | Type.Id { Id.ns = Id.Value Id.Real; name; } ->
-          Base.make_op0 (module Type) env ast name args
-            (fun () -> Type.Term (T.Real.real name))
+          `Term (Base.app0 (module Type) env name (T.Real.mk name))
+
         (* terms *)
-        | Type.Id { Id.ns = Id.Term; name; } ->
-          begin match name, args with
-            | "-", [_] ->
-              app1 env ast args "-"
-                (dispatch1 env ast (T.Int.minus, T.Real.minus))
-            | "-", _ ->
-              app_left env ast args "-"
-                (dispatch2 env ast (T.Int.sub, T.Real.sub))
-            | "+", _ ->
-              app_left env ast args "+"
-                (dispatch2 env ast (T.Int.add, T.Real.add))
-            | "*", _ ->
-              app_left env ast args "*"
-                (dispatch2 env ast (T.Int.mul, T.Real.mul))
-            | "div", _ -> app_left env ast args "div" T.Int.div
-            | "mod", _ -> app2 env ast args "mod" T.Int.rem
-            | "abs", _ -> app1 env ast args "abs" T.Int.abs
-            | "/", _ ->
-              app_left env ast args "/"
-                (promote_int_to_real env ast T.Real.div)
-            | "<=", _ ->
-              app_chain env ast args "<="
-                (dispatch2 env ast (T.Int.le, T.Real.le))
-            | "<", _ ->
-              app_chain env ast args "<"
-                (dispatch2 env ast (T.Int.lt, T.Real.lt))
-            | ">=", _ ->
-              app_chain env ast args ">="
-                (dispatch2 env ast (T.Int.ge, T.Real.ge))
-            | ">", _ ->
-              app_chain env ast args ">"
-                (dispatch2 env ast (T.Int.gt, T.Real.gt))
-            | _ -> begin match split_id name with
-                | "divisible" :: r ->
-                  begin match r with
-                    | [n] ->
-                      Base.make_op1 (module Type) env ast "divisible" args
-                        (fun t -> Type.Term (T.Int.divisible n (Type.parse_term env t)))
-                    | _ ->
-                      let err = Type.Bad_op_arity ("divisible", 1, List.length r) in
-                      raise (Type.Typing_error (err, env, ast))
-                  end
-                | _ -> None
-              end
+        | Type.Id ({ Id.ns = Id.Term; name; } as id) ->
+          begin match name with
+            | "-" -> `Term (fun ast args ->
+                match args with
+                | [_] ->
+                  Base.term_app1_ast (module Type) env "-"
+                    (dispatch1 env (T.Int.minus, T.Real.minus)) ast args
+                    ~check:(check1 env (F.minus arith (parse ~arith) version env))
+                | _ ->
+                  Base.term_app_left_ast (module Type) env "-"
+                    (dispatch2 env (T.Int.sub, T.Real.sub)) ast args
+                    ~check:(check env (F.sub arith (parse ~arith) version env))
+              )
+            | "+" ->
+              `Term (Base.term_app_left_ast (module Type) env "+"
+                       (dispatch2 env (T.Int.add, T.Real.add))
+                       ~check:(check env (F.add arith (parse ~arith) version env)))
+            | "*" ->
+              `Term (Base.term_app_left_ast (module Type) env "*"
+                       (dispatch2 env (T.Int.mul, T.Real.mul))
+                       ~check:(check env (F.mul arith (parse ~arith) version env)))
+            | "div" ->
+              `Term (Base.term_app_left (module Type) env "div" T.Int.div
+                       ~check:(check env (F.ediv arith)))
+            | "mod" ->
+              `Term (Base.term_app2 (module Type) env "mod" T.Int.rem
+                       ~check:(check2 env (F.mod_ arith)))
+            | "abs" ->
+              `Term (Base.term_app1 (module Type) env "abs" T.Int.abs
+                       ~check:(check1 env (F.abs arith)))
+            | "/" ->
+              `Term (Base.term_app_left_ast (module Type) env "/"
+                       (promote_int_to_real env T.Real.div)
+                       ~check:(check env (F.div arith (parse ~arith) version env)))
+            | "<=" ->
+              `Term (Base.term_app_chain_ast (module Type) env "<="
+                       (dispatch2 env (T.Int.le, T.Real.le))
+                       ~check:(check env (F.comp arith (parse ~arith) version env)))
+            | "<" ->
+              `Term (Base.term_app_chain_ast (module Type) env "<"
+                       (dispatch2 env (T.Int.lt, T.Real.lt))
+                       ~check:(check env (F.comp arith (parse ~arith) version env)))
+            | ">=" ->
+              `Term (Base.term_app_chain_ast (module Type) env ">="
+                       (dispatch2 env (T.Int.ge, T.Real.ge))
+                       ~check:(check env (F.comp arith (parse ~arith) version env)))
+            | ">" ->
+              `Term (Base.term_app_chain_ast (module Type) env ">"
+                       (dispatch2 env (T.Int.gt, T.Real.gt))
+                       ~check:(check env (F.comp arith (parse ~arith) version env)))
+            | "to_real" ->
+              `Term (Base.term_app1 (module Type) env "to_real" T.Int.to_real)
+            | "to_int" ->
+              `Term (Base.term_app1 (module Type) env "to_int" T.Real.to_int)
+            | "is_int" ->
+              `Term (Base.term_app1 (module Type) env "is_int" T.Real.is_int)
+
+            | _ -> Base.parse_id id
+                     ~k:(function _ -> `Not_found)
+                     ~err:(Base.bad_ty_index_arity (module Type) env)
+                     [
+                       "divisible", `Unary (function n ->
+                           `Term (Base.term_app1 (module Type) env
+                                    "divisible" (T.Int.divisible n)
+                                    ~check:(check1 env (F.divisible arith))));
+                     ]
           end
-        | _ -> None
+        | _ -> `Not_found
 
     end
 
@@ -275,140 +827,127 @@ module Tptp = struct
       (T : Dolmen.Intf.Term.Tptp_Arith with type t := Type.T.t
                                         and type ty := Type.Ty.t) = struct
 
-    type Type.err +=
-      | Expected_arith_type of Type.Ty.t
-      | Cannot_apply_to of Type.Ty.t
+    type _ Type.err +=
+      | Expected_arith_type : Type.Ty.t -> Term.t Type.err
+      | Cannot_apply_to : Type.Ty.t -> Term.t Type.err
 
     let _invalid env ast ty _ =
-      raise (Type.Typing_error (Cannot_apply_to ty, env, ast))
+      Type._error env (Ast ast) (Cannot_apply_to ty)
 
-    let dispatch1 env ast (mk_int, mk_rat, mk_real) t =
+    let dispatch1 env (mk_int, mk_rat, mk_real) ast t =
       let ty = T.ty t in
       if Ty.(equal int) ty then mk_int t
       else if Ty.(equal rat) ty then mk_rat t
       else if Ty.(equal real) ty then mk_real t
       else begin
-        let err = Expected_arith_type ty in
-        raise (Type.Typing_error (err, env, ast))
+        Type._error env (Ast ast) (Expected_arith_type ty)
       end
 
-    let dispatch2 env ast (mk_int, mk_rat, mk_real) a b =
+    let dispatch2 env (mk_int, mk_rat, mk_real) ast a b =
       let ty = T.ty a in
       if Ty.(equal int) ty then mk_int a b
       else if Ty.(equal rat) ty then mk_rat a b
       else if Ty.(equal real) ty then mk_real a b
       else begin
-        let err = Expected_arith_type ty in
-        raise (Type.Typing_error (err, env, ast))
+        Type._error env (Ast ast) (Expected_arith_type ty)
       end
 
-    let app1 env ast args name mk =
-      Base.make_op1 (module Type) env ast name args
-        (fun t -> Type.Term (mk (Type.parse_term env t)))
-
-    let app2 env ast args name mk =
-      Base.make_op2 (module Type) env ast name args
-        (fun (a, b) ->
-           Type.Term (mk (Type.parse_term env a) (Type.parse_term env b)))
-
-    let parse _version env ast s args =
+    let parse _version env s =
       match s with
+
       (* type *)
       | Type.Id { Id.ns = Id.Term; name = "$int"; } ->
-        Base.make_op0 (module Type) env ast "$int" args
-            (fun () -> Type.Ty Ty.int)
+        `Ty (Base.app0 (module Type) env "$int" Ty.int)
       | Type.Id { Id.ns = Id.Term; name = "$rat"; } ->
-        Base.make_op0 (module Type) env ast "$rat" args
-            (fun () -> Type.Ty Ty.rat)
+        `Ty (Base.app0 (module Type) env "$rat" Ty.rat)
       | Type.Id { Id.ns = Id.Term; name = "$real"; } ->
-        Base.make_op0 (module Type) env ast "$real" args
-          (fun () -> Type.Ty Ty.real)
+        `Ty (Base.app0 (module Type) env "$real" Ty.real)
+
       (* Literals *)
       | Type.Id { Id.ns = Id.Value Id.Integer; name; } ->
-        Base.make_op0 (module Type) env ast name args
-          (fun () -> Type.Term (T.int name))
+        `Term (Base.app0 (module Type) env name (T.int name))
       | Type.Id { Id.ns = Id.Value Id.Rational; name; } ->
-        Base.make_op0 (module Type) env ast name args
-          (fun () -> Type.Term (T.rat name))
+        `Term (Base.app0 (module Type) env name (T.rat name))
       | Type.Id { Id.ns = Id.Value Id.Real; name; } ->
-        Base.make_op0 (module Type) env ast name args
-          (fun () -> Type.Term (T.real name))
+        `Term (Base.app0 (module Type) env name (T.real name))
+
       (* terms *)
       | Type.Id { Id.ns = Id.Term; name = "$less"; } ->
-        app2 env ast args "$less"
-          (dispatch2 env ast (T.Int.lt, T.Rat.lt, T.Real.lt))
+        `Term (Base.term_app2_ast (module Type) env "$less"
+                 (dispatch2 env (T.Int.lt, T.Rat.lt, T.Real.lt)))
       | Type.Id { Id.ns = Id.Term; name = "$lesseq"; } ->
-        app2 env ast args "$lesseq"
-          (dispatch2 env ast (T.Int.le, T.Rat.le, T.Real.le))
+        `Term (Base.term_app2_ast (module Type) env "$lesseq"
+                 (dispatch2 env (T.Int.le, T.Rat.le, T.Real.le)))
       | Type.Id { Id.ns = Id.Term; name = "$greater"; } ->
-        app2 env ast args "$greater"
-          (dispatch2 env ast (T.Int.gt, T.Rat.gt, T.Real.gt))
+        `Term (Base.term_app2_ast (module Type) env "$greater"
+                 (dispatch2 env (T.Int.gt, T.Rat.gt, T.Real.gt)))
       | Type.Id { Id.ns = Id.Term; name = "$greatereq"; } ->
-        app2 env ast args "$greatereq"
-          (dispatch2 env ast (T.Int.ge, T.Rat.ge, T.Real.ge))
+        `Term (Base.term_app2_ast (module Type) env "$greatereq"
+                 (dispatch2 env (T.Int.ge, T.Rat.ge, T.Real.ge)))
       | Type.Id { Id.ns = Id.Term; name = "$uminus"; } ->
-        app1 env ast args "$uminus"
-          (dispatch1 env ast (T.Int.minus, T.Rat.minus, T.Real.minus))
+        `Term (Base.term_app1_ast (module Type) env "$uminus"
+                 (dispatch1 env (T.Int.minus, T.Rat.minus, T.Real.minus)))
       | Type.Id { Id.ns = Id.Term; name = "$sum"; } ->
-        app2 env ast args "$sum"
-          (dispatch2 env ast (T.Int.add, T.Rat.add, T.Real.add))
+        `Term (Base.term_app2_ast (module Type) env "$sum"
+                 (dispatch2 env (T.Int.add, T.Rat.add, T.Real.add)))
       | Type.Id { Id.ns = Id.Term; name = "$difference"; } ->
-        app2 env ast args "$difference"
-          (dispatch2 env ast (T.Int.sub, T.Rat.sub, T.Real.sub))
+        `Term (Base.term_app2_ast (module Type) env "$difference"
+                 (dispatch2 env (T.Int.sub, T.Rat.sub, T.Real.sub)))
       | Type.Id { Id.ns = Id.Term; name = "$product"; } ->
-        app2 env ast args "$product"
-          (dispatch2 env ast (T.Int.mul, T.Rat.mul, T.Real.mul))
+        `Term (Base.term_app2_ast (module Type) env "$product"
+                 (dispatch2 env (T.Int.mul, T.Rat.mul, T.Real.mul)))
       | Type.Id { Id.ns = Id.Term; name = "$quotient"; } ->
-        app2 env ast args "$quotient"
-          (dispatch2 env ast (_invalid env ast Ty.int, T.Rat.div, T.Real.div))
+        `Term (Base.term_app2_ast (module Type) env "$quotient" (fun ast a b ->
+            (dispatch2 env (_invalid env ast Ty.int, T.Rat.div, T.Real.div)) ast a b
+          ))
       | Type.Id { Id.ns = Id.Term; name = "$quotient_e"; } ->
-        app2 env ast args "$quotient_e"
-          (dispatch2 env ast (T.Int.div_e, T.Rat.div_e, T.Real.div_e))
+        `Term (Base.term_app2_ast (module Type) env "$quotient_e"
+                 (dispatch2 env (T.Int.div_e, T.Rat.div_e, T.Real.div_e)))
       | Type.Id { Id.ns = Id.Term; name = "$remainder_e"; } ->
-        app2 env ast args "$remainder_e"
-          (dispatch2 env ast (T.Int.rem_e, T.Rat.rem_e, T.Real.rem_e))
+        `Term (Base.term_app2_ast (module Type) env "$remainder_e"
+                 (dispatch2 env (T.Int.rem_e, T.Rat.rem_e, T.Real.rem_e)))
       | Type.Id { Id.ns = Id.Term; name = "$quotient_t"; } ->
-        app2 env ast args "$quotient_t"
-          (dispatch2 env ast (T.Int.div_t, T.Rat.div_t, T.Real.div_t))
+        `Term (Base.term_app2_ast (module Type) env "$quotient_t"
+                 (dispatch2 env (T.Int.div_t, T.Rat.div_t, T.Real.div_t)))
       | Type.Id { Id.ns = Id.Term; name = "$remainder_t"; } ->
-        app2 env ast args "$remainder_t"
-          (dispatch2 env ast (T.Int.rem_t, T.Rat.rem_t, T.Real.rem_t))
+        `Term (Base.term_app2_ast (module Type) env "$remainder_t"
+                 (dispatch2 env (T.Int.rem_t, T.Rat.rem_t, T.Real.rem_t)))
       | Type.Id { Id.ns = Id.Term; name = "$quotient_f"; } ->
-        app2 env ast args "$quotient_f"
-          (dispatch2 env ast (T.Int.div_f, T.Rat.div_f, T.Real.div_f))
+        `Term (Base.term_app2_ast (module Type) env "$quotient_f"
+                 (dispatch2 env (T.Int.div_f, T.Rat.div_f, T.Real.div_f)))
       | Type.Id { Id.ns = Id.Term; name = "$remainder_f"; } ->
-        app2 env ast args "$remainder_f"
-          (dispatch2 env ast (T.Int.rem_f, T.Rat.rem_f, T.Real.rem_f))
+        `Term (Base.term_app2_ast (module Type) env "$remainder_f"
+                 (dispatch2 env (T.Int.rem_f, T.Rat.rem_f, T.Real.rem_f)))
       | Type.Id { Id.ns = Id.Term; name = "$floor"; } ->
-        app1 env ast args "$floor"
-          (dispatch1 env ast (T.Int.floor, T.Rat.floor, T.Real.floor))
+        `Term (Base.term_app1_ast (module Type) env "$floor"
+                 (dispatch1 env (T.Int.floor, T.Rat.floor, T.Real.floor)))
       | Type.Id { Id.ns = Id.Term; name = "$ceiling"; } ->
-        app1 env ast args "$ceiling"
-          (dispatch1 env ast (T.Int.ceiling, T.Rat.ceiling, T.Real.ceiling))
+        `Term (Base.term_app1_ast (module Type) env "$ceiling"
+                 (dispatch1 env (T.Int.ceiling, T.Rat.ceiling, T.Real.ceiling)))
       | Type.Id { Id.ns = Id.Term; name = "$truncate"; } ->
-        app1 env ast args "$truncate"
-          (dispatch1 env ast (T.Int.truncate, T.Rat.truncate, T.Real.truncate))
+        `Term (Base.term_app1_ast (module Type) env "$truncate"
+                 (dispatch1 env (T.Int.truncate, T.Rat.truncate, T.Real.truncate)))
       | Type.Id { Id.ns = Id.Term; name = "$round"; } ->
-        app1 env ast args "$round"
-          (dispatch1 env ast (T.Int.round, T.Rat.round, T.Real.round))
+        `Term (Base.term_app1_ast (module Type) env "$round"
+                 (dispatch1 env (T.Int.round, T.Rat.round, T.Real.round)))
       | Type.Id { Id.ns = Id.Term; name = "$is_int"; } ->
-        app1 env ast args "$is_int"
-          (dispatch1 env ast (T.Int.is_int, T.Rat.is_int, T.Real.is_int))
+        `Term (Base.term_app1_ast (module Type) env "$is_int"
+                 (dispatch1 env (T.Int.is_int, T.Rat.is_int, T.Real.is_int)))
       | Type.Id { Id.ns = Id.Term; name = "$is_rat"; } ->
-        app1 env ast args "$is_rat"
-          (dispatch1 env ast (T.Int.is_rat, T.Rat.is_rat, T.Real.is_rat))
+        `Term (Base.term_app1_ast (module Type) env "$is_rat"
+                 (dispatch1 env (T.Int.is_rat, T.Rat.is_rat, T.Real.is_rat)))
       | Type.Id { Id.ns = Id.Term; name = "$to_int"; } ->
-        app1 env ast args "$to_int"
-          (dispatch1 env ast (T.Int.to_int, T.Rat.to_int, T.Real.to_int))
+        `Term (Base.term_app1_ast (module Type) env "$to_int"
+                 (dispatch1 env (T.Int.to_int, T.Rat.to_int, T.Real.to_int)))
       | Type.Id { Id.ns = Id.Term; name = "$to_rat"; } ->
-        app1 env ast args "$to_rat"
-          (dispatch1 env ast (T.Int.to_rat, T.Rat.to_rat, T.Real.to_rat))
+        `Term (Base.term_app1_ast (module Type) env "$to_rat"
+                 (dispatch1 env (T.Int.to_rat, T.Rat.to_rat, T.Real.to_rat)))
       | Type.Id { Id.ns = Id.Term; name = "$to_real"; } ->
-        app1 env ast args "$to_real"
-          (dispatch1 env ast (T.Int.to_real, T.Rat.to_real, T.Real.to_real))
+        `Term (Base.term_app1_ast (module Type) env "$to_real"
+                 (dispatch1 env (T.Int.to_real, T.Rat.to_real, T.Real.to_real)))
 
       (* Catch-all *)
-      | _ -> None
+      | _ -> `Not_found
 
   end
 
@@ -423,7 +962,9 @@ module Ae = struct
       (Type : Tff_intf.S)
       (Ty : Dolmen.Intf.Ty.Ae_Arith with type t := Type.Ty.t)
       (T : Dolmen.Intf.Term.Ae_Arith with type t := Type.T.t
-                                        and type ty := Type.Ty.t) = struct
+                                      and type ty := Type.Ty.t) = struct
+
+
 
   end
 end
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/arith.mli b/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/arith.mli
index ae7fd2a05f15c934cc342cc0c5f09f1620c0c436..2c0d74396dff4648415bc8cf2d20df8bab048945 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/arith.mli
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/arith.mli
@@ -2,6 +2,13 @@
 (** Smtlib Integer and Real Arithmetic *)
 module Smtlib2 : sig
 
+  type arith =
+    | Regular
+    | Linear of [ `Large | `Strict ]
+    | Difference of [ `IDL | `RDL | `UFIDL ] (**)
+  (** The different type of arithmetic restrictions, see the comment in
+      arith.ml for more information. *)
+
   (** Standalone Integer arithmetic *)
   module Int : sig
 
@@ -10,7 +17,19 @@ module Smtlib2 : sig
         (Ty : Dolmen.Intf.Ty.Smtlib_Int with type t := Type.Ty.t)
         (T : Dolmen.Intf.Term.Smtlib_Int with type t := Type.T.t) : sig
 
-      val parse : Dolmen_smtlib2.version -> Type.builtin_symbols
+      type _ Type.warn +=
+        | Restriction : string -> Dolmen.Std.Term.t Type.warn
+        (** Warning for expressions which tecnically do not respect the strict
+            spec but respect the large spec. *)
+      (** Arithmetic type-checking warnings *)
+
+      type _ Type.err +=
+        | Forbidden : string -> Dolmen.Std.Term.t Type.err
+        (** Error for expressions which do not respect the spec. *)
+      (** Arithmetic type-checking errors *)
+
+      val parse : arith:arith -> Dolmen.Smtlib2.version -> Type.builtin_symbols
+      (** Parsing function for type-checking *)
     end
 
   end
@@ -23,7 +42,19 @@ module Smtlib2 : sig
         (Ty : Dolmen.Intf.Ty.Smtlib_Real with type t := Type.Ty.t)
         (T : Dolmen.Intf.Term.Smtlib_Real with type t := Type.T.t) : sig
 
-      val parse : Dolmen_smtlib2.version -> Type.builtin_symbols
+      type _ Type.warn +=
+        | Restriction : string -> Dolmen.Std.Term.t Type.warn
+        (** Warning for expressions which tecnically do not respect the strict
+            spec but respect the large spec. *)
+      (** Arithmetic type-checking warnings *)
+
+      type _ Type.err +=
+        | Forbidden : string -> Dolmen.Std.Term.t Type.err
+        (** Error for expressions which do not respect the spec. *)
+      (** Arithmetic type-checking errors *)
+
+      val parse : arith:arith -> Dolmen.Smtlib2.version -> Type.builtin_symbols
+      (** Parsing function for type-checking *)
     end
 
   end
@@ -37,12 +68,22 @@ module Smtlib2 : sig
         (T : Dolmen.Intf.Term.Smtlib_Real_Int with type t := Type.T.t
                                                and type ty := Type.Ty.t) : sig
 
-      type Type.err +=
-        | Expected_arith_type of Type.Ty.t
+      type _ Type.warn +=
+        | Restriction : string -> Dolmen.Std.Term.t Type.warn
+        (** Warning for expressions which tecnically do not respect the strict
+            spec but respect the large spec. *)
+      (** Arithmetic type-checking warnings *)
+
+      type _ Type.err +=
+        | Forbidden : string -> Dolmen.Std.Term.t Type.err
+        (** Error for expressions which do not respect the spec. *)
+        | Expected_arith_type : Type.Ty.t -> Dolmen.Std.Term.t Type.err
         (** Error raised when an arithmetic type was expected (i.e. either
             int or real), but another type was found. *)
+      (** Additional errors specific to arithmetic typing. *)
 
-      val parse : Dolmen_smtlib2.version -> Type.builtin_symbols
+      val parse : arith:arith -> Dolmen.Smtlib2.version -> Type.builtin_symbols
+      (** Parsing function for type-checking *)
 
     end
 
@@ -59,16 +100,17 @@ module Tptp : sig
       (T : Dolmen.Intf.Term.Tptp_Arith with type t := Type.T.t
                                         and type ty := Type.Ty.t) : sig
 
-    type Type.err +=
-      | Expected_arith_type of Type.Ty.t
+    type _ Type.err +=
+      | Expected_arith_type : Type.Ty.t -> Dolmen.Std.Term.t Type.err
       (** Error raised when an arithmetic type was expected (i.e. either
           int or real), but another type was found. *)
-      | Cannot_apply_to of Type.Ty.t
+      | Cannot_apply_to : Type.Ty.t -> Dolmen.Std.Term.t Type.err
       (** Raised when an arithmetic symbol is applied to an arithmetic
           type that cannot support the given operation (e.g. $quotient
           on integers). *)
+    (** Additional errors specific to arithmetic typing. *)
 
-    val parse : Dolmen_tptp.version -> Type.builtin_symbols
+    val parse : Dolmen.Tptp.version -> Type.builtin_symbols
   end
 
 end
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/arrays.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/arrays.ml
index e53b0149ff7fafc339db711d872d4f9ebbc3eb2d..76ce396a8fe5406639682c170180c7b9b08637fc 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/arrays.ml
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/arrays.ml
@@ -1,43 +1,75 @@
 
-open Dolmen
+module Id = Dolmen.Std.Id
 
 (* Smtlib arrays *)
 (* ************************************************************************ *)
 
 module Smtlib2 = struct
 
+  (* Restrictions imposed by some theories on the kinds of arrays that
+     are allowed to occur. This tecnically brings some cross-theory
+     dependency, but since the restrictions are simple enough, we can
+     get by with simple syntactic checks on the sort declarations.
+     The restrictions are as follows:
+     - AUFLIA, QF_AUFLIA : int -> int
+     - AUFLIRA : int -> real & int -> (int -> real)
+     - QF_ABV, QF_AUFBV : bitvec _ -> bitvec _
+  *)
+  type arrays =
+    | All
+    | Only_int_int
+    | Only_ints_real
+    | Only_bitvec
+
   module Tff
       (Type : Tff_intf.S)
       (Ty : Dolmen.Intf.Ty.Smtlib_Array with type t := Type.Ty.t)
       (T : Dolmen.Intf.Term.Smtlib_Array with type t := Type.T.t) = struct
 
-    let parse _version env ast s args =
+    type _ Type.err +=
+      | Forbidden : string -> Dolmen.Std.Term.t Type.err
+
+    let msg = function
+      | All -> assert false
+      | Only_int_int ->
+        "Only array types of the form (Array Int Int) are allowed by the logic"
+      | Only_ints_real ->
+        "Only array types of the form (Array Int Int) or (Array Int (Array (Int Real))) \
+         are allowed by the logic"
+      | Only_bitvec ->
+        "Only array types of the form (Array (_ BitVec i) (_ BitVec j)) for some i, j \
+         are allowed by the logic"
+
+    let mk_array_ty env arrays ast src dst =
+      let error () = Type._error env (Ast ast) (Forbidden (msg arrays)) in
+      begin match arrays, Ty.view src, Ty.view dst with
+        | All, _, _ -> ()
+        (* AUFLIA, QF_AUFLIA restrictions *)
+        | Only_int_int, `Int, `Int -> ()
+        | Only_int_int, _, _ -> error ()
+        (* AUFLIRA restriction *)
+        | Only_ints_real, `Int, `Real -> ()
+        | Only_ints_real, `Int, `Array (src', dst') ->
+          begin match Ty.view src', Ty.view dst' with
+            | `Int, `Real -> ()
+            | _, _ -> error ()
+          end
+        | Only_ints_real, _, _ -> error ()
+        (* QF_ABV, QF_AUFBV restrictions *)
+        | Only_bitvec, `Bitv _, `Bitv _ -> ()
+        | Only_bitvec, _, _ -> error ()
+      end;
+      Ty.array src dst
+
+    let parse ~arrays _version env s =
       match s with
       | Type.Id { Id.name = "Array"; ns = Id.Sort } ->
-        Base.make_op2 (module Type) env ast "Array" args (fun (src, dst) ->
-            let src_ty = Type.parse_ty env src in
-            let dst_ty = Type.parse_ty env dst in
-            Type.Ty (Ty.array src_ty dst_ty)
-          )
+        `Ty (Base.ty_app2_ast (module Type) env "Array" (mk_array_ty env arrays))
       | Type.Id { Id.name = "select"; ns = Id.Term } ->
-        Base.make_op2 (module Type) env ast "select" args (fun (arr, idx) ->
-            let arr_t = Type.parse_term env arr in
-            let idx_t = Type.parse_term env idx in
-            Type.Term (T.select arr_t idx_t)
-          )
+        `Term (Base.term_app2 (module Type) env "select" T.select)
       | Type.Id { Id.name = "store"; ns = Id.Term } ->
-        Base.make_op3 (module Type) env ast "store" args (fun (arr, idx, value) ->
-            let arr_t = Type.parse_term env arr in
-            let idx_t = Type.parse_term env idx in
-            let val_t = Type.parse_term env value in
-            Type.Term (T.store arr_t idx_t val_t)
-          )
-      | Type.Id { Id.name = "const"; ns = Id.Term } ->
-        Base.make_op1 (module Type) env ast "const" args (fun (value) ->
-            let val_t = Type.parse_term env value in
-            Type.Term (T.const val_t)
-          )
-      | _ -> None
+        `Term (Base.term_app3 (module Type) env "select" T.store)
+      | _ -> `Not_found
 
   end
 
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/arrays.mli b/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/arrays.mli
index ab581387d729ac5b307af5070de1f3b095bc34d4..c1da27eac915a1175cc80e949b0f7d6a21a38628 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/arrays.mli
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/arrays.mli
@@ -2,12 +2,25 @@
 (** Smtlib array builtins *)
 module Smtlib2 : sig
 
+  type arrays =
+    | All
+    | Only_int_int
+    | Only_ints_real
+    | Only_bitvec (**)
+  (** The difference type of array restrictions that can be imposed by
+      logics. *)
+
   module Tff
       (Type : Tff_intf.S)
       (Ty : Dolmen.Intf.Ty.Smtlib_Array with type t := Type.Ty.t)
       (T : Dolmen.Intf.Term.Smtlib_Array with type t := Type.T.t) : sig
 
-    val parse : Dolmen_smtlib2.version -> Type.builtin_symbols
+    type _ Type.err +=
+      | Forbidden : string -> Dolmen.Std.Term.t Type.err
+      (** Raised when a restriction on the sort of arrays is breached. *)
+    (** Errors for array type-checking. *)
+
+    val parse : arrays:arrays -> Dolmen.Smtlib2.version -> Type.builtin_symbols
   end
 
 end
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/base.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/base.ml
index c6f111afc677bbcdb2cbfe2a50a97cc1183ba485..8edd31cddbea359ae9bfb2fa7d3e95162258769f 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/base.ml
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/base.ml
@@ -1,165 +1,143 @@
 
-open Dolmen
-module Ast = Dolmen.Term
-
 (* Merging builtin parser functions *)
 (* ************************************************************************ *)
 
-let noop _ _ _ _ = None
+let noop _ _ = `Not_found
 
-let rec merge l env ast s args =
+let rec merge l env s =
   match l with
-  | [] -> None
+  | [] -> `Not_found
   | f :: r ->
-    begin match f env ast s args with
-      | (Some _) as ret -> ret
-      | None -> merge r env ast s args
+    begin match f env s with
+      | `Not_found -> merge r env s
+      | ret -> ret
     end
 
-(* Smtlib logic merging *)
-
-type smtlib_theory = [
-  | `Core
-  | `Arrays
-  | `Bitvectors
-  | `Floats
-  | `Ints
-  | `Reals
-  | `Reals_Ints
-]
+(* Smtlib ID splitting *)
+(* ************************************************************************ *)
 
-type smtlib_restriction = [
-  | `No_free_symbol
-  | `Quantifier_free
-  | `Difference_logic
-  | `Linear_arithmetic
+type 'ret indexed = [
+  | `Unary of (string -> 'ret)
+  | `Binary of (string -> string -> 'ret)
+  | `Ternary of (string -> string -> string -> 'ret)
+  | `Nary of int * (string list -> 'ret)
 ]
 
-type smtlib_logic = {
-  theories      : smtlib_theory list;
-  restrictions  : smtlib_restriction list;
-}
-
-(*
-QF for the restriction to quantifier free formulas
-A or AX for the theory ArraysEx
-BV for the theory FixedSizeBitVectors
-FP (forthcoming) for the theory FloatingPoint
-IA for the theory Ints (Integer Arithmetic)
-RA for the theory Reals (Real Arithmetic)
-IRA for the theory Reals_Ints (mixed Integer Real Arithmetic)
-IDL for Integer Difference Logic
-RDL for Rational Difference Logic
-L before IA, RA, or IRA for the linear fragment of those arithmetics
-N before IA, RA, or IRA for the non-linear fragment of those arithmetics
-UF for the extension allowing free sort and function symbols
-*)
-
-
-let all_smtlib_logic = {
-  theories =
-    [ `Core; `Reals_Ints; `Arrays; `Bitvectors; `Floats ];
-  restrictions = [];
-}
-
-let smtlib_logic s =
-  let add_restrictions c r = { c with restrictions = r::c.restrictions } in
-  let add_theories c r = { c with theories = r::c.theories } in
-  let rec aux c = function
-    | [] -> Some c
-    | 'Q'::'F'::'_'::l -> aux (add_restrictions c `Quantifier_free) l
-    | 'U'::'F'::l -> aux c l
-    | 'D'::'T'::l -> aux c l
-    | 'I'::'D'::'L'::l ->  aux (add_theories (add_restrictions c `Difference_logic) `Ints) l
-    | 'R'::'D'::'L'::l ->  aux (add_theories (add_restrictions c `Difference_logic) `Reals) l
-    | 'L'::'I'::'A'::l -> aux (add_theories (add_restrictions c `Linear_arithmetic) `Ints) l
-    | 'L'::'R'::'A'::l -> aux (add_theories (add_restrictions c `Linear_arithmetic) `Reals) l
-    | 'L'::'I'::'R'::'A'::l -> aux (add_theories (add_restrictions c `Linear_arithmetic) `Reals_Ints) l
-    | 'N'::'I'::'A'::l -> aux (add_theories c `Ints) l
-    | 'N'::'R'::'A'::l -> aux (add_theories c `Reals) l
-    | 'N'::'I'::'R'::'A'::l -> aux (add_theories c `Reals_Ints) l
-    | 'A'::'X'::l | 'A'::l  -> aux (add_theories c `Arrays) l
-    | 'B'::'V'::l -> aux (add_theories c `Bitvectors) l
-    | 'F'::'P'::l -> aux (List.fold_left add_theories c [`Floats; (* For the constants in some benchmark *) `Bitvectors; `Reals]) l
-    | _ -> None
+let parse_id id l ~err ~k =
+  let rec aux h r r_l = function
+    | [] -> k (h :: r)
+    | (s, `Unary f) :: _ when String.equal s h ->
+      begin match r with
+        | [x] -> f x
+        | _ -> err s 1 r_l
+      end
+    | (s, `Binary f) :: _ when String.equal s h ->
+      begin match r with
+        | [x; y] -> f x y
+        | _ -> err s 2 r_l
+      end
+    | (s, `Ternary f) :: _ when String.equal s h ->
+      begin match r with
+        | [x; y; z] -> f x y z
+        | _ -> err s 3 r_l
+      end
+    | (s, `Nary (n, f)) :: _ when String.equal s h ->
+      if r_l = n then f r else err s n r_l
+    | _ :: l' -> aux h r r_l l'
   in
-  match s with
-  | "ALL" -> Some all_smtlib_logic
-  | _ ->
-    aux { theories = [ `Core ]; restrictions = [] } (List.of_seq (String.to_seq s))
-
-(* Building builtins parser functions *)
+  match Dolmen.Std.Id.split id with
+  | h :: r -> aux h r (List.length r) l
+  | r -> k r
+
+let bad_ty_index_arity (type env ty)
+    (module Type: Tff_intf.S with type env = env and type Ty.t = ty)
+    env s n r_l =
+  `Ty (fun ast _args ->
+      Type._error env (Ast ast)
+        (Type.Bad_index_arity (s, n, r_l))
+    )
+
+let bad_term_index_arity (type env term)
+    (module Type: Tff_intf.S with type env = env and type T.t = term)
+    env s n r_l =
+  `Term (fun ast _args ->
+      Type._error env (Ast ast)
+        (Type.Bad_index_arity (s, n, r_l))
+    )
+
+
+(* Low level helpers *)
 (* ************************************************************************ *)
 
 type ('env, 'args, 'ret) helper =
   (module Tff_intf.S with type env = 'env) ->
-  'env -> Dolmen.Term.t -> string -> Dolmen.Term.t list ->
-  ('args -> 'ret) -> 'ret option
+  'env -> string -> (Dolmen.Std.Term.t -> 'args -> 'ret) ->
+  (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'ret)
 
 let make_op0
     (type env) (module Type: Tff_intf.S with type env = env)
-    env ast op args ret =
+    env op ret = fun ast args ->
   match args with
-  | [] -> Some (ret ())
+  | [] -> ret ast ()
   | _ ->
-    let err = Type.Bad_op_arity (op, 0, List.length args) in
-    raise (Type.Typing_error (err, env, ast))
+    Type._error env (Ast ast)
+      (Type.Bad_op_arity (op, [0], List.length args))
 
 let make_op1
     (type env) (module Type: Tff_intf.S with type env = env)
-    env ast op args ret =
+    env op ret = fun ast args ->
   match args with
-  | [t1] -> Some (ret t1)
+  | [t1] -> ret ast t1
   | _ ->
-    let err = Type.Bad_op_arity (op, 1, List.length args) in
-    raise (Type.Typing_error (err, env, ast))
+    Type._error env (Ast ast)
+      (Type.Bad_op_arity (op, [1], List.length args))
 
 let make_op2
     (type env) (module Type: Tff_intf.S with type env = env)
-    env ast op args ret =
+    env op ret = fun ast args ->
   match args with
-  | [t1; t2] -> Some (ret (t1, t2))
+  | [t1; t2] -> ret ast (t1, t2)
   | _ ->
-    let err = Type.Bad_op_arity (op, 2, List.length args) in
-    raise (Type.Typing_error (err, env, ast))
+    Type._error env (Ast ast)
+      (Type.Bad_op_arity (op, [2], List.length args))
 
 let make_op3
     (type env) (module Type: Tff_intf.S with type env = env)
-    env ast op args ret =
+    env op ret = fun ast args ->
   match args with
-  | [t1; t2; t3] -> Some (ret (t1, t2, t3))
+  | [t1; t2; t3] -> ret ast (t1, t2, t3)
   | _ ->
-    let err = Type.Bad_op_arity (op, 3, List.length args) in
-    raise (Type.Typing_error (err, env, ast))
+    Type._error env (Ast ast)
+      (Type.Bad_op_arity (op, [3], List.length args))
 
 let make_op4
     (type env) (module Type: Tff_intf.S with type env = env)
-    env ast op args ret =
+    env op ret = fun ast args ->
   match args with
-  | [t1; t2; t3; t4] -> Some (ret (t1, t2, t3, t4))
+  | [t1; t2; t3; t4] -> ret ast (t1, t2, t3, t4)
   | _ ->
-    let err = Type.Bad_op_arity (op, 4, List.length args) in
-    raise (Type.Typing_error (err, env, ast))
+    Type._error env (Ast ast)
+      (Type.Bad_op_arity (op, [4], List.length args))
 
 let make_opn n
     (type env) (module Type: Tff_intf.S with type env = env)
-    env ast op args ret =
+    env op ret = fun ast args ->
   let l = List.length args in
   if l = n then
-    Some (ret args)
+    ret ast args
   else begin
-    let err = Type.Bad_op_arity (op, 1, List.length args) in
-    raise (Type.Typing_error (err, env, ast))
+    Type._error env (Ast ast)
+      (Type.Bad_op_arity (op, [n], l))
   end
 
 let make_assoc
     (type env) (module Type: Tff_intf.S with type env = env)
-    env ast op args ret =
+    env op ret = fun ast args ->
   match args with
   | [] | [_] ->
-    let err = Type.Bad_op_arity (op, 2, List.length args) in
-    raise (Type.Typing_error (err, env, ast))
-  | _ -> Some (ret args)
+    Type._error env (Ast ast)
+      (Type.Bad_op_arity (op, [2], List.length args))
+  | _ -> ret ast args
 
 let fold_left_assoc mk = function
   | h :: r -> List.fold_left mk h r
@@ -184,196 +162,216 @@ let map_chain
   | [x] -> x
   | l -> Type.T._and l
 
-(* Alt-ergo builtins *)
-(* ************************************************************************ *)
-
-module Ae = struct
-
-  module Tff
-      (Type : Tff_intf.S)
-      (Ty : Dolmen.Intf.Ty.Ae_Base with type t = Type.Ty.t)
-      (T : Dolmen.Intf.Term.Ae_Base with type t = Type.T.t) = struct
-
-    let parse env ast s args =
-      match s with
-      | Type.Builtin Term.Bool ->
-        make_op0 (module Type) env ast "bool" args
-          (fun () -> Type.Ty Ty.bool)
-      | Type.Builtin Term.Unit ->
-        make_op0 (module Type) env ast "unit" args
-          (fun () -> Type.Ty Ty.unit)
-      | Type.Builtin Term.Void ->
-        make_op0 (module Type) env ast "void" args
-          (fun () -> Type.Term T.void)
-      | _ -> None
-
-  end
-
-end
-
-(* TPTP builtins ($i, $o, etc..) *)
-(* ************************************************************************ *)
-
-module Tptp = struct
-
-  module Tff
-      (Type : Tff_intf.S)
-      (Ty : Dolmen.Intf.Ty.Tptp_Base with type t = Type.Ty.t)
-      (T : Dolmen.Intf.Term.Tptp_Base with type t = Type.T.t) = struct
-
-    let parse _version env ast s args =
-      match s with
-      (*
-      | Type.Id ({ Id.name = "$_"; ns = Id.Term } as id) ->
-        Some (Type.wildcard env ast id args)
-      *)
-      | Type.Id { Id.name = "$tType"; ns = Id.Term } ->
-        make_op0 (module Type) env ast "$tType" args
-          (fun () -> Type.Ttype)
-      | Type.Id { Id.name = "$o"; ns = Id.Term } ->
-        make_op0 (module Type) env ast "$o" args
-          (fun () -> (Type.Ty Ty.prop))
-      | Type.Id { Id.name = "$i"; ns = Id.Term } ->
-        make_op0 (module Type) env ast "$i" args
-          (fun () -> (Type.Ty Ty.base))
-      | Type.Id { Id.name = "$true"; ns = Id.Term } ->
-        make_op0 (module Type) env ast "$true" args
-          (fun () -> Type.Term T._true)
-      | Type.Id { Id.name = "$false"; ns = Id.Term } ->
-        make_op0 (module Type) env ast "$false" args
-          (fun () -> Type.Term T._false)
-      | Type.Id id when Id.equal id Id.tptp_role ->
-        Some (Type.Tags [])
-      | _ -> None
-
-  end
-
-end
-
-(* Smtlib builtins (bool, =, etc...) *)
+(* High level helpers *)
 (* ************************************************************************ *)
 
-module Smtlib2 = struct
-
-  module Tff
-      (Type : Tff_intf.S)
-      (Tag : Dolmen.Intf.Tag.Smtlib_Base with type 'a t = 'a Type.Tag.t)
-      (Ty : Dolmen.Intf.Ty.Smtlib_Base with type t = Type.Ty.t)
-      (T : Dolmen.Intf.Term.Smtlib_Base with type t = Type.T.t) = struct
-
-    let app_left env ast args name mk =
-      make_assoc (module Type) env ast name args
-        (fun l -> Type.Term (fold_left_assoc mk (List.map (Type.parse_term env) l)))
-
-    let app_right env ast args name mk =
-      make_assoc (module Type) env ast name args
-        (fun l -> Type.Term (fold_right_assoc mk (List.map (Type.parse_term env) l)))
-
-    let parse_symbol env = function
-      | { Ast.term = Ast.Symbol s; _ }
-      | { Ast.term = Ast.App ({ Ast.term = Ast.Symbol s; _ }, []); _ } ->
-        Id.full_name s
-      | ast ->
-        raise (Type.Typing_error (Type.Expected ("symbol", None), env, ast))
-
-    let parse_f env ast cstr args =
-      let loc = Term.(ast.loc) in
-      let t = Term.apply ?loc cstr args in
-      Type.Term (Type.parse_term env t)
-
-    let parse _version env ast s args =
-      match s with
-      (* Bool sort and constants *)
-      | Type.Id { Id.name = "Bool"; ns = Id.Sort } ->
-        make_op0 (module Type) env ast "Bool" args
-          (fun () -> (Type.Ty Ty.prop))
-      | Type.Id { Id.name = "true"; ns = Id.Term } ->
-        make_op0 (module Type) env ast "true" args
-          (fun () -> (Type.Term Type.T._true))
-      | Type.Id { Id.name = "false"; ns = Id.Term } ->
-        make_op0 (module Type) env ast "false" args
-          (fun () -> (Type.Term Type.T._false))
-
-      (* Boolean operators *)
-      | Type.Id { Id.name = "not"; ns = Id.Term } ->
-        make_op1 (module Type) env ast "not" args
-          (fun t -> Type.Term (Type.T.neg (Type.parse_term env t)))
-      | Type.Id { Id.name = "and"; ns = Id.Term } ->
-        Some (parse_f env ast (Term.and_t ()) args)
-      | Type.Id { Id.name = "or"; ns = Id.Term } ->
-        Some (parse_f env ast (Term.or_t ()) args)
-      | Type.Id { Id.name = "xor"; ns = Id.Term } ->
-        app_left env ast args "xor" Type.T.xor
-      | Type.Id { Id.name = "=>"; ns = Id.Term } ->
-        app_right env ast args "=>" Type.T.imply
-
-      (* If-then-else *)
-      | Type.Id { Id.name = "ite"; ns = Id.Term } ->
-        make_op3 (module Type) env ast "ite" args
-        (fun (c, a, b) ->
-          let loc = ast.Term.loc in
-          let ast = Term.ite ?loc c a b in
-          Type.Term (Type.parse_term env ast))
-
-      (* Equality *)
-      | Type.Id { Id.name = "distinct"; ns = Id.Term } ->
-        Some (parse_f env ast (Term.neq_t ()) args)
-      | Type.Id { Id.name = "="; ns = Id.Term } ->
-        let l = List.map (Type.parse_term env) args in
-        Some (Type.Term (T.eqs l))
-
-      (* Named formulas *)
-      | Type.Id { Id.name = ":named"; ns = Id.Attr } ->
-        make_op1 (module Type) env ast ":named" args
-          (fun t ->
-             let name = parse_symbol env t in
-             Type.Tags [Type.Any (Tag.named, name)]
-          )
-
-      (* Rewrite rules *)
-      | Type.Id id when Id.equal id Id.rwrt_rule ->
-        Some (Type.Tags [Type.Any (Tag.rwrt, ())])
-
-      | _ -> None
-
-  end
-
-end
-
-(* Zipperposition builtins *)
-(* ************************************************************************ *)
-
-module Zf = struct
-
-  module Tff
-      (Type : Tff_intf.S)
-      (Tag : Dolmen.Intf.Tag.Zf_Base with type 'a t = 'a Type.Tag.t) = struct
-
-    let parse _env _ast s args =
-      match s with
-      | Type.Id id when Id.equal id Id.rwrt_rule ->
-        Some (Type.Tags [Type.Any (Tag.rwrt, ())])
-      | Type.Id { Id.name = "infix"; ns = Id.Term } ->
-        begin match args with
-          | [ { Term.term = Term.Symbol { Id.name; _ }; _ } ] ->
-            Some (Type.Tags [
-                Type.Any (Tag.name, Tag.exact name);
-                Type.Any (Tag.pos, Tag.infix);
-              ])
-          | _ -> assert false
-        end
-      | Type.Id { Id.name = "prefix"; ns = Id.Term } ->
-        begin match args with
-          | [ { Term.term = Term.Symbol { Id.name; _ }; _ } ] ->
-            Some (Type.Tags [
-                Type.Any (Tag.name, Tag.exact name);
-                Type.Any (Tag.pos, Tag.prefix);
-              ])
-          | _ -> assert false
-        end
-      | _ -> None
-
-  end
+(* Nullary applications *)
+
+let app0
+    (type env) (module Type : Tff_intf.S with type env = env)
+    ?(check=(fun _ -> ())) env name ret =
+  make_op0 (module Type) env name (fun ast () -> check ast; ret)
+
+let app0_ast
+    (type env) (module Type : Tff_intf.S with type env = env)
+    ?(check=(fun _ -> ())) env name mk =
+  make_op0 (module Type) env name (fun ast () -> check ast; mk ast)
+
+
+(* Unary applications *)
+
+let ty_app1
+    (type env) (type ty)
+    (module Type : Tff_intf.S with type env = env and type Ty.t = ty)
+    ?(check=(fun _ _ -> ())) env name mk =
+  make_op1 (module Type) env name
+    (fun ast t -> check ast t; mk (Type.parse_ty env t))
+
+let ty_app1_ast
+    (type env) (type ty)
+    (module Type : Tff_intf.S with type env = env and type Ty.t = ty)
+    ?(check=(fun _ _ -> ())) env name mk =
+  make_op1 (module Type) env name
+    (fun ast t -> check ast t; mk ast (Type.parse_ty env t))
+
+let term_app1
+    (type env) (type term)
+    (module Type : Tff_intf.S with type env = env and type T.t = term)
+    ?(check=(fun _ _ -> ())) env name mk =
+  make_op1 (module Type) env name
+    (fun ast t -> check ast t; mk (Type.parse_term env t))
+
+let term_app1_ast
+    (type env) (type term)
+    (module Type : Tff_intf.S with type env = env and type T.t = term)
+    ?(check=(fun _ _ -> ())) env name mk =
+  make_op1 (module Type) env name
+    (fun ast t -> check ast t; mk ast (Type.parse_term env t))
+
+
+(* Binary applications *)
+
+let ty_app2
+    (type env) (type ty)
+    (module Type : Tff_intf.S with type env = env and type Ty.t = ty)
+    ?(check=(fun _ _ _ -> ())) env name mk =
+  make_op2 (module Type) env name (fun ast (a, b) ->
+      check ast a b; mk (Type.parse_ty env a) (Type.parse_ty env b))
+
+let ty_app2_ast
+    (type env) (type ty)
+    (module Type : Tff_intf.S with type env = env and type Ty.t = ty)
+    ?(check=(fun _ _ _ -> ())) env name mk =
+  make_op2 (module Type) env name (fun ast (a, b) ->
+      check ast a b; mk ast (Type.parse_ty env a) (Type.parse_ty env b))
+
+let term_app2
+    (type env) (type term)
+    (module Type : Tff_intf.S with type env = env and type T.t = term)
+    ?(check=(fun _ _ _ -> ())) env name mk =
+  make_op2 (module Type) env name (fun ast (a, b) ->
+      check ast a b; mk (Type.parse_term env a) (Type.parse_term env b))
+
+let term_app2_ast
+    (type env) (type term)
+    (module Type : Tff_intf.S with type env = env and type T.t = term)
+    ?(check=(fun _ _ _ -> ())) env name mk =
+  make_op2 (module Type) env name (fun ast (a, b) ->
+      check ast a b; mk ast (Type.parse_term env a) (Type.parse_term env b))
+
+
+(* Ternary applications *)
+
+let ty_app3
+    (type env) (type ty)
+    (module Type : Tff_intf.S with type env = env and type Ty.t = ty)
+    ?(check=(fun _ _ _ _ -> ())) env name mk =
+  make_op3 (module Type) env name (fun ast (a, b, c) ->
+      check ast a b c;
+      mk (Type.parse_ty env a) (Type.parse_ty env b) (Type.parse_ty env c))
+
+let ty_app3_ast
+    (type env) (type ty)
+    (module Type : Tff_intf.S with type env = env and type Ty.t = ty)
+    ?(check=(fun _ _ _ _ -> ())) env name mk =
+  make_op3 (module Type) env name (fun ast (a, b, c) ->
+      check ast a b c;
+      mk ast (Type.parse_ty env a) (Type.parse_ty env b) (Type.parse_ty env c))
+
+let term_app3
+    (type env) (type term)
+    (module Type : Tff_intf.S with type env = env and type T.t = term)
+    ?(check=(fun _ _ _ _ -> ())) env name mk =
+  make_op3 (module Type) env name (fun ast (a, b, c) ->
+      check ast a b c;
+      mk (Type.parse_term env a) (Type.parse_term env b) (Type.parse_term env c))
+
+let term_app3_ast
+    (type env) (type term)
+    (module Type : Tff_intf.S with type env = env and type T.t = term)
+    ?(check=(fun _ _ _ _ -> ())) env name mk =
+  make_op3 (module Type) env name (fun ast (a, b, c) ->
+      check ast a b c;
+      mk ast (Type.parse_term env a) (Type.parse_term env b) (Type.parse_term env c))
+
+
+(* Quaternary applications *)
+
+let ty_app4
+    (type env) (type ty)
+    (module Type : Tff_intf.S with type env = env and type Ty.t = ty)
+    ?(check=(fun _ _ _ _ _ -> ())) env name mk =
+  make_op4 (module Type) env name (fun ast (a, b, c, d) ->
+      check ast a b c d;
+      mk (Type.parse_ty env a) (Type.parse_ty env b)
+        (Type.parse_ty env c) (Type.parse_ty env d))
+
+let ty_app4_ast
+    (type env) (type ty)
+    (module Type : Tff_intf.S with type env = env and type Ty.t = ty)
+    ?(check=(fun _ _ _ _ _ -> ())) env name mk =
+  make_op4 (module Type) env name (fun ast (a, b, c, d) ->
+      check ast a b c d;
+      mk ast (Type.parse_ty env a) (Type.parse_ty env b)
+        (Type.parse_ty env c) (Type.parse_ty env d))
+
+let term_app4
+    (type env) (type term)
+    (module Type : Tff_intf.S with type env = env and type T.t = term)
+    ?(check=(fun _ _ _ _ _ -> ())) env name mk =
+  make_op4 (module Type) env name (fun ast (a, b, c, d) ->
+      check ast a b c d;
+      mk (Type.parse_term env a) (Type.parse_term env b)
+        (Type.parse_term env c) (Type.parse_term env d))
+
+let term_app4_ast
+    (type env) (type term)
+    (module Type : Tff_intf.S with type env = env and type T.t = term)
+    ?(check=(fun _ _ _ _ _ -> ())) env name mk =
+  make_op4 (module Type) env name (fun ast (a, b, c, d) ->
+      check ast a b c d;
+      mk ast (Type.parse_term env a) (Type.parse_term env b)
+        (Type.parse_term env c) (Type.parse_term env d))
+
+
+(* Left associative applications *)
+
+let term_app_left
+    (type env) (type term)
+    (module Type : Tff_intf.S with type env = env and type T.t = term)
+    ?(check=(fun _ _ -> ())) env name mk =
+  make_assoc (module Type) env name (fun ast l ->
+      check ast l;
+      fold_left_assoc mk (List.map (Type.parse_term env) l))
+
+let term_app_left_ast
+    (type env) (type term)
+    (module Type : Tff_intf.S with type env = env and type T.t = term)
+    ?(check=(fun _ _ -> ())) env name mk =
+  make_assoc (module Type) env name (fun ast l ->
+      check ast l;
+      fold_left_assoc (mk ast) (List.map (Type.parse_term env) l))
+
+
+(* Right associative applications *)
+
+let term_app_right
+    (type env) (type term)
+    (module Type : Tff_intf.S with type env = env and type T.t = term)
+    ?(check=(fun _ _ -> ())) env name mk =
+  make_assoc (module Type) env name (fun ast l ->
+      check ast l;
+      fold_right_assoc mk (List.map (Type.parse_term env) l))
+
+let term_app_right_ast
+    (type env) (type term)
+    (module Type : Tff_intf.S with type env = env and type T.t = term)
+    ?(check=(fun _ _ -> ())) env name mk =
+  make_assoc (module Type) env name (fun ast l ->
+      check ast l;
+      fold_right_assoc (mk ast) (List.map (Type.parse_term env) l))
+
+
+(* Chained applications *)
+
+let term_app_chain
+    (type env) (type term)
+    (module Type : Tff_intf.S with type env = env and type T.t = term)
+    ?(check=(fun _ _ -> ())) env name mk =
+  make_chain (module Type) env name (fun ast l ->
+      check ast l;
+      let l' = List.map (Type.parse_term env) l in
+      map_chain (module Type) mk l'
+    )
+
+let term_app_chain_ast
+    (type env) (type term)
+    (module Type : Tff_intf.S with type env = env and type T.t = term)
+    ?(check=(fun _ _ -> ())) env name mk =
+  make_chain (module Type) env name (fun ast l ->
+      check ast l;
+      let l' = List.map (Type.parse_term env) l in
+      map_chain (module Type) (mk ast) l'
+    )
 
-end
 
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/base.mli b/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/base.mli
index 16499b8443cd9fb497496fab3e18bed553e3fd56..c6e991500f7c9ef547bdde49983d0f33af4793a1 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/base.mli
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/base.mli
@@ -1,19 +1,60 @@
 
-(** {2 Helpers} *)
+(** {2 Builtin functions manipulations} *)
 
-val noop : 'a -> 'b -> 'c -> 'd -> 'e option
+val noop : _ -> _ -> [> `Not_found ]
 (** Noop builtins function. *)
 
 val merge :
-  ('a -> 'b -> 'c -> 'd -> 'e option) list ->
-  'a -> 'b -> 'c -> 'd -> 'e option
+  ('a -> 'b -> ([> `Not_found ] as 'c)) list ->
+  'a -> 'b -> 'c
 (** A convenient function for merging a list of
     builtin parser functions into a single builtin function. *)
 
+(** {2 Smtlib Indexed id helpers} *)
+
+type 'ret indexed = [
+  | `Unary of (string -> 'ret)
+  | `Binary of (string -> string -> 'ret)
+  | `Ternary of (string -> string -> string -> 'ret)
+  | `Nary of int * (string list -> 'ret)
+]
+(** The type of indexed family of operators. *)
+
+val parse_id :
+  Dolmen.Std.Id.t ->
+  (string * 'ret indexed) list ->
+  err:(string -> int -> int -> 'ret) ->
+  k:(string list -> 'ret) ->
+  'ret
+(** [parse_id id l ~err ~k] splits [id] (using {split_id})
+    into a list. If the list has a head [s] and a tail [l], it tries and find
+    in the list [l] a pair (s', indexed) such that [s = s'].
+    If the length of [l] matches the arity of [indexed], the provided function
+    is called, else [err] is called with [s], the arity of [indexed],
+    and the lenght of [l].
+    If no match is found or the split list does not contain a head and a
+    tail, [k] is called wiht the split list. *)
+
+val bad_ty_index_arity :
+  (module Tff_intf.S with type env = 'env and type Ty.t = 'ty) ->
+  'env -> string -> int -> int ->
+  [> `Ty of (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'ty) ]
+(** Suitable [err] function for {parse_id} for typing sort indexed families. *)
+
+val bad_term_index_arity :
+  (module Tff_intf.S with type env = 'env and type T.t = 'term) ->
+  'env -> string -> int -> int ->
+  [> `Term of (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'term) ]
+(** Suitable [err] function for {parse_id} for typing term indexed families. *)
+
+
+
+(** {2 Low-level helpers} *)
+
 type ('env, 'args, 'ret) helper =
   (module Tff_intf.S with type env = 'env) ->
-  'env -> Dolmen.Term.t -> string -> Dolmen.Term.t list ->
-  ('args -> 'ret) -> 'ret option
+  'env -> string -> (Dolmen.Std.Term.t -> 'args -> 'ret) ->
+  (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'ret)
 
 val make_op0: (_, unit, _) helper
 (** [make_op (module Type) env ast op arity args ret] checks
@@ -21,31 +62,31 @@ val make_op0: (_, unit, _) helper
     else it raises the appropriate exception from the
     typechecking module. *)
 
-val make_op1: (_, Dolmen.Term.t, _) helper
+val make_op1: (_, Dolmen.Std.Term.t, _) helper
 (** Same as {!make_op0} but the returning function
     takes a term as argument. *)
 
-val make_op2 : (_, Dolmen.Term.t * Dolmen.Term.t, _) helper
+val make_op2 : (_, Dolmen.Std.Term.t * Dolmen.Std.Term.t, _) helper
 (** Same as {!make_op0} but the returning function
     takes a couple of terms as argument. *)
 
 val make_op3 :
-  (_, Dolmen.Term.t * Dolmen.Term.t * Dolmen.Term.t, _) helper
+  (_, Dolmen.Std.Term.t * Dolmen.Std.Term.t * Dolmen.Std.Term.t, _) helper
 (** Same as {!make_op0} but the returning function
     takes a triple of terms as argument. *)
 
 val make_op4 :
-  (_, Dolmen.Term.t * Dolmen.Term.t * Dolmen.Term.t * Dolmen.Term.t, _) helper
+  (_, Dolmen.Std.Term.t * Dolmen.Std.Term.t * Dolmen.Std.Term.t * Dolmen.Std.Term.t, _) helper
 (** Same as {!make_op0} but the returning function
     takes a quadruple of terms as argument. *)
 
 val make_opn :
-  int -> (_, Dolmen.Term.t list, _) helper
+  int -> (_, Dolmen.Std.Term.t list, _) helper
 (** Same as {!make_op0} but takes an arity first,
     and the returning function takes a list of terms as argument.
     The list is guaranteed to have the same length as the given arity. *)
 
-val make_assoc : (_, Dolmen.Term.t list, _) helper
+val make_assoc : (_, Dolmen.Std.Term.t list, _) helper
 (** Ensures the list of arguments is at least of size 2 (used for associative
     symbols). *)
 
@@ -57,7 +98,7 @@ val fold_right_assoc : ('a -> 'a -> 'a) -> 'a list -> 'a
 (** Fold application of a right-associative function on a list.
     @raise Invalid_argument if the list is empty. *)
 
-val make_chain : (_, Dolmen.Term.t list, _) helper
+val make_chain : (_, Dolmen.Std.Term.t list, _) helper
 (** Ensures the list of arguments is at least of size 2 (used for chainable
     symbols). *)
 
@@ -71,92 +112,164 @@ val map_chain :
     [Type.T._and \[mk t1 t2; mk t2 t3; ..\]] *)
 
 
-(** {2 Smtlib logic detection} *)
-
-type smtlib_theory = [
-  | `Core
-  | `Arrays
-  | `Bitvectors
-  | `Floats
-  | `Ints
-  | `Reals
-  | `Reals_Ints
-]
-(** Smtlib theories. *)
-
-type smtlib_restriction = [
-  | `No_free_symbol
-  | `Quantifier_free
-  | `Difference_logic
-  | `Linear_arithmetic
-]
-(** Smtlib restrictions. *)
-
-type smtlib_logic = {
-  theories      : smtlib_theory list;
-  restrictions  : smtlib_restriction list;
-}
-(** Structured representation of an smtlib logic. *)
-
-val smtlib_logic : string -> smtlib_logic option
-(** Parses an smtlib logic string and returns its structured version. *)
-
-val all_smtlib_logic : smtlib_logic
-(** Biggest logic available in smtlib *)
-
-(** {2 Languages base builtins} *)
-
-(** AE builtins *)
-module Ae : sig
+(** {2 High level helpers} *)
 
-  (** Builtin symbols for tptp's tff *)
-  module Tff
-      (Type : Tff_intf.S)
-      (Ty : Dolmen.Intf.Ty.Ae_Base with type t = Type.Ty.t)
-      (T : Dolmen.Intf.Term.Ae_Base with type t = Type.T.t) : sig
-
-    val parse : Type.builtin_symbols
-
-  end
-end
-
-(** TPTP builtins ($i, $o, etc..) *)
-module Tptp : sig
-
-  (** Builtin symbols for tptp's tff *)
-  module Tff
-      (Type : Tff_intf.S)
-      (Ty : Dolmen.Intf.Ty.Tptp_Base with type t = Type.Ty.t)
-      (T : Dolmen.Intf.Term.Tptp_Base with type t = Type.T.t) : sig
-
-    val parse : Dolmen_tptp.version -> Type.builtin_symbols
-
-  end
-end
-
-
-(** Smtlib builtin *)
-module Smtlib2 : sig
-
-  (** Builtins for smtlib's core theory *)
-  module Tff
-      (Type : Tff_intf.S)
-      (Tag : Dolmen.Intf.Tag.Smtlib_Base with type 'a t = 'a Type.Tag.t)
-      (Ty : Dolmen.Intf.Ty.Smtlib_Base with type t = Type.Ty.t)
-      (T : Dolmen.Intf.Term.Smtlib_Base with type t = Type.T.t) : sig
-
-    val parse : Dolmen_smtlib2.version -> Type.builtin_symbols
-  end
-end
+val app0 :
+  (module Tff_intf.S with type env = 'env) ->
+  ?check:(Dolmen.Std.Term.t -> unit) ->
+  'env -> string -> ('ret) ->
+  (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'ret)
 
-(** Zf builtins *)
-module Zf : sig
+val app0_ast :
+  (module Tff_intf.S with type env = 'env) ->
+  ?check:(Dolmen.Std.Term.t -> unit) ->
+  'env -> string -> (Dolmen.Std.Term.t -> 'ret) ->
+  (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'ret)
+
+
+val ty_app1 :
+  (module Tff_intf.S with type env = 'env and type Ty.t = 'ty) ->
+  ?check:(Dolmen.Std.Term.t -> Dolmen.Std.Term.t -> unit) ->
+  'env -> string -> ('ty -> 'ty) ->
+  (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'ty)
+
+val ty_app1_ast :
+  (module Tff_intf.S with type env = 'env and type Ty.t = 'ty) ->
+  ?check:(Dolmen.Std.Term.t -> Dolmen.Std.Term.t -> unit) ->
+  'env -> string -> (Dolmen.Std.Term.t -> 'ty -> 'ty) ->
+  (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'ty)
+
+val term_app1 :
+  (module Tff_intf.S with type env = 'env and type T.t = 'term) ->
+  ?check:(Dolmen.Std.Term.t -> Dolmen.Std.Term.t -> unit) ->
+  'env -> string -> ('term -> 'term) ->
+  (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'term)
+
+val term_app1_ast :
+  (module Tff_intf.S with type env = 'env and type T.t = 'term) ->
+  ?check:(Dolmen.Std.Term.t -> Dolmen.Std.Term.t -> unit) ->
+  'env -> string -> (Dolmen.Std.Term.t -> 'term -> 'term) ->
+  (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'term)
+
+
+val ty_app2 :
+  (module Tff_intf.S with type env = 'env and type Ty.t = 'ty) ->
+  ?check:(Dolmen.Std.Term.t -> Dolmen.Std.Term.t -> Dolmen.Std.Term.t -> unit) ->
+  'env -> string -> ('ty -> 'ty -> 'ty) ->
+  (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'ty)
+
+val ty_app2_ast :
+  (module Tff_intf.S with type env = 'env and type Ty.t = 'ty) ->
+  ?check:(Dolmen.Std.Term.t -> Dolmen.Std.Term.t -> Dolmen.Std.Term.t -> unit) ->
+  'env -> string -> (Dolmen.Std.Term.t -> 'ty -> 'ty -> 'ty) ->
+  (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'ty)
+
+val term_app2 :
+  (module Tff_intf.S with type env = 'env and type T.t = 'term) ->
+  ?check:(Dolmen.Std.Term.t -> Dolmen.Std.Term.t -> Dolmen.Std.Term.t -> unit) ->
+  'env -> string -> ('term -> 'term -> 'term) ->
+  (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'term)
+
+val term_app2_ast :
+  (module Tff_intf.S with type env = 'env and type T.t = 'term) ->
+  ?check:(Dolmen.Std.Term.t -> Dolmen.Std.Term.t -> Dolmen.Std.Term.t -> unit) ->
+  'env -> string -> (Dolmen.Std.Term.t -> 'term -> 'term -> 'term) ->
+  (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'term)
+
+
+val ty_app3 :
+  (module Tff_intf.S with type env = 'env and type Ty.t = 'ty) ->
+  ?check:(Dolmen.Std.Term.t -> Dolmen.Std.Term.t ->
+          Dolmen.Std.Term.t -> Dolmen.Std.Term.t -> unit) ->
+  'env -> string -> ('ty -> 'ty -> 'ty -> 'ty) ->
+  (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'ty)
+
+val ty_app3_ast :
+  (module Tff_intf.S with type env = 'env and type Ty.t = 'ty) ->
+  ?check:(Dolmen.Std.Term.t -> Dolmen.Std.Term.t ->
+          Dolmen.Std.Term.t -> Dolmen.Std.Term.t -> unit) ->
+  'env -> string -> (Dolmen.Std.Term.t -> 'ty -> 'ty -> 'ty -> 'ty) ->
+  (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'ty)
+
+val term_app3 :
+  (module Tff_intf.S with type env = 'env and type T.t = 'term) ->
+  ?check:(Dolmen.Std.Term.t -> Dolmen.Std.Term.t ->
+          Dolmen.Std.Term.t -> Dolmen.Std.Term.t -> unit) ->
+  'env -> string -> ('term -> 'term -> 'term -> 'term) ->
+  (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'term)
+
+val term_app3_ast :
+  (module Tff_intf.S with type env = 'env and type T.t = 'term) ->
+  ?check:(Dolmen.Std.Term.t -> Dolmen.Std.Term.t ->
+          Dolmen.Std.Term.t -> Dolmen.Std.Term.t -> unit) ->
+  'env -> string -> (Dolmen.Std.Term.t -> 'term -> 'term -> 'term -> 'term) ->
+  (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'term)
+
+
+val ty_app4 :
+  (module Tff_intf.S with type env = 'env and type Ty.t = 'ty) ->
+  ?check:(Dolmen.Std.Term.t -> Dolmen.Std.Term.t -> Dolmen.Std.Term.t ->
+          Dolmen.Std.Term.t -> Dolmen.Std.Term.t -> unit) ->
+  'env -> string -> ('ty -> 'ty -> 'ty -> 'ty -> 'ty) ->
+  (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'ty)
+
+val ty_app4_ast :
+  (module Tff_intf.S with type env = 'env and type Ty.t = 'ty) ->
+  ?check:(Dolmen.Std.Term.t -> Dolmen.Std.Term.t -> Dolmen.Std.Term.t ->
+          Dolmen.Std.Term.t -> Dolmen.Std.Term.t -> unit) ->
+  'env -> string -> (Dolmen.Std.Term.t -> 'ty -> 'ty -> 'ty -> 'ty -> 'ty) ->
+  (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'ty)
+
+val term_app4 :
+  (module Tff_intf.S with type env = 'env and type T.t = 'term) ->
+  ?check:(Dolmen.Std.Term.t -> Dolmen.Std.Term.t -> Dolmen.Std.Term.t ->
+          Dolmen.Std.Term.t -> Dolmen.Std.Term.t -> unit) ->
+  'env -> string -> ('term -> 'term -> 'term -> 'term -> 'term) ->
+  (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'term)
+
+val term_app4_ast :
+  (module Tff_intf.S with type env = 'env and type T.t = 'term) ->
+  ?check:(Dolmen.Std.Term.t -> Dolmen.Std.Term.t -> Dolmen.Std.Term.t ->
+          Dolmen.Std.Term.t -> Dolmen.Std.Term.t -> unit) ->
+  'env -> string -> (Dolmen.Std.Term.t -> 'term -> 'term -> 'term -> 'term -> 'term) ->
+  (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'term)
+
+
+val term_app_left :
+  (module Tff_intf.S with type env = 'env and type T.t = 'term) ->
+  ?check:(Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> unit) ->
+  'env -> string -> ('term -> 'term -> 'term) ->
+  (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'term)
+
+val term_app_left_ast :
+  (module Tff_intf.S with type env = 'env and type T.t = 'term) ->
+  ?check:(Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> unit) ->
+  'env -> string -> (Dolmen.Std.Term.t -> 'term -> 'term -> 'term) ->
+  (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'term)
+
+val term_app_right :
+  (module Tff_intf.S with type env = 'env and type T.t = 'term) ->
+  ?check:(Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> unit) ->
+  'env -> string -> ('term -> 'term -> 'term) ->
+  (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'term)
+
+val term_app_right_ast :
+  (module Tff_intf.S with type env = 'env and type T.t = 'term) ->
+  ?check:(Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> unit) ->
+  'env -> string -> (Dolmen.Std.Term.t -> 'term -> 'term -> 'term) ->
+  (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'term)
+
+
+val term_app_chain :
+  (module Tff_intf.S with type env = 'env and type T.t = 'term) ->
+  ?check:(Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> unit) ->
+  'env -> string -> ('term -> 'term -> 'term) ->
+  (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'term)
+
+val term_app_chain_ast :
+  (module Tff_intf.S with type env = 'env and type T.t = 'term) ->
+  ?check:(Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> unit) ->
+  'env -> string -> (Dolmen.Std.Term.t -> 'term -> 'term -> 'term) ->
+  (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> 'term)
 
-  (** Builtins for smtlib's core theory *)
-  module Tff
-      (Type : Tff_intf.S)
-      (Tag : Dolmen.Intf.Tag.Zf_Base with type 'a t = 'a Type.Tag.t) : sig
 
-    val parse : Type.builtin_symbols
-  end
-end
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/bitv.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/bitv.ml
index b0f65efb37be7c7fac9bb9e858271b1505f488f1..56d4b8a5f001ca0df962605df53e50dfff38ee8b 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/bitv.ml
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/bitv.ml
@@ -1,5 +1,5 @@
 
-open Dolmen
+module Id = Dolmen.Std.Id
 
 (* Smtlib Bitvector *)
 (* ************************************************************************ *)
@@ -8,230 +8,169 @@ module Smtlib2 = struct
 
   module Tff
       (Type : Tff_intf.S)
-      (Ty : Dolmen.Intf.Ty.Smtlib_Bitv with type t = Type.Ty.t)
-      (T : Dolmen.Intf.Term.Smtlib_Bitv with type t = Type.T.t) = struct
-
-    type Type.err +=
-      | Invalid_bin_char of char
-      | Invalid_hex_char of char
-
-    let check_bin env ast = function
-      | '0' | '1' -> ()
-      | c ->
-        let err = Invalid_bin_char c in
-        raise (Type.Typing_error (err, env, ast))
-
-    let hex_to_bin env ast = function
-      | '0' -> "0000"
-      | '1' -> "0001"
-      | '2' -> "0010"
-      | '3' -> "0011"
-      | '4' -> "0100"
-      | '5' -> "0101"
-      | '6' -> "0110"
-      | '7' -> "0111"
-      | '8' -> "1000"
-      | '9' -> "1001"
-      | 'a' | 'A' -> "1010"
-      | 'b' | 'B' -> "1011"
-      | 'c' | 'C' -> "1100"
-      | 'd' | 'D' -> "1101"
-      | 'e' | 'E' -> "1110"
-      | 'f' | 'F' -> "1111"
-      | c ->
-        let err = Invalid_hex_char c in
-        raise (Type.Typing_error (err, env, ast))
-
-    let parse_binary env ast s =
-      assert (String.length s > 2 && s.[0] = '#' && s.[1] = 'b');
-      let s' = String.sub s 2 (String.length s - 2) in
-      String.iter (check_bin env ast) s';
-      Type.Term (T.mk_bitv s')
-
-    let parse_hexa env ast s =
-      assert (String.length s > 2 && s.[0] = '#' && s.[1] = 'x');
-      let b = Bytes.create ((String.length s - 2) * 4) in
-      for i=2 to (String.length s - 1) do
-        Bytes.blit_string (hex_to_bin env ast s.[i]) 0 b ((i-2) * 4) 4
-      done;
-      let s' = Bytes.to_string b in
-      Type.Term (T.mk_bitv s')
-
-    let parse_extended_lit _env _ast s n =
-      assert (String.length s >= 2);
-      let s' = String.sub s 2 (String.length s - 2) in
-      match Z.of_string s' with
-      | exception Failure _ -> None
-      | z ->
-        let z = Z.rem z (Z.shift_left Z.one n) in
-        let s'' = Z.format (Printf.sprintf "%%0%ib" n) z in
-        Some (Type.Term (T.mk_bitv s''))
-
-    let split_id = Dolmen_std.Misc.split_on_char '\000'
-
-    let parse_id env ast id l k =
-      let rec aux h r r_l = function
-        | [] -> k (h :: r)
-        | (s, n, f) :: l' ->
-          if String.equal s h then begin
-            if r_l = n then f r
-            else begin
-              let err = Type.Bad_op_arity (s, n, r_l) in
-              raise (Type.Typing_error (err, env, ast))
-            end
-          end else
-            aux h r r_l l'
-      in
-      match split_id id with
-      | h :: r -> aux h r (List.length r) l
-      | r -> k r
+      (Ty : Dolmen.Intf.Ty.Smtlib_Bitv with type t := Type.Ty.t)
+      (T : Dolmen.Intf.Term.Smtlib_Bitv with type t := Type.T.t) = struct
 
-    let parse_int env ast s =
-      try int_of_string s
-      with Failure _ ->
-        let err = Type.Expected ("an integer", None) in
-        raise (Type.Typing_error (err, env, ast))
-
-    let app1 env ast args name mk =
-      Base.make_op1 (module Type) env ast name args
-        (fun t -> Type.Term (mk (Type.parse_term env t)))
+    type _ Type.err +=
+      | Invalid_bin_char : char -> Dolmen.Std.Term.t Type.err
+      | Invalid_hex_char : char -> Dolmen.Std.Term.t Type.err
+      | Invalid_dec_char : char -> Dolmen.Std.Term.t Type.err
 
-    let app2 env ast args name mk =
-      Base.make_op2 (module Type) env ast name args
-        (fun (a, b) ->
-           Type.Term (mk (Type.parse_term env a) (Type.parse_term env b)))
+    let parse_int env ast s =
+      match int_of_string s with
+      | i when i >= 0 -> i
+      | _ ->
+        Type._error env (Ast ast)
+          (Type.Expected ("a positive integer", None))
+      | exception Failure _ ->
+        Type._error env (Ast ast)
+          (Type.Expected ("a positive integer", None))
+
+    let parse_binary env s ast =
+      match Misc.Bitv.parse_binary s with
+      | s -> T.mk s
+      | exception Misc.Bitv.Invalid_char c ->
+        Type._error env (Ast ast) (Invalid_bin_char c)
+
+    let parse_hexa env s ast =
+      match Misc.Bitv.parse_hexa s with
+      | s -> T.mk s
+      | exception Misc.Bitv.Invalid_char c ->
+        Type._error env (Ast ast) (Invalid_hex_char c)
+
+    let parse_extended_lit env s n =
+      Base.make_op0 (module Type) env s (fun ast () ->
+          assert (String.length s >= 2);
+          let n = parse_int env ast n in
+          match Misc.Bitv.parse_decimal s n with
+          | s -> T.mk s
+          | exception Misc.Bitv.Invalid_char c ->
+            Type._error env (Ast ast) (Invalid_dec_char c)
+        )
+
+    let indexed1 env mk i_s ast =
+      let i = parse_int env ast i_s in
+      mk i
+
+    let indexed2 env mk i_s j_s ast =
+      let i = parse_int env ast i_s in
+      let j = parse_int env ast j_s in
+      mk i j
+
+    let parse _version env s =
+      match s with
 
-    let app_left env ast args name mk =
-      Base.make_assoc (module Type) env ast name args
-        (fun l -> Type.Term (Base.fold_left_assoc mk (List.map (Type.parse_term env) l)))
+      (* Bitvector sort *)
+      | Type.Id ({ Id.ns = Id.Sort; _ } as id) ->
+        Base.parse_id id [
+          "BitVec", `Unary (function n_s ->
+              `Ty (Base.app0_ast (module Type) env "BitVec" (fun ast ->
+                  Ty.bitv (parse_int env ast n_s))));
+        ] ~err:(Base.bad_ty_index_arity (module Type) env)
+          ~k:(fun _ -> `Not_found)
 
-    let parse _version env ast s args =
-      match s with
-      (* sort *)
-      | Type.Id { Id.ns = Id.Sort; name; } ->
-        parse_id env ast name [
-          "BitVec", 1, (function
-              | [n_s] ->
-                Base.make_op0 (module Type) env ast "BitVec" args
-                  (fun () -> Type.Ty (Ty.bitv (parse_int env ast n_s)))
-              | _ -> assert false);
-        ] (fun _ -> None)
-      (* values *)
+      (* Bitvector litterals *)
       | Type.Id { Id.ns = Id.Value Id.Binary; name; } ->
-        Base.make_op0 (module Type) env ast name args
-          (fun () -> parse_binary env ast name)
+        `Term (Base.app0_ast (module Type) env name (parse_binary env name))
       | Type.Id { Id.ns = Id.Value Id.Hexadecimal; name; } ->
-        Base.make_op0 (module Type) env ast name args
-          (fun () -> parse_hexa env ast name)
+        `Term (Base.app0_ast (module Type) env name (parse_hexa env name))
+
       (* terms *)
-      | Type.Id { Id.ns = Id.Term; name; } ->
-        parse_id env ast name [
-          "repeat", 1, (function
-              | [i_s] ->
-                let i = parse_int env ast i_s in
-                Base.make_op1 (module Type) env ast "repeat" args
-                  (fun b -> Type.Term (T.bitv_repeat i (Type.parse_term env b)))
-              | _ -> assert false);
-          "zero_extend", 1, (function
-              | [i_s] ->
-                let i = parse_int env ast i_s in
-                Base.make_op1 (module Type) env ast "zero_extend" args
-                  (fun b -> Type.Term (T.zero_extend i (Type.parse_term env b)))
-              | _ -> assert false);
-          "sign_extend", 1, (function
-              | [i_s] ->
-                let i = parse_int env ast i_s in
-                Base.make_op1 (module Type) env ast "sign_extend" args
-                  (fun b -> Type.Term (T.sign_extend i (Type.parse_term env b)))
-              | _ -> assert false);
-          "rotate_right", 1, (function
-              | [i_s] ->
-                let i = parse_int env ast i_s in
-                Base.make_op1 (module Type) env ast "rotate_right" args
-                  (fun b -> Type.Term (T.rotate_right i (Type.parse_term env b)))
-              | _ -> assert false);
-          "rotate_left", 1, (function
-              | [i_s] ->
-                let i = parse_int env ast i_s in
-                Base.make_op1 (module Type) env ast "rotate_left" args
-                  (fun b -> Type.Term (T.rotate_left i (Type.parse_term env b)))
-              | _ -> assert false);
-          "extract", 2, (function
-              | [ i_s; j_s ] ->
-                let i = parse_int env ast i_s in
-                let j = parse_int env ast j_s in
-                Base.make_op1 (module Type) env ast "extract" args
-                  (fun b ->
-                     let b_t = Type.parse_term env b in
-                     Type.Term (T.bitv_extract i j b_t)
-                  )
-              | _ -> assert false);
-        ] (function
-            | [s; n] when (String.length s >= 2 &&
-                           s.[0] = 'b' && s.[1] = 'v') ->
-              parse_extended_lit env ast s (parse_int env ast n)
-
-            | ["bvnot"] ->
-              app1 env ast args "bvnot" T.bvnot
-            | ["bvand"] ->
-              app_left env ast args "bvand" T.bvand
-            | ["bvor"] ->
-              app_left env ast args "bvor" T.bvor
-            | ["bvnand"] ->
-              app2 env ast args "bvnand" T.bvnand
-            | ["bvnor"] ->
-              app2 env ast args "bvnor" T.bvnor
-            | ["bvxor"] ->
-              app_left env ast args "bvxor" T.bvxor
-            | ["bvxnor"] ->
-              app_left env ast args "bvxnor" T.bvxnor
-            | ["bvcomp"] ->
-              app2 env ast args "bvcomp" T.bvcomp
-            | ["bvneg"] ->
-              app1 env ast args "bvneg" T.bvneg
-            | ["bvadd"] ->
-              app_left env ast args "bvadd" T.bvadd
-            | ["bvsub"] ->
-              app2 env ast args "bvsub" T.bvsub
-            | ["bvmul"] ->
-              app_left env ast args "bvmul" T.bvmul
-            | ["bvudiv"] ->
-              app2 env ast args "bvudiv" T.bvudiv
-            | ["bvsdiv"] ->
-              app2 env ast args "bvsdiv" T.bvsdiv
-            | ["bvurem"] ->
-              app2 env ast args "bvurem" T.bvurem
-            | ["bvsrem"] ->
-              app2 env ast args "bvsrem" T.bvsrem
-            | ["bvsmod"] ->
-              app2 env ast args "bvsmod" T.bvsmod
-            | ["bvshl"] ->
-              app2 env ast args "bvshl" T.bvshl
-            | ["bvlshr"] ->
-              app2 env ast args "bvlshr" T.bvlshr
-            | ["bvashr"] ->
-              app2 env ast args "bvashr" T.bvashr
-            | ["bvult"] ->
-              app_left env ast args "bvult" T.bvult
-            | ["bvule"] ->
-              app_left env ast args "bvule" T.bvule
-            | ["bvugt"] ->
-              app_left env ast args "bvugt" T.bvugt
-            | ["bvuge"] ->
-              app_left env ast args "bvuge" T.bvuge
-            | ["bvsgt"] ->
-              app_left env ast args "bvsgt" T.bvsgt
-            | ["bvsge"] ->
-              app_left env ast args "bvsge" T.bvsge
-            | ["bvslt"] ->
-              app_left env ast args "bvslt" T.bvslt
-            | ["bvsle"] ->
-              app_left env ast args "bvsle" T.bvsle
-            | ["concat"] ->
-              app2 env ast args "concat" T.bitv_concat
-            | _ -> None
-          )
-      | _ -> None
+      | Type.Id ({ Id.ns = Id.Term; _ } as id) ->
+        Base.parse_id id [
+          "repeat", `Unary (function i_s ->
+              `Term (Base.term_app1_ast (module Type) env "repeat"
+                       (indexed1 env T.repeat i_s)));
+          "zero_extend", `Unary (function i_s ->
+              `Term (Base.term_app1_ast (module Type) env "zero_extend"
+                       (indexed1 env T.zero_extend i_s)));
+          "sign_extend", `Unary (function i_s ->
+              `Term (Base.term_app1_ast (module Type) env "sign_extend"
+                       (indexed1 env T.sign_extend i_s)));
+          "rotate_right", `Unary (function i_s ->
+              `Term (Base.term_app1_ast (module Type) env "rotate_right"
+                       (indexed1 env T.rotate_right i_s)));
+          "rotate_left", `Unary (function i_s ->
+              `Term (Base.term_app1_ast (module Type) env "rotate_left"
+                       (indexed1 env T.rotate_left i_s)));
+          "extract", `Binary (fun i_s j_s ->
+              `Term (Base.term_app1_ast (module Type) env "extract"
+                       (indexed2 env T.extract i_s j_s)));
+        ] ~err:(Base.bad_term_index_arity (module Type) env)
+          ~k:(function
+              | [s; n] when (String.length s >= 2 &&
+                             s.[0] = 'b' && s.[1] = 'v') ->
+                `Term (parse_extended_lit env s n)
+
+              | ["bvnot"] ->
+                `Term (Base.term_app1 (module Type) env "bvnot" T.not)
+              | ["bvand"] ->
+                `Term (Base.term_app_left (module Type) env "bvand" T.and_)
+              | ["bvor"] ->
+                `Term (Base.term_app_left (module Type) env "bvor" T.or_)
+              | ["bvnand"] ->
+                `Term (Base.term_app2 (module Type) env "bvnand" T.nand)
+              | ["bvnor"] ->
+                `Term (Base.term_app2 (module Type) env "bvnor" T.nor)
+              | ["bvxor"] ->
+                `Term (Base.term_app_left (module Type) env "bvxor" T.xor)
+              | ["bvxnor"] ->
+                `Term (Base.term_app_left (module Type) env "bvxnor" T.xnor)
+
+              | ["bvcomp"] ->
+                `Term (Base.term_app2 (module Type) env "bvcomp" T.comp)
+
+              | ["bvneg"] ->
+                `Term (Base.term_app1 (module Type) env "bvneg" T.neg)
+              | ["bvadd"] ->
+                `Term (Base.term_app_left (module Type) env "bvadd" T.add)
+              | ["bvsub"] ->
+                `Term (Base.term_app2 (module Type) env "bvsub" T.sub)
+              | ["bvmul"] ->
+                `Term (Base.term_app_left (module Type) env "bvmul" T.mul)
+
+              | ["bvudiv"] ->
+                `Term (Base.term_app2 (module Type) env "bvudiv" T.udiv)
+              | ["bvurem"] ->
+                `Term (Base.term_app2 (module Type) env "bvurem" T.urem)
+
+              | ["bvsdiv"] ->
+                `Term (Base.term_app2 (module Type) env "bvsdiv" T.sdiv)
+              | ["bvsrem"] ->
+                `Term (Base.term_app2 (module Type) env "bvsrem" T.srem)
+              | ["bvsmod"] ->
+                `Term (Base.term_app2 (module Type) env "bvsmod" T.smod)
+
+              | ["bvshl"] ->
+                `Term (Base.term_app2 (module Type) env "bvshl" T.shl)
+              | ["bvlshr"] ->
+                `Term (Base.term_app2 (module Type) env "bvlshr" T.lshr)
+              | ["bvashr"] ->
+                `Term (Base.term_app2 (module Type) env "bvashr" T.ashr)
+
+              | ["bvult"] ->
+                `Term (Base.term_app2 (module Type) env "bvult" T.ult)
+              | ["bvule"] ->
+                `Term (Base.term_app2 (module Type) env "bvule" T.ule)
+              | ["bvugt"] ->
+                `Term (Base.term_app2 (module Type) env "bvugt" T.ugt)
+              | ["bvuge"] ->
+                `Term (Base.term_app2 (module Type) env "bvuge" T.uge)
+
+              | ["bvslt"] ->
+                `Term (Base.term_app2 (module Type) env "bvslt" T.slt)
+              | ["bvsle"] ->
+                `Term (Base.term_app2 (module Type) env "bvsle" T.sle)
+              | ["bvsgt"] ->
+                `Term (Base.term_app2 (module Type) env "bvsgt" T.sgt)
+              | ["bvsge"] ->
+                `Term (Base.term_app2 (module Type) env "bvsge" T.sge)
+
+              | ["concat"] ->
+                `Term (Base.term_app2 (module Type) env "concat" T.concat)
+              | _ -> `Not_found
+            )
+      | _ -> `Not_found
 
   end
 end
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/bitv.mli b/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/bitv.mli
index 23c020e2ce8685cbe6ee4ea279d7d7537c83fc2c..d07e1112830c8647306101c96efbf9917a8f504d 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/bitv.mli
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/bitv.mli
@@ -5,20 +5,16 @@ module Smtlib2 : sig
 
   module Tff
       (Type : Tff_intf.S)
-      (Ty : Dolmen.Intf.Ty.Smtlib_Bitv with type t = Type.Ty.t)
-      (T : Dolmen.Intf.Term.Smtlib_Bitv with type t = Type.T.t) : sig
+      (Ty : Dolmen.Intf.Ty.Smtlib_Bitv with type t := Type.Ty.t)
+      (T : Dolmen.Intf.Term.Smtlib_Bitv with type t := Type.T.t) : sig
 
-    type Type.err +=
-      | Invalid_bin_char of char
-      | Invalid_hex_char of char
+    type _ Type.err +=
+      | Invalid_bin_char : char -> Dolmen.Std.Term.t Type.err
+      | Invalid_hex_char : char -> Dolmen.Std.Term.t Type.err
+      | Invalid_dec_char : char -> Dolmen.Std.Term.t Type.err
 
-    val parse : Dolmen_smtlib2.version -> Type.builtin_symbols
+    val parse : Dolmen.Smtlib2.version -> Type.builtin_symbols
 
-    val parse_binary : Type.env -> Dolmen_std.Term.t -> string -> Type.res
-    (** parse binary constant into bitvector constants *)
-
-    val parse_hexa   : Type.env -> Dolmen_std.Term.t -> string -> Type.res
-    (** parse hexa constant into bitvector constants *)
   end
 
 end
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/core.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/core.ml
new file mode 100644
index 0000000000000000000000000000000000000000..e716d2ddafc4ddad7bd6175fdd7ead6c3178e9ae
--- /dev/null
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/core.ml
@@ -0,0 +1,215 @@
+
+module Id = Dolmen.Std.Id
+module Ast = Dolmen.Std.Term
+
+(* Alt-ergo builtins *)
+(* ************************************************************************ *)
+
+module Ae = struct
+
+  module Tff
+      (Type : Tff_intf.S)
+      (Ty : Dolmen.Intf.Ty.Ae_Base with type t = Type.Ty.t)
+      (T : Dolmen.Intf.Term.Ae_Base with type t = Type.T.t) = struct
+
+    let parse env s =
+      match s with
+      | Type.Builtin Ast.Bool ->
+        `Ty (Base.app0 (module Type) env "bool" Ty.bool)
+      | Type.Builtin Ast.Unit ->
+        `Ty (Base.app0 (module Type) env "unit" Ty.unit)
+      | Type.Builtin Ast.Void ->
+        `Term (Base.app0 (module Type) env "void" T.void)
+      | _ -> `Not_found
+
+  end
+
+end
+
+(* TPTP builtins ($i, $o, etc..) *)
+(* ************************************************************************ *)
+
+module Tptp = struct
+
+  module Tff
+      (Type : Tff_intf.S)
+      (Ty : Dolmen.Intf.Ty.Tptp_Base with type t = Type.Ty.t)
+      (T : Dolmen.Intf.Term.Tptp_Base with type t = Type.T.t) = struct
+
+    let parse _version env s =
+      match s with
+      (*
+      | Type.Id ({ Id.name = "$_"; ns = Id.Term } as id) ->
+        Some (Type.wildcard env ast id args)
+      *)
+      | Type.Id { Id.name = "$tType"; ns = Id.Term } ->
+        `Ttype (Base.app0 (module Type) env "$tType" ())
+      | Type.Id { Id.name = "$o"; ns = Id.Term } ->
+        `Ty (Base.app0 (module Type) env "$o" Ty.prop)
+      | Type.Id { Id.name = "$i"; ns = Id.Term } ->
+        `Ty (Base.app0 (module Type) env "$i" Ty.base)
+      | Type.Id { Id.name = "$true"; ns = Id.Term } ->
+        `Term (Base.app0 (module Type) env "$true" T._true)
+      | Type.Id { Id.name = "$false"; ns = Id.Term } ->
+        `Term (Base.app0 (module Type) env "$false" T._false)
+      | Type.Id id when Id.equal id Id.tptp_role ->
+        `Tags (fun _ast _args -> [])
+      | _ -> `Not_found
+
+  end
+
+end
+
+(* Smtlib builtins (bool, =, etc...) *)
+(* ************************************************************************ *)
+
+module Smtlib2 = struct
+
+  module Tff
+      (Type : Tff_intf.S)
+      (Tag : Dolmen.Intf.Tag.Smtlib_Base with type 'a t = 'a Type.Tag.t
+                                          and type term := Type.T.t)
+      (Ty : Dolmen.Intf.Ty.Smtlib_Base with type t = Type.Ty.t)
+      (T : Dolmen.Intf.Term.Smtlib_Base with type t = Type.T.t
+                                         and type cstr := Type.T.Cstr.t) = struct
+
+    let parse_symbol env = function
+      | { Ast.term = Ast.Symbol s; _ }
+      | { Ast.term = Ast.App ({ Ast.term = Ast.Symbol s; _ }, []); _ } ->
+        Id.full_name s
+      | ast ->
+        Type._error env (Ast ast) (Type.Expected ("symbol", None))
+
+    let parse_sexpr_list env = function
+      | { Ast.term = Ast.App (
+          { Ast.term = Ast.Symbol { Id.name = "$data"; ns = Id.Attr }; _ },
+          l); _} ->
+        l
+      | ast ->
+        Type._error env (Ast ast)
+          (Type.Expected ("a list of terms in a sexpr", None))
+
+    let parse_f env ast cstr args =
+      let loc = Ast.(ast.loc) in
+      let t = Ast.apply ~loc cstr args in
+      Type.parse_term env t
+
+    let parse _version env s =
+      match s with
+      (* Bool sort and constants *)
+      | Type.Id { Id.name = "Bool"; ns = Id.Sort } ->
+        `Ty (Base.app0 (module Type) env "Bool" Ty.prop)
+      | Type.Id { Id.name = "true"; ns = Id.Term } ->
+        `Term (Base.app0 (module Type) env "true" Type.T._true)
+      | Type.Id { Id.name = "false"; ns = Id.Term } ->
+        `Term (Base.app0 (module Type) env "false" Type.T._false)
+
+      (* Boolean operators *)
+      | Type.Id { Id.name = "not"; ns = Id.Term } ->
+        `Term (Base.term_app1 (module Type) env "not" Type.T.neg)
+      | Type.Id { Id.name = "and"; ns = Id.Term } ->
+        `Term (fun ast args -> parse_f env ast (Ast.and_t ()) args)
+      | Type.Id { Id.name = "or"; ns = Id.Term } ->
+        `Term (fun ast args -> parse_f env ast (Ast.or_t ()) args)
+      | Type.Id { Id.name = "xor"; ns = Id.Term } ->
+        `Term (Base.term_app_left (module Type) env "xor" Type.T.xor)
+      | Type.Id { Id.name = "=>"; ns = Id.Term } ->
+        `Term (Base.term_app_right (module Type) env "=>" Type.T.imply)
+
+      (* If-then-else *)
+      | Type.Id { Id.name = "ite"; ns = Id.Term } ->
+        `Term (fun ast args -> parse_f env ast (Ast.ite_t ()) args)
+
+      (* Equality *)
+      | Type.Id { Id.name = "distinct"; ns = Id.Term } ->
+        `Term (fun ast args -> parse_f env ast (Ast.neq_t ()) args)
+      | Type.Id { Id.name = "="; ns = Id.Term } ->
+        `Term (fun _ast args -> T.eqs (List.map (Type.parse_term env) args))
+
+      (* Named formulas *)
+      | Type.Id { Id.name = ":named"; ns = Id.Attr } ->
+        `Tags (Base.make_op1 (module Type) env ":named" (fun _ t ->
+            let name = parse_symbol env t in
+            [Type.Any (Tag.named, name)]
+          ))
+
+      (* Trigger annotations *)
+      | Type.Id { Id.name = ":pattern"; ns = Id.Attr } ->
+        `Tags (Base.make_op1 (module Type) env ":pattern" (fun _ t ->
+            let l = parse_sexpr_list env t in
+            let l = List.map (Type.parse_term env) l in
+            [Type.Any (Tag.triggers, l)]
+          ))
+
+      (* N-ary s-expressions in attributes *)
+      | Type.Id { Id.name = "$data"; ns = Id.Attr } ->
+        `Term (fun ast args ->
+            begin match args with
+              | f :: r -> parse_f env ast f r
+              | [] -> Type._error env (Ast ast)
+                        (Type.Expected ("a non-empty s-expr", None))
+            end)
+
+      (* Rewrite rules *)
+      | Type.Id id when Id.equal id Id.rwrt_rule ->
+        `Tags (fun _ast _args -> [Type.Any (Tag.rwrt, ())])
+
+      (* ADT testers *)
+      | Type.Id ({ Id.ns = Id.Term; _ } as id) ->
+        Base.parse_id id [
+          "is", `Unary (function s ->
+              let id = Id.mk Id.Term s in
+              begin match Type.find_bound env id with
+                | `Cstr c ->
+                  `Term (Base.term_app1 (module Type) env "is" (T.cstr_tester c))
+                | _ -> `Not_found
+              end);
+        ] ~err:(fun _ _ _ -> `Not_found)
+          ~k:(fun _ -> `Not_found)
+
+      | _ -> `Not_found
+
+  end
+
+end
+
+(* Zipperposition builtins *)
+(* ************************************************************************ *)
+
+module Zf = struct
+
+  module Tff
+      (Type : Tff_intf.S)
+      (Tag : Dolmen.Intf.Tag.Zf_Base with type 'a t = 'a Type.Tag.t) = struct
+
+    let parse env s =
+      match s with
+      | Type.Id id when Id.equal id Id.rwrt_rule ->
+        `Tags (fun _ast _args -> [Type.Any (Tag.rwrt, ())])
+      | Type.Id { Id.name = "infix"; ns = Id.Term } ->
+        `Tags (fun ast args -> match args with
+            | [ { Ast.term = Ast.Symbol { Id.name; _ }; _ } ] -> [
+                Type.Any (Tag.name, Tag.exact name);
+                Type.Any (Tag.pos, Tag.infix);
+              ]
+            | _ ->
+              Type._error env (Ast ast)
+                (Type.Expected ("a symbol", None))
+          )
+      | Type.Id { Id.name = "prefix"; ns = Id.Term } ->
+        `Tags (fun ast args -> match args with
+            | [ { Ast.term = Ast.Symbol { Id.name; _ }; _ } ] -> [
+                Type.Any (Tag.name, Tag.exact name);
+                Type.Any (Tag.pos, Tag.prefix);
+              ]
+            | _ ->
+              Type._error env (Ast ast)
+                (Type.Expected ("a symbol", None))
+          )
+
+      | _ -> `Not_found
+
+  end
+
+end
+
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/core.mli b/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/core.mli
new file mode 100644
index 0000000000000000000000000000000000000000..dac8d0e53d0ab949651a7ee121b58463cf32874d
--- /dev/null
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/core.mli
@@ -0,0 +1,59 @@
+
+(** {2 Languages Core builtins} *)
+
+(** AE builtins *)
+module Ae : sig
+
+  (** Builtin symbols for tptp's tff *)
+  module Tff
+      (Type : Tff_intf.S)
+      (Ty : Dolmen.Intf.Ty.Ae_Base with type t = Type.Ty.t)
+      (T : Dolmen.Intf.Term.Ae_Base with type t = Type.T.t) : sig
+
+    val parse : Type.builtin_symbols
+
+  end
+end
+
+(** TPTP builtins ($i, $o, etc..) *)
+module Tptp : sig
+
+  (** Builtin symbols for tptp's tff *)
+  module Tff
+      (Type : Tff_intf.S)
+      (Ty : Dolmen.Intf.Ty.Tptp_Base with type t = Type.Ty.t)
+      (T : Dolmen.Intf.Term.Tptp_Base with type t = Type.T.t) : sig
+
+    val parse : Dolmen.Tptp.version -> Type.builtin_symbols
+
+  end
+end
+
+
+(** Smtlib builtin *)
+module Smtlib2 : sig
+
+  (** Builtins for smtlib's core theory *)
+  module Tff
+      (Type : Tff_intf.S)
+      (Tag : Dolmen.Intf.Tag.Smtlib_Base with type 'a t = 'a Type.Tag.t
+                                          and type term := Type.T.t)
+      (Ty : Dolmen.Intf.Ty.Smtlib_Base with type t = Type.Ty.t)
+      (T : Dolmen.Intf.Term.Smtlib_Base with type t = Type.T.t
+                                         and type cstr := Type.T.Cstr.t) : sig
+
+    val parse : Dolmen.Smtlib2.version -> Type.builtin_symbols
+  end
+end
+
+(** Zf builtins *)
+module Zf : sig
+
+  (** Builtins for smtlib's core theory *)
+  module Tff
+      (Type : Tff_intf.S)
+      (Tag : Dolmen.Intf.Tag.Zf_Base with type 'a t = 'a Type.Tag.t) : sig
+
+    val parse : Type.builtin_symbols
+  end
+end
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/def.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/def.ml
index 6a56532bf54633bb7defbcd1ca6867042dbb877c..611d8a7e8f76e5e118d3159d6555c2c68f7cbd85 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/def.ml
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/def.ml
@@ -1,6 +1,4 @@
 
-open Dolmen
-
 (* Definitions by Substitution *)
 (* ************************************************************************ *)
 
@@ -26,7 +24,7 @@ module Subst
                     and type term := Type.T.t
                     and type term_var := Type.T.Var.t) = struct
 
-  module H = Hashtbl.Make(Id)
+  module H = Hashtbl.Make(Dolmen.Std.Id)
 
   let take_drop n l =
     let rec aux acc n = function
@@ -44,37 +42,40 @@ module Subst
   let define_term id vars args body =
     H.add definitions id (`Term (vars, args, body))
 
-  let parse env ast symbol args =
+  let parse env symbol =
     match (symbol : Type.symbol) with
     | Id id ->
       begin match H.find definitions id with
         | `Ty (vars, body) ->
-          Base.make_opn (List.length vars)
-            (module Type) env ast (Id.full_name id) args (fun args ->
-                let ty_args = List.map (Type.parse_ty env) args in
-                let l = List.map2 (fun x y -> x, y) vars ty_args in
-                Type.Ty (T.ty_subst l body)
-              )
+          `Ty (Base.make_opn (List.length vars)
+                 (module Type) env (Dolmen.Std.Id.full_name id) (fun _ args ->
+                     let ty_args = List.map (Type.parse_ty env) args in
+                     let l = List.map2 (fun x y -> x, y) vars ty_args in
+                     T.ty_subst l body
+                   ))
         | `Term (ty_vars, t_vars, body) ->
-          let n_args = List.length args in
-          let n_ty = List.length ty_vars in
-          let n_t = List.length t_vars in
-          let ty_l, t_l =
-            if n_args = n_ty + n_t then
-              take_drop n_ty args
-            else begin
-              let err = Type.Bad_op_arity (Id.full_name id, n_ty, n_ty) in
-              raise (Type.Typing_error (err, env, ast))
-            end
-          in
-          let ty_l = List.map2 (fun x y -> x, y) ty_vars
-              (List.map (Type.parse_ty env) ty_l) in
-          let t_l = List.map2 (fun x y -> x, y) t_vars
-              (List.map (Type.parse_term env) t_l) in
-          Some (Type.Term (T.term_subst ty_l t_l body))
-        | exception Not_found -> None
+          `Term (fun ast args ->
+              let n_args = List.length args in
+              let n_ty = List.length ty_vars in
+              let n_t = List.length t_vars in
+              let ty_l, t_l =
+                if n_args = n_ty + n_t then
+                  take_drop n_ty args
+                else begin
+                  Type._error env (Ast ast)
+                    (Type.Bad_op_arity (Dolmen.Std.Id.full_name id,
+                                        [n_ty + n_t], n_args))
+                end
+              in
+              let ty_l = List.map2 (fun x y -> x, y) ty_vars
+                  (List.map (Type.parse_ty env) ty_l) in
+              let t_l = List.map2 (fun x y -> x, y) t_vars
+                  (List.map (Type.parse_term env) t_l) in
+              T.term_subst ty_l t_l body
+            )
+        | exception Not_found -> `Not_found
       end
-    | Builtin _ -> None
+    | Builtin _ -> `Not_found
 
 end
 
@@ -84,31 +85,36 @@ end
 
 module Declare(Type : Tff_intf.S) = struct
 
-  module H = Hashtbl.Make(Id)
+  module H = Hashtbl.Make(Dolmen.Std.Id)
 
   let definitions = H.create 13
 
+  let add_definition id def =
+    H.add definitions id def
+
   let define_ty id vars _body =
-    let c = Type.Ty.Const.mk (Id.full_name id) (List.length vars) in
-    let () = H.add definitions id (`Ty c) in
+    let c = Type.Ty.Const.mk (Dolmen.Std.Id.full_name id) (List.length vars) in
+    let () = add_definition id (`Ty c) in
     c
 
   let define_term id vars args body =
     let ret_ty = Type.T.ty body in
     let args_ty = List.map Type.T.Var.ty args in
-    let c = Type.T.Const.mk (Id.full_name id) vars args_ty ret_ty in
-    let () = H.add definitions id (`Term c) in
+    let c = Type.T.Const.mk (Dolmen.Std.Id.full_name id) vars args_ty ret_ty in
+    let () = add_definition id (`Term c) in
     c
 
-  let parse env ast symbol args =
+  let parse env symbol =
     match (symbol : Type.symbol) with
     | Id id ->
       begin match H.find definitions id with
-        | `Ty c -> Some (Type.parse_app_ty env ast c args)
-        | `Term c -> Some (Type.parse_app_term env ast c args)
-        | exception Not_found -> None
+        | `Ty c -> `Ty (fun ast args ->
+            Type.unwrap_ty env ast (Type.parse_app_ty env ast c args))
+        | `Term c -> `Term (fun ast args ->
+            Type.unwrap_term env ast (Type.parse_app_term env ast c args))
+        | exception Not_found -> `Not_found
       end
-    | Builtin _ -> None
+    | Builtin _ -> `Not_found
 
 end
 
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/def.mli b/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/def.mli
index ee85889e3e647625a5de79469ec7824b8ba5aae3..973672b50d6c57bf4c952a14a60911e6ac3795ee 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/def.mli
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/def.mli
@@ -10,12 +10,16 @@
 (** Handle definitions as declaring new constants. *)
 module Declare(Type : Tff_intf.S) : sig
 
+  val add_definition :
+    Dolmen.Std.Id.t -> [ `Ty of Type.Ty.Const.t | `Term of Type.T.Const.t ] -> unit
+  (** Add a declaration binding. *)
+
   val define_ty :
-    Dolmen.Id.t -> Type.Ty.Var.t list -> Type.Ty.t -> Type.Ty.Const.t
+    Dolmen.Std.Id.t -> Type.Ty.Var.t list -> Type.Ty.t -> Type.Ty.Const.t
   (** Define a type constant. *)
 
   val define_term :
-    Dolmen.Id.t -> Type.Ty.Var.t list -> Type.T.Var.t list -> Type.T.t -> Type.T.Const.t
+    Dolmen.Std.Id.t -> Type.Ty.Var.t list -> Type.T.Var.t list -> Type.T.t -> Type.T.Const.t
   (** Define a term constant. *)
 
   val parse : Type.builtin_symbols
@@ -49,11 +53,11 @@ module Subst(Type : Tff_intf.S)
                     and type term_var := Type.T.Var.t) : sig
 
   val define_ty :
-    Dolmen.Id.t -> Type.Ty.Var.t list -> Type.Ty.t -> unit
+    Dolmen.Std.Id.t -> Type.Ty.Var.t list -> Type.Ty.t -> unit
   (** Define a type constant. *)
 
   val define_term :
-    Dolmen.Id.t -> Type.Ty.Var.t list -> Type.T.Var.t list -> Type.T.t -> unit
+    Dolmen.Std.Id.t -> Type.Ty.Var.t list -> Type.T.Var.t list -> Type.T.t -> unit
   (** Define a term constant. *)
 
   val parse : Type.builtin_symbols
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/dune b/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/dune
index 2903e42ff91f57d6913cfaa36214934de7674622..14d8d2769255e41e7ca4bbf575a5e01a4c492ed4 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/dune
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/dune
@@ -1,10 +1,20 @@
 (library
   (name           dolmen_type)
   (public_name    dolmen_type)
-  (libraries      dolmen spelll zarith)
+  (libraries
+    ; external deps
+    spelll uutf
+    ; dolmen standard deps
+    dolmen dolmen.std dolmen.intf
+    ; some additional explicit deps for version types
+    dolmen.smtlib2 dolmen.tptp
+  )
   (modules
     ; TFF typechecking
     Tff_intf Tff
     ; Builtins
-    Base Def Arith Arrays Bitv Float)
+    Core Def Arith Arrays Bitv Float Strings
+    ; Helpers
+    Base Logic Misc
+  )
 )
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/float.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/float.ml
index 72b0cd8433eb0d90339e2e7e41f08c9d6a001378..a1e0b253441c4507031581b604d7053b60f07365 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/float.ml
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/float.ml
@@ -1,5 +1,6 @@
 
-open Dolmen
+module Id = Dolmen.Std.Id
+module Ast = Dolmen.Std.Term
 
 (* Smtlib Floating Point *)
 (* ************************************************************************ *)
@@ -8,183 +9,222 @@ module Smtlib2 = struct
 
   module Tff
       (Type : Tff_intf.S)
-      (Ty : Dolmen.Intf.Ty.Smtlib_Float with type t = Type.Ty.t)
-      (T : Dolmen.Intf.Term.Smtlib_Float with type t = Type.T.t) = struct
-
-    let classify = T.classify
-    module T = T.Float
-
-    type Type.err +=
-      | Invalid_bin_char of char
-      | Invalid_hex_char of char
-      | Bitvector_litteral_expected
-      | Bitvector_of_size_one_expected of int
-      | To_fp_incorrect_args
-
-    let split_id = Dolmen_std.Misc.split_on_char '\000'
-
-    let parse_id env ast id l k =
-      let rec aux h r r_l = function
-        | [] -> k (h :: r)
-        | (s, n, f) :: l' ->
-          if String.equal s h then begin
-            if r_l = n then f r
-            else begin
-              let err = Type.Bad_op_arity (s, n, r_l) in
-              raise (Type.Typing_error (err, env, ast))
-            end
-          end else
-            aux h r r_l l'
-      in
-      match split_id id with
-      | h :: r -> aux h r (List.length r) l
-      | r -> k r
-
-    let parse_int_pos env ast s =
-      try
-        let i = int_of_string s in
-        if 0 < i then i else raise Exit
-      with Failure _ | Exit ->
-        let err = Type.Expected ("an integer greater than 0", None) in
-        raise (Type.Typing_error (err, env, ast))
-
-    let app0 env ast args name mk =
-      Base.make_op0 (module Type) env ast name args
-        (fun () -> Type.Term (mk))
-
-    let app1 env ast args name mk =
-      Base.make_op1 (module Type) env ast name args
-        (fun t -> Type.Term (mk (Type.parse_term env t)))
-
-    let app2 env ast args name mk =
-      Base.make_op2 (module Type) env ast name args
-        (fun (a, b) ->
-           Type.Term (mk (Type.parse_term env a) (Type.parse_term env b)))
-
-    let app3 env ast args name mk =
-      Base.make_op3 (module Type) env ast name args
-        (fun (a, b, c) ->
-           Type.Term (mk (Type.parse_term env a) (Type.parse_term env b) (Type.parse_term env c)))
-
-    let app4 env ast args name mk =
-      Base.make_op4 (module Type) env ast name args
-        (fun (a, b, c, d) ->
-           Type.Term (mk (Type.parse_term env a) (Type.parse_term env b) (Type.parse_term env c) (Type.parse_term env d)))
-
-    let app_chain env ast args name mk =
-      Base.make_chain (module Type) env ast name args (fun l ->
-          let l' = List.map (Type.parse_term env) l in
-          Type.Term (Base.map_chain (module Type) mk l')
-        )
-
-    let fp_type env ast args e s =
-      Base.make_op0 (module Type) env ast "FloatingPoint" args
-        (fun () -> Type.Ty (Ty.float e s))
-
-    let app0_param2 env ast args name mk = function
-      | [n_e;n_s] ->
-        app0 env ast args name (mk (parse_int_pos env ast n_e) (parse_int_pos env ast n_s))
-      | _ -> assert false
-
-    let app2_param2 env ast args name mk = function
-      | [n_e;n_s] ->
-        app2 env ast args name (mk (parse_int_pos env ast n_e) (parse_int_pos env ast n_s))
-      | _ -> assert false
-
-    let app2_param1 env ast args name mk = function
-      | [n_m] ->
-        app2 env ast args name (mk (parse_int_pos env ast n_m))
-      | _ -> assert false
-
-    let to_fp env ast args lse =
-      let e,s = match lse with
-        | [e;s] -> (parse_int_pos env ast e, parse_int_pos env ast s)
-        | _ -> assert false (* Because to_fp is specified below with 2 parameters *)
-      in
-      let args = List.map (Type.parse_term env) args in
-      let return t = Some (Type.Term t) in
-      match args with
-      | [ a ] -> return (T.ieee_format_to_fp e s a)
-      | [ rm; b ] -> begin
-          match classify b with
-          | `Real -> return (T.real_to_fp e s rm b)
-          | `Bitv _ -> return (T.sbv_to_fp e s rm b)
-          | `Float (_,_) -> return (T.fp_to_fp e s rm b)
-          | _ ->
-            let err = To_fp_incorrect_args in
-            raise (Type.Typing_error (err, env, ast))
-        end
+      (Ty : Dolmen.Intf.Ty.Smtlib_Float with type t := Type.Ty.t)
+      (T : Dolmen.Intf.Term.Smtlib_Float with type t := Type.T.t
+                                          and type ty := Type.Ty.t) = struct
+
+    module B = T.Bitv
+    module R = T.Real
+    module F = T.Float
+
+    type _ Type.warn +=
+      | Real_lit : Ast.t Type.warn
+      | Bitv_extended_lit : Ast.t Type.warn
+
+    type _ Type.err +=
+      | Invalid_bin_char : char -> Ast.t Type.err
+      | Invalid_hex_char : char -> Ast.t Type.err
+      | Invalid_dec_char : char -> Ast.t Type.err
+
+    let parse_int env ast s =
+      match int_of_string s with
+      | i when i >= 0 -> i
       | _ ->
-        let err = To_fp_incorrect_args in
-        raise (Type.Typing_error (err, env, ast))
+        Type._error env (Ast ast)
+          (Type.Expected ("a positive integer", None))
+      | exception Failure _ ->
+        Type._error env (Ast ast)
+          (Type.Expected ("a positive integer", None))
+
+    let parse_binary env s ast =
+      match Misc.Bitv.parse_binary s with
+      | s -> B.mk s
+      | exception Misc.Bitv.Invalid_char c ->
+        Type._error env (Ast ast) (Invalid_bin_char c)
+
+    let parse_hexa env s ast =
+      match Misc.Bitv.parse_hexa s with
+      | s -> B.mk s
+      | exception Misc.Bitv.Invalid_char c ->
+        Type._error env (Ast ast) (Invalid_hex_char c)
+
+    let parse_extended_lit env s n =
+      Base.make_op0 (module Type) env s (fun ast () ->
+          assert (String.length s >= 2);
+          let n = parse_int env ast n in
+          match Misc.Bitv.parse_decimal s n with
+          | s -> B.mk s
+          | exception Misc.Bitv.Invalid_char c ->
+            Type._error env (Ast ast) (Invalid_dec_char c)
+        )
 
-    let parse _version env ast s args =
+    let indexed1 env mk i_s ast =
+      let i = parse_int env ast i_s in
+      mk i
+
+    let indexed2 env mk i_s j_s ast =
+      let i = parse_int env ast i_s in
+      let j = parse_int env ast j_s in
+      mk i j
+
+    let to_fp env e s = `Term (fun ast args ->
+        let e = parse_int env ast e in
+        let s = parse_int env ast s in
+        let args = List.map (Type.parse_term env) args in
+        match args with
+        | [ a ] -> F.ieee_format_to_fp e s a
+        | [ rm; b ] -> begin
+            match Ty.view @@ T.ty b with
+            | `Real -> F.real_to_fp e s rm b
+            | `Bitv _ -> F.sbv_to_fp e s rm b
+            | `Float (_,_) -> F.to_fp e s rm b
+            | _ -> Type._error env (Ast ast) (
+                Type.Expected ("a real, bitvector or float", Some (Term b)))
+          end
+        | _ -> Type._error env (Ast ast)
+                 (Type.Bad_op_arity ("to_fp", [1; 2], List.length args))
+      )
+
+    let parse _version env s =
       match s with
+
       (* sort *)
-      | Type.Id { Id.ns = Id.Sort; name; } ->
-        parse_id env ast name [
-          "FloatingPoint", 2, (function
-              | [n_e;n_s] ->
-                fp_type env ast args (parse_int_pos env ast n_e) (parse_int_pos env ast n_s)
-              | _ -> assert false);
-        ] (function
-            | ["Float16"] -> fp_type env ast args 5 11
-            | ["Float32"] -> fp_type env ast args 8 24
-            | ["Float64"] -> fp_type env ast args 11 53
-            | ["Float128"] -> fp_type env ast args 15 113
+      | Type.Id ({ Id.ns = Id.Sort; _ } as id) ->
+        Base.parse_id id [
+          "BitVec", `Unary (function n_s ->
+              `Ty (Base.app0_ast (module Type) env "BitVec"
+                     (indexed1 env Ty.bitv n_s)));
+          "FloatingPoint", `Binary (fun n_e n_s ->
+              `Ty (Base.app0_ast (module Type) env "FloatingPoint"
+                     (indexed2 env Ty.float n_e n_s)));
+        ] ~err:(Base.bad_ty_index_arity (module Type) env)
+          ~k:(function
+            | ["Float16"] ->
+              `Ty (Base.app0 (module Type) env "Float16" (Ty.float 5 11))
+            | ["Float32"] ->
+              `Ty (Base.app0 (module Type) env "Float32" (Ty.float 8 24))
+            | ["Float64"] ->
+              `Ty (Base.app0 (module Type) env "Float64" (Ty.float 11 53))
+            | ["Float128"] ->
+              `Ty (Base.app0 (module Type) env "Float128" (Ty.float 15 113))
             | ["RoundingMode"] ->
-              Base.make_op0 (module Type) env ast "RoundingMode" args
-                (fun () -> Type.Ty Ty.roundingMode)
-            | _ -> None)
+              `Ty (Base.app0 (module Type) env "RoundingMode" Ty.roundingMode)
+            | _ ->
+              `Not_found)
+
+      (* Bitvector litterals *)
+      | Type.Id { Id.ns = Id.Value Id.Binary; name; } ->
+        `Term (Base.app0_ast (module Type) env name (parse_binary env name))
+      | Type.Id { Id.ns = Id.Value Id.Hexadecimal; name; } ->
+        `Term (Base.app0_ast (module Type) env name (parse_hexa env name))
+      (* Added with a warning for compatibility *)
+      | Type.Id { Id.ns = Id.Value Id.Real; name; } ->
+        `Term (fun ast args ->
+            Type._warn env (Ast ast) Real_lit;
+            Base.app0 (module Type) env name (R.mk name) ast args)
+
       (* terms *)
-      | Type.Id { Id.ns = Id.Term; name; } ->
-        parse_id env ast name [
-          "+oo", 2, app0_param2 env ast args "plus_infinity" T.plus_infinity;
-          "-oo", 2, app0_param2 env ast args "minus_infinity" T.minus_infinity;
-          "+zero", 2, app0_param2 env ast args "plus_zero" T.plus_zero;
-          "-zero", 2, app0_param2 env ast args "minus_zero" T.minus_zero;
-          "NaN", 2, app0_param2 env ast args "nan" T.nan;
-          "to_fp", 2, to_fp env ast args;
-          "to_fp_unsigned", 2, app2_param2 env ast args "ubv_to_fp" T.ubv_to_fp;
-          "fp.to_ubv", 1, app2_param1 env ast args "to_ubv" T.to_ubv;
-          "fp.to_sbv", 1, app2_param1 env ast args "to_sbv" T.to_sbv;
-        ] (function
-            | ["fp"] ->
-              app3 env ast args "fp" T.fp
-            | ["roundNearestTiesToEven"] | ["RNE"] -> app0 env ast args "roundNearestTiesToEven" T.roundNearestTiesToEven
-            | ["roundNearestTiesToAway"] | ["RNA"] -> app0 env ast args "roundNearestTiesToAway" T.roundNearestTiesToAway
-            | ["roundTowardPositive"] | ["RTP"] -> app0 env ast args "roundTowardPositive" T.roundTowardPositive
-            | ["roundTowardNegative"] | ["RTN"] -> app0 env ast args "roundTowardNegative" T.roundTowardNegative
-            | ["roundTowardZero"] | ["RTZ"] -> app0 env ast args "roundTowardZero" T.roundTowardZero
-            | ["fp.abs"] -> app1 env ast args "fp.abs" T.fp_abs
-            | ["fp.neg"] -> app1 env ast args "fp.neg" T.fp_neg
-            | ["fp.add"] -> app3 env ast args "fp.add" T.fp_add
-            | ["fp.sub"] -> app3 env ast args "fp.sub" T.fp_sub
-            | ["fp.mul"] -> app3 env ast args "fp.mul" T.fp_mul
-            | ["fp.div"] -> app3 env ast args "fp.div" T.fp_div
-            | ["fp.fma"] -> app4 env ast args "fp.fma" T.fp_fma
-            | ["fp.sqrt"] -> app2 env ast args "fp.sqrt" T.fp_sqrt
-            | ["fp.rem"] -> app2 env ast args "fp.rem" T.fp_rem
-            | ["fp.roundToIntegral"] -> app2 env ast args "fp.roundToIntegral" T.fp_roundToIntegral
-            | ["fp.min"] -> app2 env ast args "fp.min" T.fp_min
-            | ["fp.max"] -> app2 env ast args "fp.max" T.fp_max
-            | ["fp.leq"] -> app_chain env ast args "fp.leq" T.fp_leq
-            | ["fp.lt"] -> app_chain env ast args "fp.lt" T.fp_lt
-            | ["fp.geq"] -> app_chain env ast args "fp.geq" T.fp_geq
-            | ["fp.gt"] -> app_chain env ast args "fp.gt" T.fp_gt
-            | ["fp.eq"] -> app_chain env ast args "fp.eq" T.fp_eq
-            | ["fp.isNormal"] -> app1 env ast args "fp.isNormal" T.fp_isNormal
-            | ["fp.isSubnormal"] -> app1 env ast args "fp.isSubnormal" T.fp_isSubnormal
-            | ["fp.isZero"] -> app1 env ast args "fp.isZero" T.fp_isZero
-            | ["fp.isInfinite"] -> app1 env ast args "fp.isInfinite" T.fp_isInfinite
-            | ["fp.isNaN"] -> app1 env ast args "fp.isNaN" T.fp_isNaN
-            | ["fp.isNegative"] -> app1 env ast args "fp.isNegative" T.fp_isNegative
-            | ["fp.isPositive"] -> app1 env ast args "fp.isPositive" T.fp_isPositive
-            | ["fp.to_real"] -> app1 env ast args "fp.to_real" T.to_real;
-            | _ -> None
-          )
-      | _ -> None
-
-      end
+      | Type.Id ({ Id.ns = Id.Term; name; } as id) ->
+        begin match name with
+          | "fp" ->
+            `Term (Base.term_app3 (module Type) env name F.fp)
+          | "RNE" | "roundNearestTiesToEven" ->
+            `Term (Base.app0 (module Type) env name F.roundNearestTiesToEven)
+          | "RNA" | "roundNearestTiesToAway" ->
+            `Term (Base.app0 (module Type) env name F.roundNearestTiesToAway)
+          | "RTP" | "roundTowardPositive" ->
+            `Term (Base.app0 (module Type) env name F.roundTowardPositive)
+          | "RTN" | "roundTowardNegative" ->
+            `Term (Base.app0 (module Type) env name F.roundTowardNegative)
+          | "RTZ" | "roundTowardZero" ->
+            `Term (Base.app0 (module Type) env name F.roundTowardZero)
+          | "fp.abs" ->
+            `Term (Base.term_app1 (module Type) env name F.abs)
+          | "fp.neg" ->
+            `Term (Base.term_app1 (module Type) env name F.neg)
+          | "fp.add" ->
+            `Term (Base.term_app3 (module Type) env name F.add)
+          | "fp.sub" ->
+            `Term (Base.term_app3 (module Type) env name F.sub)
+          | "fp.mul" ->
+            `Term (Base.term_app3 (module Type) env name F.mul)
+          | "fp.div" ->
+            `Term (Base.term_app3 (module Type) env name F.div)
+          | "fp.fma" ->
+            `Term (Base.term_app4 (module Type) env name F.fma)
+          | "fp.sqrt" ->
+            `Term (Base.term_app2 (module Type) env name F.sqrt)
+          | "fp.rem" ->
+            `Term (Base.term_app2 (module Type) env name F.rem)
+          | "fp.roundToIntegral" ->
+            `Term (Base.term_app2 (module Type) env name F.roundToIntegral)
+          | "fp.min" ->
+            `Term (Base.term_app2 (module Type) env name F.min)
+          | "fp.max" ->
+            `Term (Base.term_app2 (module Type) env name F.max)
+          | "fp.leq" ->
+            `Term (Base.term_app_chain (module Type) env name F.leq)
+          | "fp.lt" ->
+            `Term (Base.term_app_chain (module Type) env name F.lt)
+          | "fp.geq" ->
+            `Term (Base.term_app_chain (module Type) env name F.geq)
+          | "fp.gt" ->
+            `Term (Base.term_app_chain (module Type) env name F.gt)
+          | "fp.eq" ->
+            `Term (Base.term_app_chain (module Type) env name F.eq)
+          | "fp.isNormal" ->
+            `Term (Base.term_app1 (module Type) env name F.isNormal)
+          | "fp.isSubnormal" ->
+            `Term (Base.term_app1 (module Type) env name F.isSubnormal)
+          | "fp.isZero" ->
+            `Term (Base.term_app1 (module Type) env name F.isZero)
+          | "fp.isInfinite" ->
+            `Term (Base.term_app1 (module Type) env name F.isInfinite)
+          | "fp.isNaN" ->
+            `Term (Base.term_app1 (module Type) env name F.isNaN)
+          | "fp.isNegative" ->
+            `Term (Base.term_app1 (module Type) env name F.isNegative)
+          | "fp.isPositive" ->
+            `Term (Base.term_app1 (module Type) env name F.isPositive)
+          | "fp.to_real" ->
+            `Term (Base.term_app1 (module Type) env name F.to_real)
+          | _ -> Base.parse_id id [
+              "+oo", `Binary (fun e s ->
+                  `Term (Base.app0_ast (module Type) env "plus_infinity"
+                           (indexed2 env F.plus_infinity e s)));
+              "-oo", `Binary (fun e s ->
+                  `Term (Base.app0_ast (module Type) env "minus_infinity"
+                           (indexed2 env F.minus_infinity e s)));
+              "+zero", `Binary (fun e s ->
+                  `Term (Base.app0_ast (module Type) env "plus_zero"
+                           (indexed2 env F.plus_zero e s)));
+              "-zero", `Binary (fun e s ->
+                  `Term (Base.app0_ast (module Type) env "minus_zero"
+                           (indexed2 env F.minus_zero e s)));
+              "NaN", `Binary (fun e s ->
+                  `Term (Base.app0_ast (module Type) env "nan"
+                           (indexed2 env F.nan e s)));
+              "to_fp", `Binary (to_fp env);
+              "to_fp_unsigned", `Binary (fun e s ->
+                  `Term (Base.term_app2_ast (module Type) env "ubv_to_fp"
+                           (indexed2 env F.ubv_to_fp e s)));
+              "fp.to_ubv", `Unary (fun n ->
+                  `Term (Base.term_app2_ast (module Type) env "to_ubv"
+                           (indexed1 env F.to_ubv n)));
+              "fp.to_sbv", `Unary (fun n ->
+                  `Term (Base.term_app2_ast (module Type) env "to_sbv"
+                           (indexed1 env F.to_sbv n)));
+            ] ~err:(Base.bad_term_index_arity (module Type) env)
+              ~k:(function
+                  | [s; n] when (String.length s >= 2 &&
+                                 s.[0] = 'b' && s.[1] = 'v') ->
+                    `Term (fun ast args ->
+                        Type._warn env (Ast ast) Bitv_extended_lit;
+                        parse_extended_lit env s n ast args)
+                  | _ -> `Not_found)
+        end
+      | _ -> `Not_found
+
+  end
 
 end
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/float.mli b/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/float.mli
index 86c5776cd4bbb3ae6a8bbc2f59427262e6619662..5316efd5edcbc58ab9466cfbc1aa8479ad50650a 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/float.mli
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/float.mli
@@ -4,17 +4,20 @@ module Smtlib2 : sig
 
   module Tff
       (Type : Tff_intf.S)
-      (Ty : Dolmen.Intf.Ty.Smtlib_Float with type t = Type.Ty.t)
-      (T : Dolmen.Intf.Term.Smtlib_Float with type t = Type.T.t) : sig
+      (Ty : Dolmen.Intf.Ty.Smtlib_Float with type t := Type.Ty.t)
+      (T : Dolmen.Intf.Term.Smtlib_Float with type t := Type.T.t
+                                          and type ty := Type.Ty.t) : sig
 
-    type Type.err +=
-      | Invalid_bin_char of char
-      | Invalid_hex_char of char
-      | Bitvector_litteral_expected
-      | Bitvector_of_size_one_expected of int
-      | To_fp_incorrect_args
+    type _ Type.warn +=
+      | Real_lit : Dolmen.Std.Term.t Type.warn
+      | Bitv_extended_lit : Dolmen.Std.Term.t Type.warn
 
-    val parse : Dolmen_smtlib2.version -> Type.builtin_symbols
+    type _ Type.err +=
+      | Invalid_bin_char : char -> Dolmen.Std.Term.t Type.err
+      | Invalid_hex_char : char -> Dolmen.Std.Term.t Type.err
+      | Invalid_dec_char : char -> Dolmen.Std.Term.t Type.err
+
+    val parse : Dolmen.Smtlib2.version -> Type.builtin_symbols
   end
 
 end
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/logic.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/logic.ml
new file mode 100644
index 0000000000000000000000000000000000000000..5c5018f190a87aa4560bb0ac1e2773f8c96131ee
--- /dev/null
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/logic.ml
@@ -0,0 +1,186 @@
+
+(* Smtlib2 logics *)
+(* ************************************************************************ *)
+
+module Smtlib2 = struct
+
+  type theory = [
+    | `Core
+    | `Arrays
+    | `Bitvectors
+    | `Floats
+    | `String
+    | `Ints
+    | `Reals
+    | `Reals_Ints
+  ]
+
+  type features = {
+    free_sorts      : bool;
+    free_functions  : bool;
+    datatypes       : bool;
+    quantifiers     : bool;
+    arithmetic      : Arith.Smtlib2.arith;
+    arrays          : Arrays.Smtlib2.arrays;
+  }
+
+  type t = {
+    theories      : theory list;
+    features      : features;
+  }
+
+  let all = {
+    theories = [ `Core; `Arrays; `Bitvectors; `Floats; `Reals_Ints ];
+    features = {
+      free_sorts = true;
+      free_functions = true;
+      datatypes = true;
+      quantifiers = true;
+      arrays = All;
+      arithmetic = Regular;
+    };
+  }
+
+  (*
+  QF to disable the quantifier feature
+  A or AX for the theory ArraysEx
+  BV for the theory FixedSizeBitVectors
+  FP (forthcoming) for the theory FloatingPoint
+  IA for the theory Ints (Integer Arithmetic)
+  RA for the theory Reals (Real Arithmetic)
+  IRA for the theory Reals_Ints (mixed Integer Real Arithmetic)
+  IDL for Integer Difference Logic (Ints theory + difference logic arithmetic)
+  RDL for Reals Difference Logic (Reals theory + difference logic arithmetic)
+  L before IA, RA, or IRA for the linear fragment of those arithmetics
+  N before IA, RA, or IRA for the non-linear fragment of those arithmetics
+  UF for the extension allowing free sort and function symbols
+  *)
+  let parse s =
+    let default = {
+      theories = [ `Core ];
+      features = {
+        free_sorts = false;
+        free_functions = false;
+        datatypes = false;
+        quantifiers = true;
+        arrays = All;
+        arithmetic = Regular;
+      };
+    } in
+    let add_theory t c = { c with theories = t :: c.theories } in
+    let set_features c f = { c with features = f c.features } in
+    let set_uf c = set_features c (fun f ->
+        { f with free_sorts = true; free_functions = true; }) in
+    let set_qf c = set_features c (fun f -> { f with quantifiers = false}) in
+    let set_dt c = set_features c (fun f -> { f with datatypes = true}) in
+    let set_idl c = set_features c (fun f -> { f with arithmetic = Difference `IDL}) in
+    let set_rdl c = set_features c (fun f -> { f with arithmetic = Difference `RDL}) in
+    let set_la c = set_features c (fun f -> { f with arithmetic = Linear `Strict}) in
+    (* Entry-point for a best effort at parsing a logic name into a
+       structured representation of what theories the logic includes and
+       what restrictions it imposes. *)
+    let rec parse_logic c l = parse_all c l
+    (* The 'ALL' logic is described in the SMTlib language standard as
+       a logic including all that is supported by the solver. *)
+    and parse_all c = function
+      | 'A'::'L'::'L'::l -> parse_end all l
+      | l -> parse_qf c l
+    (* The QF theory can only appear as a prefix "QF_" *)
+    and parse_qf c = function
+      | [] -> Some c
+      | 'Q'::'F'::'_'::l -> parse_array (set_qf c) l
+      | l -> parse_array c l
+    (* The Array theory is specified first after an optional QF_, and
+       can be one of two forms:
+       - either 'A' followed by some other theories
+       - either 'AX' followed by no theory *)
+    and parse_array c = function
+      | 'A'::'X'::l -> parse_end (add_theory `Arrays c) l
+      | 'A'::[] -> None (* "QF_A" and "A" are not valid logics *)
+      | 'A'::l  -> parse_uf (add_theory `Arrays c) l
+      | l -> parse_uf c l
+    (* The UF theory can be specified after the array theory *)
+    and parse_uf c = function
+      | 'U'::'F'::l -> parse_bv (set_uf c) l
+      | l -> parse_bv c l
+    (* After the QF, Array and UF theories have been specified,
+       BV can be specified *)
+    and parse_bv c = function
+      | 'B'::'V'::l -> parse_dt (add_theory `Bitvectors c) l
+      | l -> parse_dt c l
+    (* DT *)
+    and parse_dt c = function
+      | 'D'::'T'::l -> parse_fp (set_dt c) l
+      | l -> parse_fp c l
+    (* FP theory *)
+    and parse_fp c = function
+      | 'F'::'P'::l -> parse_str (add_theory `Floats c) l
+      | l -> parse_str c l
+    (* String theory *)
+    and parse_str c = function
+      | 'S' :: l -> parse_arith (add_theory `String c) l
+      | l -> parse_arith c l
+    (* Some logics include both BV and arithmetic (e.g. AUFBVDTLIA) *)
+    and parse_arith c = function
+      | 'I'::'D'::'L'::l -> parse_end (add_theory `Ints (set_idl c)) l
+      | 'R'::'D'::'L'::l -> parse_end (add_theory `Reals (set_rdl c)) l
+      | 'L'::'I'::'A'::l -> parse_end (add_theory `Ints (set_la c)) l
+      | 'L'::'R'::'A'::l -> parse_end (add_theory `Reals (set_la c)) l
+      | 'L'::'I'::'R'::'A'::l -> parse_end (add_theory `Reals_Ints (set_la c)) l
+      | 'N'::'I'::'A'::l -> parse_end (add_theory `Ints c) l
+      | 'N'::'R'::'A'::l -> parse_end (add_theory `Reals c) l
+      | 'N'::'I'::'R'::'A'::l -> parse_end (add_theory `Reals_Ints c) l
+      | l -> parse_end c l
+    (* End of list *)
+    and parse_end c = function
+      | [] -> Some c
+      | _ -> None
+    in
+    (* Parse the logic name *)
+    let res = parse_logic default (Misc.Strings.to_list s) in
+    (* Return *)
+    match res with
+    | None -> res
+    | Some res ->
+      (* Some special cases *)
+      let res =
+        match s with
+        (* QF_AX allows free sort and **constant** symbols (not functions) *)
+        | "QF_AX"
+          -> set_features res (fun f -> { f with
+                                          free_sorts = true; })
+        (* QF_ABV has some array restrictions *)
+        | "QF_ABV" | "QF_AUFBV"
+          -> set_features res (fun f -> { f with
+                                          arrays = Only_bitvec; })
+        (* {QF_}AUFLIRA has specific array restrictions *)
+        | "QF_AUFLIRA" | "AUFLIRA"
+          -> set_features res (fun f -> { f with
+                                          arrays = Only_ints_real; })
+        (* {QF_}AUFLIA has some different arithmetic and array restrictions *)
+        | "QF_AUFLIA" | "AUFLIA"
+          -> set_features res (fun f -> { f with
+                                          arrays = Only_int_int;
+                                          arithmetic = Linear `Large; })
+        (* QF_ALI has the large arithmetic semantics *)
+        | "QF_ALIA" | "ALIA"
+          -> set_features res (fun f -> { f with
+                                          arithmetic = Linear `Large})
+        (* QF_UFIDL has a different spec for integer difference logic... *)
+        | "QF_UFIDL" | "UFIDL"
+          -> set_features res (fun f -> { f with
+                                          arithmetic = Difference `UFIDL})
+        (* Default case (for non-special cases) *)
+        | _ -> res
+      in
+      Some res
+
+end
+
+(* All logics *)
+(* ************************************************************************ *)
+
+type t =
+  | Auto (* Default case for languages which do not have logic *)
+  | Smtlib2 of Smtlib2.t
+
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/logic.mli b/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/logic.mli
new file mode 100644
index 0000000000000000000000000000000000000000..02e48ee6a48e5f9b32d790a808c70403ce00c6fb
--- /dev/null
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/logic.mli
@@ -0,0 +1,57 @@
+
+(** {2 Logics}
+
+    Some languages define a notion of logics to distinguish different
+    fragments at type-checking and during solving. This file is here to
+    help with handling such logics.
+*)
+
+(** {2 Smtlib logics} *)
+module Smtlib2 : sig
+
+  type theory = [
+    | `Core
+    | `Arrays
+    | `Bitvectors
+    | `Floats
+    | `String
+    | `Ints
+    | `Reals
+    | `Reals_Ints
+  ]
+  (** Smtlib theories. *)
+
+  type features = {
+    free_sorts      : bool;
+    free_functions  : bool;
+    datatypes       : bool;
+    quantifiers     : bool;
+    arithmetic      : Arith.Smtlib2.arith;
+    arrays          : Arrays.Smtlib2.arrays;
+  }
+  (** Smtlib features. *)
+
+  type t = {
+    theories      : theory list;
+    features      : features;
+  }
+  (** Structured representation of an smtlib logic. *)
+
+  val parse : string -> t option
+  (** Parses an smtlib logic string and returns its structured version. *)
+
+  val all: t
+  (** All the smtlib2 logic parsable *)
+end
+
+(** {2 All logics} *)
+
+type t =
+  | Auto
+  (** Default case when no logic is specified or for languages which do not
+      have a notion of different logics (i.e. the language only has one
+      logic). *)
+  | Smtlib2 of Smtlib2.t
+  (** Smtlib2 logic. *)
+(** Wrapper type to represent the different logics. *)
+
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/misc.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/misc.ml
new file mode 100644
index 0000000000000000000000000000000000000000..9967ea23d2e281df85659ef372b721fb44fa73b7
--- /dev/null
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/misc.ml
@@ -0,0 +1,289 @@
+
+(* Option helpers *)
+(* ************************************************************************ *)
+
+module Options = struct
+
+  let map f = function
+    | None -> None
+    | Some x -> Some (f x)
+
+end
+
+(* List helpers *)
+(* ************************************************************************ *)
+
+module Lists = struct
+
+  let init n f =
+    let rec aux acc i =
+      if i > n then List.rev acc
+      else aux (f i :: acc) (i + 1)
+    in
+    aux [] 1
+
+  let replicate n x =
+    let rec aux x acc n =
+      if n <= 0 then acc else aux x (x :: acc) (n - 1)
+    in
+    aux x [] n
+
+  let take_drop n l =
+    let rec aux acc n = function
+      | r when n <= 0 -> List.rev acc, r
+      | [] -> raise (Invalid_argument "take_drop")
+      | x :: r -> aux (x :: acc) (n - 1) r
+    in
+    aux [] n l
+
+end
+
+(* String manipulation *)
+(* ************************************************************************ *)
+
+module Strings = struct
+
+  let to_list s =
+    let rec aux s i acc =
+      if i < 0 then acc
+      else aux s (i - 1) (s.[i] :: acc)
+    in
+    aux s (String.length s - 1) []
+
+  let is_suffix ~suffix s =
+    let k = String.length suffix in
+    let n = String.length s in
+    if n < k then false
+    else begin
+      let s' = String.sub s (n - k) k in
+      String.equal suffix s'
+    end
+
+end
+
+(* Bitvector manipulation *)
+(* ************************************************************************ *)
+
+module Bitv = struct
+
+  exception Invalid_char of char
+
+
+
+  (* Bitv in binary forms *)
+
+  let check_bin = function
+    | '0' | '1' -> ()
+    | c -> raise (Invalid_char c)
+
+  let parse_binary s =
+    assert (String.length s > 2 && s.[0] = '#' && s.[1] = 'b');
+    let s = String.sub s 2 (String.length s - 2) in
+    String.iter check_bin s;
+    s
+
+
+  (* Bitv in hexadecimal form *)
+
+  let hex_to_bin = function
+    | '0' -> "0000"
+    | '1' -> "0001"
+    | '2' -> "0010"
+    | '3' -> "0011"
+    | '4' -> "0100"
+    | '5' -> "0101"
+    | '6' -> "0110"
+    | '7' -> "0111"
+    | '8' -> "1000"
+    | '9' -> "1001"
+    | 'a' | 'A' -> "1010"
+    | 'b' | 'B' -> "1011"
+    | 'c' | 'C' -> "1100"
+    | 'd' | 'D' -> "1101"
+    | 'e' | 'E' -> "1110"
+    | 'f' | 'F' -> "1111"
+    | c -> raise (Invalid_char c)
+
+  let parse_hexa s =
+    assert (String.length s > 2 && s.[0] = '#' && s.[1] = 'x');
+    let s = String.sub s 2 (String.length s - 2) in
+    let b = Bytes.create (String.length s * 4) in
+    String.iteri (fun i c ->
+        Bytes.blit_string (hex_to_bin c) 0 b (i * 4) 4
+      ) s;
+    Bytes.to_string b
+
+
+
+
+  (* bitv in decimal form *)
+
+  let int_of_char = function
+    | '0' -> 0
+    | '1' -> 1
+    | '2' -> 2
+    | '3' -> 3
+    | '4' -> 4
+    | '5' -> 5
+    | '6' -> 6
+    | '7' -> 7
+    | '8' -> 8
+    | '9' -> 9
+    |  c  -> raise (Invalid_char c)
+
+  let char_of_int = function
+    | 0 -> '0'
+    | 1 -> '1'
+    | 2 -> '2'
+    | 3 -> '3'
+    | 4 -> '4'
+    | 5 -> '5'
+    | 6 -> '6'
+    | 7 -> '7'
+    | 8 -> '8'
+    | 9 -> '9'
+    | _ -> assert false
+
+  (* Implementation of division by 2 on strings, and
+     of parsing a string-encoded decimal into a binary bitv,
+     taken from
+     https://stackoverflow.com/questions/11006844/convert-a-very-large-number-from-decimal-string-to-binary-representation/11007021#11007021 *)
+
+  let divide_string_by_2 b start =
+    let b' = Bytes.create (Bytes.length b - start) in
+    let next_additive = ref 0 in
+    for i = start to Bytes.length b - 1 do
+      let c = int_of_char (Bytes.get b i) in
+      let additive = !next_additive in
+      next_additive := if c mod 2 = 1 then 5 else 0;
+      let c' = c / 2 + additive in
+      Bytes.set b' (i - start) (char_of_int c')
+    done;
+    b'
+
+  let rec first_non_zero b start =
+    if start >= Bytes.length b then
+      None
+    else if Bytes.get b start = '0' then
+      first_non_zero b (start + 1)
+    else
+      Some start
+
+  (* Starting from a bytes full of '0', fill it with bits
+     coming from the given integer. *)
+  let rec parse_int_aux b i n =
+    if i < 0 || n <= 0 then b
+    else begin
+      if n mod 2 = 1 then Bytes.set b i '1';
+      parse_int_aux b (i - 1) (n / 2)
+    end
+
+  (* Size (in characters) of a decimal integer under which
+     int_of_string will work *)
+  let int_size_threshold =
+    match Sys.int_size with
+    (* max_int should be 2147483647 (length 10) *)
+    | 31 -> 9
+    (* max_int should be 9,223,372,036,854,775,807 (length 19) *)
+    | 63 -> 18
+    (* weird case, be safe before anyting *)
+    | _ -> 0
+
+  let rec parse_decimal_aux res idx b start =
+    if idx < 0 then
+      res
+    else if (Bytes.length b - start) <= int_size_threshold then begin
+      match int_of_string (Bytes.to_string b) with
+      | i -> parse_int_aux res idx i
+      | exception Failure _ -> assert false
+    end else begin
+      (* if b is odd, set the bit in res to 1 *)
+      let c = int_of_char (Bytes.get b (Bytes.length b - 1)) in
+      if c mod 2 = 1 then Bytes.set res idx '1';
+      (* divide b by 2 *)
+      let b' = divide_string_by_2 b start in
+      match first_non_zero b' 0 with
+      | Some start' -> parse_decimal_aux res (idx - 1) b' start'
+      | None -> res
+    end
+
+  let parse_decimal s n =
+    assert (String.length s > 2 && s.[0] = 'b' && s.[1] = 'v');
+    let b = Bytes.of_string (String.sub s 2 (String.length s - 2)) in
+    let b' = parse_decimal_aux (Bytes.make n '0') (n - 1) b 0 in
+    Bytes.to_string b'
+
+end
+
+(* Fuzzy search maps *)
+(* ************************************************************************ *)
+
+module Fuzzy_Map = struct
+
+  module S = Spelll
+  module I = S.Index
+
+  (** We use fuzzy maps in order to give suggestions in case of typos.
+        Since such maps are not trivial to extend to Dolmen identifiers,
+        we map strings (identifier names) to list of associations. *)
+  type 'a t = (Dolmen.Std.Id.t * 'a) list I.t
+
+  let eq id (x, _) = Dolmen.Std.Id.equal id x
+
+  let empty = I.empty
+
+  let rec seq_to_list_ s = match s() with
+    | Seq.Nil -> []
+    | Seq.Cons (x,y) -> x :: seq_to_list_ y
+
+  let get t id =
+    let s = Dolmen.Std.Id.(id.name) in
+    match seq_to_list_ (I.retrieve ~limit:0 t s) with
+    | [l] -> l
+    | [] -> []
+    | _ -> assert false
+
+  let mem t id =
+    List.exists (eq id) (get t id)
+
+  let find t id =
+    snd @@ List.find (eq id) (get t id)
+
+  let add t id v =
+    let l = get t id in
+    let l' =
+      if List.exists (eq id) (get t id) then l
+      else (id, v) :: l
+    in
+    I.add t Dolmen.Std.Id.(id.name) l'
+
+  (** Return a list of suggestions for an identifier. *)
+  let suggest t ~limit id =
+    let s = Dolmen.Std.Id.(id.name) in
+    let l = seq_to_list_ (I.retrieve ~limit t s) in
+    List.flatten @@ List.map (List.map fst) l
+
+end
+
+(* Fuzzy search hashtables *)
+(* ************************************************************************ *)
+
+module Fuzzy_Hashtbl = struct
+
+  (** Fuzzy hashtables are just references to fuzzy maps. *)
+  type 'a t = 'a Fuzzy_Map.t ref
+
+  let create () =
+    ref Fuzzy_Map.empty
+
+  let find r id =
+    Fuzzy_Map.find !r id
+
+  let add r id v =
+    r := Fuzzy_Map.add !r id v
+
+  let suggest r ~limit id =
+    Fuzzy_Map.suggest !r ~limit id
+
+end
+
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/misc.mli b/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/misc.mli
new file mode 100644
index 0000000000000000000000000000000000000000..bed5b44751c7d8356f50e4bd03b5e1204d9c5760
--- /dev/null
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/misc.mli
@@ -0,0 +1,133 @@
+
+(** Misc
+
+    Collection of various helper functions, some rather specific to
+    dolmen (such as the bitv manipulation module), and others more
+    generic (e.g. the {List} and {Option} modules. For these generic
+    functions, they are here either because they do not exist in the
+    stdlib and they did not (yet) warrant depending on an external
+    alternative stdlib, or because they were added in recent versions
+    of ocaml and thus would unnecessarily restrict the availability
+    of dolmen on older versions of ocaml.
+*)
+
+(** Option helpers *)
+module Options : sig
+
+  val map : ('a -> 'b) -> 'a option -> 'b option
+  (** Map over options. *)
+
+end
+
+(** List helpers *)
+module Lists : sig
+
+  val init : int -> (int -> 'a) -> 'a list
+  (** Create a list of the given length by calling th e givne function
+      for each element (starting from [0] up until the length minus one. *)
+
+  val replicate : int -> 'a -> 'a list
+  (** Create a list containing n-times the given element. *)
+
+  val take_drop : int -> 'a list -> 'a list * 'a list
+  (** [take_drop n l] tries and split the list into a first list
+      containing the first [n] elements of [l], and in a second list
+      the rest.
+      @raise Invalid_argument if [l] has less than [n] elements. *)
+
+end
+
+(** String helper *)
+module Strings : sig
+
+  val to_list : string -> char list
+  (** Explode the string into a list of characters. *)
+
+  val is_suffix : suffix:string -> string -> bool
+  (** Check whether a string is a suffix of another. *)
+
+end
+
+(** Fuzzy search maps *)
+module Fuzzy_Map : sig
+
+  type 'a t
+  (** The type of Fuzzy maps from Dolmen identifiers
+      to values of type ['a] *)
+
+  val empty : _ t
+  (** The empty fuzzy search map. *)
+
+  val mem : 'a t -> Dolmen.Std.Id.t -> bool
+  (** Test whether the given id is bound in the map. *)
+
+  val find : 'a t -> Dolmen.Std.Id.t -> 'a
+  (** Find the value bound to an id.
+      @raise Not_found if the id is not bound. *)
+
+  val add : 'a t -> Dolmen.Std.Id.t -> 'a -> 'a t
+  (** Add a new binding to the map. *)
+
+  val suggest : 'a t -> limit:int -> Dolmen.Std.Id.t -> Dolmen.Std.Id.t list
+  (** Return a list of bound identifiers in the map that are close
+      (up to [limit] in terms of edition distance) to the given id. *)
+
+end
+
+
+(** Fuzzy search Hashtables *)
+module Fuzzy_Hashtbl : sig
+
+  type 'a t
+  (** The type of fuzzy hashtables from Dolmen identifiers
+      to values of type ['a]. *)
+
+  val create : unit -> _ t
+  (** Create a new fuzzy hashtable. *)
+
+  val find : 'a t -> Dolmen.Std.Id.t -> 'a
+  (** Find the value bound to the given Identifier
+      @raise Not_found if the id is not bound. *)
+
+  val add : 'a t -> Dolmen.Std.Id.t -> 'a -> unit
+  (** Add a new binding to the hashtable. *)
+
+  val suggest : 'a t -> limit:int -> Dolmen.Std.Id.t -> Dolmen.Std.Id.t list
+  (** Return a list of bound identifiers in the hashtbl that are close
+      (up to [limit] in terms of edition distance) to the given id. *)
+
+end
+
+(** Bitvector helpers *)
+module Bitv : sig
+
+  exception Invalid_char of char
+  (** Excpetion raised by functions in this module when a non-valid
+      character is encountered in the parsing functions. *)
+
+  val parse_binary : string -> string
+  (** Parse a string of the form "#bXXXXXXX" (with X a binary
+      character, i.e. either '1' or '0'), into a binary
+      representation of the bitvector.
+      In this case, it means taking the substring and checking
+      that all characters are valid.
+      @raise Invalid_char if the input string contains an non-binary
+        character *)
+
+  val parse_hexa : string -> string
+  (** Parse a string of the form "#xXXXXXXX" (with X a hexadecimal
+      character, i.e. in the '0'-'f' range), into a binary
+      representation of the bitvector.
+      @raise Invalid_char if the input string contains a non-hexa
+        character *)
+
+  val parse_decimal : string -> int -> string
+  (** Parse a string of the form "bvXXXXXXX" (with X a decimal
+      character, i.e. in the '0'-'9' range), into a binary bitvector
+      of the given size (second argument), which is the representation
+      of the decimal integer (or a truncated version if the size given
+      is smaller thant the required size for the given integer).
+      @raise Invalid_char if the input string contains a non-decimal
+        character *)
+
+end
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/strings.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/strings.ml
new file mode 100644
index 0000000000000000000000000000000000000000..8348d2a216b9dd1ead21443e7edc2015a77c2f5b
--- /dev/null
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/strings.ml
@@ -0,0 +1,216 @@
+
+module Id = Dolmen.Std.Id
+
+(* Smtlib Unicode Strings *)
+(* ************************************************************************ *)
+
+module Smtlib2 = struct
+
+  module Tff
+      (Type : Tff_intf.S)
+      (Ty : Dolmen.Intf.Ty.Smtlib_String with type t := Type.Ty.t)
+      (T : Dolmen.Intf.Term.Smtlib_String with type t := Type.T.t) = struct
+
+    type _ Type.err +=
+      | Invalid_hexadecimal : string -> Dolmen.Std.Term.t Type.err
+      | Invalid_string_char : char -> Dolmen.Std.Term.t Type.err
+      | Invalid_escape_sequence : string * int -> Dolmen.Std.Term.t Type.err
+
+    let int_of_string_hexa s = int_of_string ("0x" ^ s)
+
+    let parse_uchar_hexa env ast s =
+      if String.length s < 3 then raise Exit;
+      if not (s.[0] = '#' && s.[1] = 'x') then raise Exit;
+      let s' = String.sub s 2 (String.length s - 2) in
+      match int_of_string_hexa s' with
+      | i when 0 <= i && i <= 0x2FFFF ->
+        let b = Buffer.create 5 in
+        let e = Uutf.encoder (`UTF_8) (`Buffer b) in
+        let u = Uchar.of_int i in
+        begin match Uutf.encode e (`Uchar u) with
+          | `Ok -> Buffer.contents b
+          | `Partial -> assert false
+        end
+      | _ ->
+        Type._error env (Ast ast) (Invalid_hexadecimal s)
+      | exception Failure _ ->
+        Type._error env (Ast ast) (Invalid_hexadecimal s)
+
+    let parse_ustring env ast s =
+      let b = Buffer.create (String.length s) in
+      let e = Uutf.encoder (`UTF_8) (`Buffer b) in
+      let encode x =
+        match Uutf.encode e x with
+        | `Ok -> ()
+        | `Partial -> assert false (* should not happen with a buffer dst *)
+      in
+      let rec aux i =
+        if i >= String.length s then begin
+          encode `End;
+          Buffer.contents b
+        end else begin
+          match s.[i] with
+          (* escape sequence *)
+          | '\\' ->
+            begin try
+                if i + 1 >= String.length s then begin
+                  let () = encode (`Uchar (Uchar.of_char '\\')) in
+                  aux (i + 1)
+                end else if s.[i + 1] <> 'u' then begin
+                  let () = encode (`Uchar (Uchar.of_char '\\')) in
+                  let () = encode (`Uchar (Uchar.of_char s.[i + 1])) in
+                  aux (i + 2)
+                end else
+                  match s.[i + 2] with
+                  | '{' ->
+                    let j = String.index_from s (i + 3) '}' in
+                    let n = j - (i + 3) in
+                    assert (n > 0);
+                    if n > 5 then raise Exit;
+                    let s' = String.sub s (i + 3) n in
+                    let u = Uchar.of_int (int_of_string_hexa s') in
+                    let () = encode (`Uchar u) in
+                    aux (j + 1)
+                  | _ ->
+                    let s' = String.sub s (i + 2) 4 in
+                    let u = Uchar.of_int (int_of_string_hexa s') in
+                    let () = encode (`Uchar u) in
+                    aux (i + 6)
+              with
+              | Exit
+              | Failure _
+              | Invalid_argument _ ->
+                Type._error env (Ast ast) (Invalid_escape_sequence (s, i))
+            end
+          (* US ASCII chars allowed *)
+          | ' ' .. '~' as c ->
+            encode (`Uchar (Uchar.of_char c));
+            aux (i + 1)
+          (* Error *)
+          | c -> Type._error env (Ast ast) (Invalid_string_char c)
+        end
+      in
+      aux 0
+
+    let parse _version env s =
+      match s with
+      (* Types *)
+      | Type.Id { Id.ns = Id.Sort; name = "Int"; } ->
+        `Ty (Base.app0 (module Type) env "String" Ty.int)
+      | Type.Id { Id.ns = Id.Sort; name = "String"; } ->
+        `Ty (Base.app0 (module Type) env "String" Ty.string)
+      | Type.Id { Id.ns = Id.Sort; name = "RegLan"; } ->
+        `Ty (Base.app0 (module Type) env "RegLan" Ty.string_reg_lang)
+
+      (* String literals *)
+      | Type.Id { Id.ns = Value String; name; } ->
+        `Term (fun ast args ->
+            let s = parse_ustring env ast name in
+            Base.app0 (module Type) env name (T.String.of_ustring s) ast args
+          )
+
+      (* Terms *)
+      | Type.Id ({ Id.ns = Id.Term; name; } as id) ->
+        begin match name with
+
+          (* String Functions *)
+          | "str.len" ->
+            `Term (Base.term_app1 (module Type) env name T.String.length)
+          | "str.at" ->
+            `Term (Base.term_app2 (module Type) env name T.String.at)
+
+          | "str.is_digit" ->
+            `Term (Base.term_app1 (module Type) env name T.String.is_digit)
+          | "str._to_code" ->
+            `Term (Base.term_app1 (module Type) env name T.String.to_code)
+          | "str.from_code" ->
+            `Term (Base.term_app1 (module Type) env name T.String.of_code)
+          | "str.to_int" ->
+            `Term (Base.term_app1 (module Type) env name T.String.to_int)
+          | "str.from_int" ->
+            `Term (Base.term_app1 (module Type) env name T.String.of_int)
+
+          | "str.++" ->
+            `Term (Base.term_app_left (module Type) env name T.String.concat)
+          | "str.substr" ->
+            `Term (Base.term_app3 (module Type) env name T.String.sub)
+
+          | "str.indexof" ->
+            `Term (Base.term_app3 (module Type) env name T.String.index_of)
+          | "str.replace" ->
+            `Term (Base.term_app3 (module Type) env name T.String.replace)
+          | "str.replace_all" ->
+            `Term (Base.term_app3 (module Type) env name T.String.replace_all)
+          | "str.replace_re" ->
+            `Term (Base.term_app3 (module Type) env name T.String.replace_re)
+          | "str.replace_re_all" ->
+            `Term (Base.term_app3 (module Type) env name T.String.replace_re_all)
+
+          | "str.prefixof" ->
+            `Term (Base.term_app2 (module Type) env name T.String.is_prefix)
+          | "str.suffixof" ->
+            `Term (Base.term_app2 (module Type) env name T.String.is_suffix)
+          | "str.contains" ->
+            `Term (Base.term_app2 (module Type) env name T.String.contains)
+
+          | "str.<" ->
+            `Term (Base.term_app2 (module Type) env name T.String.lt)
+          | "str.<=" ->
+            `Term (Base.term_app2 (module Type) env name T.String.leq)
+
+          (* String/RegLan functions *)
+          | "str.to_re" ->
+            `Term (Base.term_app1 (module Type) env name T.String.RegLan.of_string)
+          | "re.range" ->
+            `Term (Base.term_app2 (module Type) env name T.String.RegLan.range)
+          | "str.in_re" ->
+            `Term (Base.term_app2 (module Type) env name T.String.in_re)
+
+          (* RegLan functions *)
+          | "re.none" ->
+            `Term (Base.app0 (module Type) env name T.String.RegLan.empty)
+          | "re.all" ->
+            `Term (Base.app0 (module Type) env name T.String.RegLan.all)
+          | "re.allchar" ->
+            `Term (Base.app0 (module Type) env name T.String.RegLan.allchar)
+          | "re.++" ->
+            `Term (Base.term_app_left (module Type) env name T.String.RegLan.concat)
+          | "re.union" ->
+            `Term (Base.term_app_left (module Type) env name T.String.RegLan.union)
+          | "re.inter" ->
+            `Term (Base.term_app_left (module Type) env name T.String.RegLan.inter)
+          | "re.*" ->
+            `Term (Base.term_app1 (module Type) env name T.String.RegLan.star)
+          | "re.comp" ->
+            `Term (Base.term_app1 (module Type) env name T.String.RegLan.complement)
+          | "re.diff" ->
+            `Term (Base.term_app2 (module Type) env name T.String.RegLan.diff)
+          | "re.+" ->
+            `Term (Base.term_app1 (module Type) env name T.String.RegLan.cross)
+          | "re.opt" ->
+            `Term (Base.term_app1 (module Type) env name T.String.RegLan.option)
+
+          (* Indexed identifiers *)
+          | _ -> Base.parse_id id [
+              "char", `Unary (fun s -> `Term (fun ast args ->
+                  let s' = parse_uchar_hexa env ast s in
+                  Base.app0 (module Type) env name (T.String.of_ustring s') ast args
+                ));
+              "re.^", `Unary (fun s ->
+                  let n = int_of_string s in
+                  `Term (Base.term_app1 (module Type) env name (T.String.RegLan.power n))
+                );
+              "re.loop", `Binary (fun s s' ->
+                  let n1 = int_of_string s in
+                  let n2 = int_of_string s' in
+                  `Term (Base.term_app1 (module Type) env name (T.String.RegLan.loop n1 n2))
+                );
+            ] ~err:(Base.bad_term_index_arity (module Type) env)
+              ~k:(fun _ -> `Not_found)
+        end
+
+      | _ -> `Not_found
+
+  end
+
+end
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/strings.mli b/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/strings.mli
new file mode 100644
index 0000000000000000000000000000000000000000..0c30e4a5cdb855f44d14a4d7ed905f558057db29
--- /dev/null
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/strings.mli
@@ -0,0 +1,20 @@
+
+
+(** Smtlib string builtins *)
+module Smtlib2 : sig
+
+  module Tff
+      (Type : Tff_intf.S)
+      (Ty : Dolmen.Intf.Ty.Smtlib_String with type t := Type.Ty.t)
+      (T : Dolmen.Intf.Term.Smtlib_String with type t := Type.T.t) : sig
+
+    type _ Type.err +=
+      | Invalid_hexadecimal : string -> Dolmen.Std.Term.t Type.err
+      | Invalid_string_char : char -> Dolmen.Std.Term.t Type.err
+      | Invalid_escape_sequence : string * int -> Dolmen.Std.Term.t Type.err
+
+    val parse : Dolmen.Smtlib2.version -> Type.builtin_symbols
+
+  end
+
+end
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/strings.smt2 b/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/strings.smt2
new file mode 100644
index 0000000000000000000000000000000000000000..6ab18171f1af54ba58e1019ddfd8eda4673b7022
--- /dev/null
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/strings.smt2
@@ -0,0 +1,697 @@
+(theory Strings
+
+ :smt-lib-version 2.6
+ :written_by "Cesare Tinelli, Clark Barrett, and Pascal Fontaine"
+ :date "2020-02-11"
+
+ :notes
+ "This is a theory of character strings and regular expressions over an alphabet
+  consisting of Unicode characters. It is not meant to be used in isolation but
+  in combination with Ints, the theory of integer numbers.
+ "
+
+ :notes
+ "The theory is based on an initial proposal by Nikolaj Bjørner, Vijay Ganesh,
+  Raphaël Michel and Margus Veanes at SMT 2012.
+  The following people, in alphabetical order, have contributed further suggestions
+  that helped shape the current version of the theory (with our apologies for any,
+  unintentional, omissions):
+  Kshitij Bansal, Murphy Berzish, Nikolaj Bjørner, David Cok, Levent Erkok,
+  Andrew Gacek, Vijay Ganesh, Alberto Griggio, Joxan Jaffar, Anthony Lin, Andres
+  Nötzli, Andrew Reynolds, Philipp Rümmer, Margus Veanes, and Tjark Weber.
+ "
+
+;-------
+; Sorts
+;-------
+
+ :sorts ((String 0) ; string sort
+         (RegLan 0) ; regular expression sort
+         (Int 0)    ; integer sort
+        )
+
+ :notes
+ "There was consensus in the community that having a character type is not
+  really necessary and in fact complicates the theory. So the only way to
+  express characters is to use strings of length 1.
+ "
+
+; In string fields below (which are double-quote-delimited) we cannot write
+; something like "abc" to denote a string constant, we must use ""abc"" instead.
+
+ :notes
+ "Because of SMT-LIB's own escaping conventions, string literals are written
+  in quadruple quotes, as in ""abc"", in textual fields here.
+ "
+
+;-----------
+; Constants
+;-----------
+
+; string constants for _singleton_ strings,
+; i.e., strings consisting of exactly one character
+ :funs_description
+ "All indexed identifiers, all of sort String, of the form
+
+    (_ char ⟨H⟩)
+
+  where ⟨H⟩ is an SMT-LIB hexadecimal generated by the following BNF grammar
+
+      ⟨H⟩ ::= #x⟨F⟩ | #x⟨F⟩⟨F⟩ | #x⟨F⟩⟨F⟩⟨F⟩ | #x⟨F⟩⟨F⟩⟨F⟩⟨F⟩ | #x⟨2⟩⟨F⟩⟨F⟩⟨F⟩⟨F⟩
+      ⟨2⟩ ::= 0 | 1 | 2
+      ⟨F⟩ ::= ⟨2⟩ | 3 | 4 | 5 | 6 | 7 | 8 | 9
+            | a | b | b | d | e | f
+            | A | B | C | D | E | F
+
+   Ex:  (_ char #xA)  (_ char #x4E)  (_ char #x123)  (_ char #x1BC3D)
+
+   Each identifier (_ char n) denotes a string of length 1 whose only character
+   is the Unicode character with code point n. We identify Unicode characters
+   with their code point, expressed as a hexadecimal.
+   For instance,
+   - (_ char #x2B) denotes the string ""+"" whose only character has code point
+     0x0002B (PLUS SIGN);
+   - (_ char #x27E8) denotes the string ""⟨"" whose only character has code point
+     0x027E8 (MATHEMATICAL LEFT ANGLE BRACKET).
+ "
+
+ :notes
+ "The use of hexadecimal as indices of indexed symbols requires a (minor)
+  extension of the SMT-LIB 2 standard which currently allows only numerals and
+  symbols as indices.
+ "
+
+ :notes
+ "Because of leading zeros, the same one-character string is denoted by more
+  than one constant.
+  Example: (_ char #x2B), (_ char #x02B), (_ char #x002B) and (_ char #x0002B).
+ "
+
+ :notes
+ "The singleton string constants represent all the Unicode code points in
+  Planes 0 to 2 of Unicode, ranging from 0x00000 to 0x2FFFF (0 to 196607).
+  Planes 3-13 are currently unassigned and 14-16 are special purpose or
+  private planes.
+
+  A later version may extend the constants to all 17 Unicode planes.
+
+  References:
+  - https://www.unicode.org/main.html
+  - http://www.utf8-chartable.de/
+  - https://www.compart.com/en/unicode/
+ "
+
+ :notes
+ "Rationale for the chosen notation for singleton string constants:
+  Because of their large range, Unicode code points are typically given in
+  hexadecimal notation. Using a hexadecimal directly to denote the
+  corresponding character, however, would create an overloading problem in
+  logics that combine this theory with that of bitvectors since hexadecimals
+  denote bitvectors there.
+  Using them as indices instead avoids this problem.
+ "
+
+; String literals (string constants)
+ :funs_description
+ "All double-quote-delimited string literals consisting of printable US ASCII
+  characters, i.e., those with Unicode code point from 0x00020 to 0x0007E.
+  We refer to these literals as _string constants_.
+ "
+
+ :notes
+ "The restriction to printable US ASCII characters in string constants is for
+  simplicity since that set is universally supported. Arbitrary Unicode characters
+  can be represented with _escape sequences_ which can have one of the following
+  forms
+      \ud₃d₂d₁d₀
+      \u{dâ‚€}
+      \u{d₁d₀}
+      \u{d₂d₁d₀}
+      \u{d₃d₂d₁d₀}
+      \u{d₄d₃d₂d₁d₀}
+  where each dáµ¢ is a hexadecimal digit and dâ‚„ is restricted to the range 0-2.
+  These are the **only escape sequences** in this theory. See later.
+  In a later version, the restrictions above on the digits may be extended
+  to allow characters from all 17 Unicode planes.
+
+  Observe that the first form, \ud₃d₂d₁d₀, has exactly 4 hexadecimal digit,
+  following the common use of this form in some programming languages.
+  Unicode characters outside the range covered by \ud₃d₂d₁d₀ can be
+  represented with the long form \u{d₄d₃d₂d₁d₀}.
+
+  Also observe that programming language-specific escape sequences, such as
+  \n, \b, \r and so on, are _not_ escape sequences in this theory as they
+  are not fully standard across languages.
+ "
+
+ :notes
+ "SMT-LIB 2.6 has one escape sequence of its own for string literals. Two
+  double quotes ("") are used to represent the double-quote character within
+  a string literal such as the one containing this very note. That escape
+  sequence is at the level of the SMT-LIB frontend of a solver, not at the
+  level of this theory.
+ "
+
+ :values
+ "The set of values for String is the set of all string literals;
+  for RegLan it is the set of all ground terms of that sort.
+ "
+
+ :notes
+ "The set of values for String and RegLan could be restricted further, to
+  remove some redundancies. For instance, we could disallow leading zeros
+  in escape sequences.
+  For RegLan, we could insist on some level of normalization for regular
+  expression values. These restrictions are left to future versions.
+ "
+
+ :notes
+ "All function symbols in this theory denote *total* functions, i.e.,
+  they are fully specified by the theory. This is achieved by returning
+  _error_ values for inputs where the intended functions are undefined.
+  Error outputs are always outside of the range of the intended function,
+  so there is no confusion with non-error outputs.
+ "
+
+;----------------
+; Core functions
+;----------------
+
+ ; String functions
+ :funs (
+        ; String concatenation
+        (str.++ String String String :left-assoc)
+
+        ; String length
+        (str.len String Int)
+
+        ; Lexicographic ordering
+        (str.< String String Bool :chainable)
+       )
+
+ ; Regular expression functions
+ :funs (
+        ; String to RE injection
+        (str.to_re String RegLan)
+
+        ; RE membership
+        (str.in_re String RegLan Bool)
+
+        ; Constant denoting the empty set of strings
+        (re.none RegLan)
+
+        ; Constant denoting the set of all strings
+        (re.all RegLan)
+
+        ; Constant denoting the set of all strings of length 1
+        (re.allchar RegLan)
+
+        ; RE concatenation
+        (re.++ RegLan RegLan RegLan :left-assoc)
+
+        ; RE union
+        (re.union RegLan RegLan RegLan :left-assoc)
+
+        ; RE intersection
+        (re.inter RegLan RegLan RegLan :left-assoc)
+
+        ; Kleene Closure
+        (re.* RegLan RegLan)
+       )
+
+ :note
+ "Function str.to_re allows one to write _symbolic regular expressions_,
+  e.g., RegLan terms with subterms like (str.to_re x) where x is a variable.
+  Such terms have more expressive power than regular expressions. This is
+  intentional, for future developments.
+  The restriction to actual regular expressions will be imposed in a logic
+  where str.to_re will be applicable to string constants only.
+ "
+
+;----------------------------
+; Additional functions
+;----------------------------
+
+ :fun (
+       ; Reflexive closure of lexicographic ordering
+       (str.<= String String Bool :chainable)
+
+       ; Singleton string containing a character at given position
+       ; or empty string when position is out of range.
+       ; The leftmost position is 0.
+       (str.at String Int String)
+
+       ; Substring
+       ; (str.substr s i n) evaluates to the longest (unscattered) substring
+       ; of s of length at most n starting at position i.
+       ; It evaluates to the empty string if n is negative or i is not in
+       ; the interval [0,l-1] where l is the length of s.
+       (str.substr String Int Int String)
+
+       ; First string is a prefix of second one.
+       ; (str.prefixof s t) is true iff s is a prefix of t.
+       (str.prefixof String String Bool)
+
+       ; First string is a suffix of second one.
+       ; (str.suffixof s t) is true iff s is a suffix of t.
+       (str.suffixof String String Bool)
+
+       ; First string contains second one
+       ; (str.contains s t) iff s contains t.
+       (str.contains String String Bool)
+
+       ; Index of first occurrence of second string in first one starting at
+       ; the position specified by the third argument.
+       ; (str.indexof s t i), with 0 <= i <= |s| is the position of the first
+       ; occurrence of t in s at or after position i, if any.
+       ; Otherwise, it is -1. Note that the result is i whenever i is within
+       ; the range [0, |s|] and t is empty.
+       (str.indexof String String Int Int)
+
+       ; Replace
+       ; (str.replace s t t') is the string obtained by replacing the first
+       ; occurrence of t in s, if any, by t'. Note that if t is empty, the
+       ; result is to prepend t' to s; also, if t does not occur in s then
+       ; the result is s.
+       (str.replace String String String String)
+
+       ; (str.replace_all s t t’) is s if t is the empty string. Otherwise, it
+       ; is the string obtained from s by replacing all occurrences of t in s
+       ; by t’, starting with the first occurrence and proceeding in
+       ; left-to-right order.
+       (str.replace_all String String String String)
+
+       ; (str.replace_re s r t) is the string obtained by replacing the
+       ; shortest leftmost non-empty match of r in s, if any, by t.
+       ; Note that if t is empty, the result is to prepend t to s.
+       (str.replace_re String RegLan String String)
+
+       ; (str.replace_re_all s r t) is the string obtained by replacing,
+       ; left-to right, each shortest *non-empty* match of r in s by t.
+       (str.replace_re_all String RegLan String String)
+
+       ; RE complement
+       (re.comp RegLan RegLan)
+
+       ; RE difference
+       (re.diff RegLan RegLan RegLan :left-assoc)
+
+       ; RE Kleene cross
+       ; (re.+ e) abbreviates (re.++ e (re.* e)).
+       (re.+ RegLan RegLan)
+
+       ; RE option
+       ; (re.opt e) abbreviates (re.union e (str.to_re ""))
+       (re.opt RegLan RegLan)
+
+       ; RE range
+       ; (re.range s₁ s₂) is the set of all *singleton* strings s such that
+       ; (str.<= s₁ s s₂) provided s₁ and s₂ are singleton. Otherwise, it
+       ; is the empty language.
+       (re.range String String RegLan)
+
+
+       ; Function symbol indexed by a numeral n.
+       ; ((_ re.^ n) e) is the nth power of e:
+       ; - ((_ re.^ 0) e) = (str.to_re "")
+       ; - ((_ re.^ n') e) = (re.++ e ((_ re.^ n) e))  where n' = n + 1
+       ((_ re.^ n) RegLan RegLan)
+
+       ; Function symbol indexed by two numerals n₁ and n₂.
+       ; - ((_ re.loop n₁ n₂) e) = re.none                   if n₁ > n₂
+       ; - ((_ re.loop n₁ n₂) e) = ((_ re.^ n₁) e)           if n₁ = n₂
+       ; - ((_ re.loop n₁ n₂) e) =
+       ;     (re.union ((_ re.^ n₁) e) ... ((_ re.^ n₂) e))  if n₁ < n₂
+       ((_ re.loop n₁ n₂) RegLan RegLan)
+      )
+
+ :notes
+ "The symbol re.^ is indexed, as opposed to having an additional Int argument.
+  The latter is problematic because then n can be symbolic in a formula,
+  complicating solving or requiring a logic that restricts n to be a numeral.
+  The same argument applies to re.loop and has been used for functions in other
+  theories, such as (_ extract i j) in FixedSizeBitVectors.
+ "
+
+ :notes
+ "The arguments to re.range can be symbolic. This is intentional, as in the case
+  of str.to_re .
+ "
+
+;---------------------------
+; Maps to and from integers
+;---------------------------
+
+ :fun (
+       ; Digit check
+       ; (str.is_digit s) is true iff s consists of a single character which is
+       ; a decimal digit, that is, a code point in the range 0x0030 ... 0x0039.
+       (str.is_digit String Bool)
+
+       ; (str.to_code s) is the code point of the only character of s,
+       ; if s is a singleton string; otherwise, it is -1.
+       (str.to_code String Int)
+
+       ; (str.from_code n) is the singleton string whose only character is
+       ; code point n if n is in the range [0, 196607]; otherwise, it is the
+       ; empty string.
+       (str.from_code Int String)
+
+       ; Conversion to integers
+       ; (str.to_int s) with s consisting of digits (in the sense of str.is_digit)
+       ; evaluates to the positive integer denoted by s when seen as a number in
+       ; base 10 (possibly with leading zeros).
+       ; It evaluates to -1 if s is empty or contains non-digits.
+       (str.to_int String Int)
+
+       ; Conversion from integers.
+       ; (str.from_int n) with n non-negative is the corresponding string in
+       ; decimal notation, with no leading zeros. If n < 0, it is the empty string.
+       (str.from_int Int String)
+
+  :notes
+  "(str.to_int ""00123"") evaluates to 123.
+   (str.from_int 123) evaluates to ""123"".
+   (str.to_int ""-123"") evaluates to -1, an error value, not to -123.
+   (str.from_int -123) evaluates to """", an error value, not to ""-123"".
+  "
+      )
+
+ :definition
+ "For every expanded signature Σ, the instance of Strings with that signature is
+  the theory consisting of all Σ-models that satisfy the constraints detailed
+  below.
+  We use
+  - ⟦ _ ⟧ to denote the meaning of a symbol in a given Σ-model.
+  - UC to denote the set of all integers from 0x00000 to 0x2FFFF, representing
+    the set of all code points for Unicode characters in Planes 0-2.
+
+  * String
+
+    ⟦String⟧ is the set UC* of all words, in the sense of universal algebra,
+    over the alphabet UC of Unicode characters, with juxtaposition denoting
+    the concatenation operator here.
+
+    Note: Character positions in a word are numbered starting at 0.
+
+  * RegLan
+
+    ⟦RegLan⟧ is the powerset of ⟦String⟧, the set of all subsets of ⟦String⟧.
+    Each subset can be seen as a language with alphabet UC.
+    Each variable-free term of sort RegLan denotes a regular language in ⟦RegLan⟧.
+
+  * Int
+
+    ⟦Int⟧ is the set of integer numbers.
+
+  * Singleton string constants
+
+    Each such constant is interpreted as the singleton string consisting of
+    the corresponding code point. For example, constant (_ char #x65) is
+    interpreted as code point 0x00065, for the letter A, while (_ char #x3B1) is
+    interpreted as code point 0x003B1, for the Greek letter α.
+
+  * String constants
+
+    1. The empty string constant """" is interpreted as the empty word ε of UC*.
+
+    2. Each string constant containing a single (printable) US ASCII character
+       is interpreted as the word consisting of the corresponding Unicode
+       character code point.
+
+       Ex: ⟦""m""⟧ = ⟦(_ char #x6D)⟧ = 0x0006D
+           ⟦"" ""⟧ = ⟦(_ char #x20)⟧ = 0x00020
+
+    3. Each string constant of the form ""\ud₃d₂d₁d₀"" where each dᵢ is a
+       hexadecimal digit is interpreted as the word consisting of just the
+       character with code point 0xd₃d₂d₁d₀
+
+       Ex: ⟦""\u003A""⟧ = ⟦(_ char #x3A)⟧ = 0x0003A
+
+    4. Each literal of the form ""\u{d₀}"" (resp., ""\u{d₁d₀}"", ""\u{d₂d₁d₀}"",
+       ""\u{d₃d₂d₁d₀}"", or ""\u{d₄d₃d₂d₁d₀}"") where each dᵢ is a hexadecimal
+       digit and dâ‚„ is in the set {0,1,2} is interpreted as the word consisting
+       of just the character with code point 0xd₀ (resp., 0xd₁d₀, 0xd₂d₁d₀,
+       0xd₃d₂d₁d₀, or 0xd₄d₃d₂d₁d₀).
+
+       Ex: ⟦""\u{3A}""⟧ = ⟦(_ char #x3A)⟧ = 0x0003A
+
+    5. ⟦l⟧ = ⟦l₁⟧⟦l₂⟧  if l does not start with an escape sequence and can be
+       obtained as the concatenation of a one-character string literal l₁ and
+       a non-empty string literal lâ‚‚.
+
+       Ex: ⟦""a\u02C1""⟧ = ⟦""a""⟧⟦""\u02C1""⟧ = 0x00061 0x002C1
+           ⟦""\u2CA""⟧ = 0x0005C ⟦""u2CXA""⟧           (not an escape sequence)
+           ⟦""\u2CXA""⟧ = 0x0005C ⟦""u2CXA""⟧          (not an escape sequence)
+           ⟦""\u{ACG}A""⟧ = 0x0005C ⟦""u{ACG}A""⟧      (not an escape sequence)
+
+    6. ⟦l⟧ = ⟦l₁⟧⟦l₂⟧  if l can be obtained as the concatenation of string
+       literals l₁ and l₂ where l₁ is an escape sequence and l₂ is non-empty.
+
+       Ex: ⟦""\u02C1a""⟧ = ⟦""\u02C""⟧⟦""1a""⟧ = 0x0002C ⟦""1a""⟧
+           ⟦""\u{2C}1a""⟧ = ⟦""\u{2C}""⟧⟦""1a""⟧ = 0x0002C ⟦""1a""⟧
+
+    Note: Character positions in a string literal are numbered starting at 0,
+          with escape sequences treated as a single character – consistently
+          with their semantics.
+
+          Ex.: In ""a\u1234T"", character a is at position 0, the character
+               corresponding to ""\u1234"" is at position 1, and character T is
+               at position 2.
+
+  * (str.++ String String String)
+
+    ⟦str.++⟧ is the word concatenation function.
+
+  * (str.len String Int)
+
+    ⟦str.len⟧(w) is the number of characters (elements of UC) in w,
+    denoted below as |w|.
+
+    Note: ⟦str.len⟧(w) is **not** the number of bytes used by some Unicode
+          encoding, such as UTF-8 – that number can be greater than the number
+          of characters.
+
+    Note: ⟦str.len(""\u1234"")⟧  is 1 since every escape sequence denotes
+          a single character.
+
+  * (str.< String String Bool)
+
+    ⟦str.<⟧(w₁, w₂) is true iff w₁ is smaller than w₂ in the lexicographic
+    extension to UC* of the standard numerical < ordering over UC.
+
+    Note: The order induced by str.< corresponds to alphabetical order
+    for strings composed of characters from the alphabet of a western language
+    such as English:
+    ⟦(str.< ""a"" ""aardvark"" ""aardwolf"" ... ""zygomorphic"" ""zygotic"")⟧ = true
+
+  * (str.to_re String RegLan)
+
+    ⟦str.to_re⟧(w) = { w }
+
+  * (str.in_re String RegLan Bool)
+
+    ⟦str.in_re⟧(w, L) = true iff w ∈ L
+
+  * (re.none RegLan)
+
+    ⟦re.none⟧  = ∅
+
+  * (re.all RegLan)
+
+    ⟦re.all⟧  = ⟦String⟧ = UC*
+
+  * (re.allchar RegLan)
+
+    ⟦re.allchar⟧  = { w ∈ UC* | |w| = 1 } .
+
+  * (re.++ RegLan RegLan RegLan :left-assoc)
+
+    ⟦re.++⟧(L₁, L₂) = { w₁w₂ | w₁ ∈ L₁ and w₂ ∈ L₂ }
+
+  * (re.union RegLan RegLan RegLan :left-assoc)
+
+    ⟦re.union⟧(L₁, L₂) = { w | w ∈ L₁ or w ∈ L₂ }
+
+  * (re.inter RegLan RegLan RegLan :left-assoc)
+
+    ⟦re.inter⟧(L₁, L₂) = { w | w ∈ L₁ and w ∈ L₂ }
+
+  * (re.* RegLan RegLan)
+
+    ⟦re.*⟧(L) is the smallest subset K of UC* such that
+    1. ε ∈ K
+    2. ⟦re.++⟧(L,K) ⊆ K
+
+  * (str.<= String String Bool)
+
+    ⟦str.<=⟧(w₁, w₂) is true iff either ⟦str.<⟧(w₁, w₂) or w₁ = w₂.
+
+  * (str.at String Int String)
+
+    ⟦str.at⟧(w, n) = ⟦str.substr⟧(w, n, 1)
+
+  * (str.substr String Int Int String)
+
+   - ⟦str.substr⟧(w, m, n) is the unique word w₂ such that
+     for some words w₁ and w₃
+      - w = w₁w₂w₃
+      - |w₁| = m
+      - |wâ‚‚| = min(n, |w| - m)
+                                    if 0 <= m < |w| and 0 < n
+    - ⟦str.substr⟧(w, m, n) = ε      otherwise
+
+    Note: The second part of the definition makes ⟦str.substr⟧ a total function.
+
+  * (str.prefixof String String Bool)
+
+    ⟦str.prefixof⟧(w₁, w) = true  iff  w = w₁w₂ for some word w₂
+
+  * (str.suffixof String String Bool)
+
+    ⟦str.suffixof⟧(w₂, w) = true  iff  w = w₁w₂ for some word w₁
+
+  * (str.contains String String Bool)
+
+    ⟦str.contains⟧(w, w₂) = true  iff  w = w₁w₂w₃ for some words w₁, w₃
+
+  * (str.indexof String String Int Int)
+
+    - ⟦str.indexof⟧(w, w₂, i) is the smallest n such that for some words w₁, w₃
+        - w = w₁w₂w₃
+        - i <= n = |w₁|
+      if ⟦str.contains⟧(w, w₂) = true and i >= 0
+
+    - ⟦str.indexof⟧(w,w₂,i) = -1  otherwise
+
+  * (str.replace String String String String)
+
+    - ⟦str.replace⟧(w, w₁, w₂) = w          if ⟦str.contains⟧(w, w₁) = false
+
+    - ⟦str.replace⟧(w, w₁, w₂) = u₁w₂u₂
+      where u₁ is the shortest word such that
+            w = u₁w₁u₂
+                                            if ⟦str.contains⟧(w, w₁) = true
+
+  * (str.replace_all String String String String)
+
+    - ⟦str.replace_all⟧(w, w₁, w₂) = w      if ⟦str.contains⟧(w, w₁) = false
+                                             or
+                                             w₁ = ε
+
+    - ⟦str.replace_all⟧(w, w₁, w₂) = u₁w₂⟦str.replace_all⟧(u₂, w₁, w₂)
+      where u₁ is the shortest word such that
+            w = u₁w₁u₂
+                                          if ⟦str.contains⟧(w, w₁) = true
+                                            and
+                                            w₁ ≠ ε
+
+  * (str.replace_re String String String String)
+
+    - ⟦str.replace_re⟧(w, L, w₂) = w        if no substring of w is in L
+
+    - ⟦str.replace_re⟧(w, L, w₂) = u₁w₂u₂
+      where u₁, w₁ are the shortest words such that
+            - w = u₁w₁u₂
+            - w₁ ∈ L
+                                            if some substring of w is in L
+
+  * (str.replace_re_all String String String String)
+
+    - ⟦str.replace_re⟧(w, L, w₂) = w        if no substring of w is in L
+
+    - ⟦str.replace_re⟧(w, L, w₂) = u₁w₂⟦str.replace_re⟧(u₂, L, w₂)
+      where u₁, w₁ are the shortest words such that
+            - w = u₁w₁u₂
+            - w₁ ∈ L
+            - w₁ ≠ ε
+                                          if some substring of w is in L
+
+  * (re.comp RegLan RegLan)
+
+    ⟦str.comp⟧(L) = UC* \ L
+
+  * (re.diff RegLan RegLan RegLan :left-assoc)
+
+    ⟦str.diff⟧(L₁, L₂) = L₁ \ L₂
+
+  * (re.+ RegLan RegLan)
+
+    ⟦re.+⟧(L) = ⟦re.++⟧(L, ⟦re.*⟧(L))
+
+  * (re.opt RegLan RegLan)
+
+    ⟦re.opt⟧(L) = L ∪ { ε }
+
+  * (re.range String String RegLan)
+
+    - ⟦re.range⟧(w₁, w₂) = { w ∈ UC | w₁ <= w <= w₂ }
+      where <= is ⟦str.<=⟧                             if |w₁| = |w₂| = 1
+    - ⟦re.range⟧(w₁, w₂) = ∅                           otherwise
+
+    Note: ⟦re.range⟧(⟦""ab""⟧, ⟦""c""⟧) = ⟦re.range⟧(⟦""a""⟧, ⟦""bc""⟧) =
+          ⟦re.range⟧(⟦""c""⟧, ⟦""a""⟧) =  ∅
+
+  * ((_ re.^ n) RegLan RegLan)
+
+    ⟦(_ re.^ n)⟧(L) = Lⁿ  where Lⁿ is defined inductively on n as follows:
+    - L⁰ = { ε }
+    - Lⁿ⁺¹ = ⟦re.++⟧(L, Lⁿ)
+
+  * ((_ re.loop i n) RegLan RegLan)
+
+    ⟦(_ re.loop i n)⟧(L) = Lⁱ ∪ ... ∪ Lⁿ   if i <= n
+    ⟦(_ re.loop i n)⟧(L) = ∅               otherwise
+
+  * (str.is_digit String Bool)
+
+    ⟦str.is_digit⟧(w) = true  iff |w| = 1 and 0x00030 <= w <= 0x00039
+
+  * (str.to_code String Int)
+
+    - ⟦str.to_code⟧(w) = -1         if |w| ≠ 1
+    - ⟦str.to_code⟧(w) = w          otherwise  (as w consists of a single code point)
+
+  * (str.from_code Int String)
+
+    - ⟦str.from_code⟧(n) = n        if 0x00000 <= n <= 0x2FFFF
+    - ⟦str.from_code⟧(n) = ε        otherwise
+
+  * (str.to_int String Int)
+
+    - ⟦str.to_int⟧(w) = -1 if w = ⟦l⟧
+      where l is the empty string literal or one containing anything other than
+      digits, i.e., characters with code point in the range 0x00030–0x00039
+
+    - ⟦str.to_int⟧(w) = n if w = ⟦l⟧
+      where l is a string literal consisting of a single digit denoting number n
+
+    - ⟦str.to_int⟧(w) = 10*⟦str.to_int⟧(w₁) + ⟦str.to_int⟧(w₂) if
+      - w = w₁w₂
+      - |w₁| > 0
+      - |wâ‚‚| = 1
+      - ⟦str.to_int⟧(w₁) >= 0
+      - ⟦str.to_int⟧(w₂) >= 0
+
+    Note: This function is made total by mapping the empty word and words with
+          non-digits to -1.
+
+    Note: The function returns a non-negative number also for words that start
+          with (characters corresponding to) superfluous zeros, such as
+          ⟦""0023""⟧.
+
+  * (str.from_int Int String)
+
+    - ⟦str.from_int⟧(n) = w  where w is the shortest word such that
+    - ⟦str.to_int⟧(w) = n      if n >= 0
+    - ⟦str.from_int⟧(n) = ε    otherwise
+
+    Note: This function is made total by mapping negative integers
+          to the empty word.
+
+    Note: ⟦str.to_int⟧(⟦str.from_int⟧(n)) = n iff n is a non-negative integer.
+
+    Note: ⟦str.from_int⟧(⟦str.to_int⟧(w)) = w iff w consists only of digits *and*
+          has no leading zeros.
+ "
+)
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/tff.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/tff.ml
index c8f03a08d02e93bb05d26e1654604c72930183f5..4d96855238f88aa01701da0581f5d9610c7dcd17 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/tff.ml
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/tff.ml
@@ -1,207 +1,45 @@
 
 (* This file is free software, part of dolmen. See file "LICENSE" for more information *)
 
-open Dolmen
 module type S = Tff_intf.S
 
-(* Common types *)
-(* ************************************************************************ *)
-
-(* The type of reasons for constant typing *)
-type reason = Tff_intf.reason =
-  | Inferred of ParseLocation.t
-  | Declared of ParseLocation.t
-
-type ('ty_const, 'term_cstr, 'term_field, 'term_const) binding = [
-  | ('ty_const, 'term_cstr, 'term_field, 'term_const) Tff_intf.binding
-]
-
-(* Warnings module signature *)
-(* ************************************************************************ *)
-
-module type Warn = sig
-
-  type ty
-  type ty_var
-  type ty_const
-
-  type term
-  type term_var
-  type term_cstr
-  type term_const
-  type term_field
-
-  val shadow : Id.t ->
-    (ty_const, term_cstr, term_field, term_const) binding ->
-    (ty_const, term_cstr, term_field, term_const) binding ->
-    unit
-
-  val unused_ty_var : ParseLocation.t -> ty_var -> unit
-  val unused_term_var : ParseLocation.t -> term_var -> unit
-
-  val error_in_attribute : ParseLocation.t -> exn -> unit
-
-  val not_found : Id.t -> (int -> Id.t list) -> unit
-
-  val superfluous_destructor :
-    ParseLocation.t -> Id.t -> Id.t -> term_const -> unit
-
-end
-
 (* Typechecking functor *)
 (* ************************************************************************ *)
 
 module Make
-    (Tag: Dolmen_intf.Tag.S)
-    (Ty: Dolmen_intf.Type.Tff
+    (Tag: Dolmen.Intf.Tag.S)
+    (Ty: Dolmen.Intf.Ty.Tff
      with type 'a tag := 'a Tag.t)
-    (T: Dolmen_intf.Term.Tff
+    (T: Dolmen.Intf.Term.Tff
      with type ty := Ty.t
       and type ty_var := Ty.Var.t
       and type ty_const := Ty.Const.t
       and type 'a tag := 'a Tag.t)
-    (W : Warn
-     with type ty := Ty.t
-      and type ty_var := Ty.Var.t
-      and type ty_const := Ty.Const.t
-      and type term := T.t
-      and type term_var := T.Var.t
-      and type term_cstr := T.Cstr.t
-      and type term_const := T.Const.t
-      and type term_field := T.Field.t
-    )
 = struct
 
   (* Module aliases *)
   (* ************************************************************************ *)
 
-  module Tag = Tag
-  module Ty = Ty
+  (* These are exported *)
   module T = T
+  module Ty = Ty
+  module Tag = Tag
 
-  (* Log&Module Init *)
-  (* ************************************************************************ *)
-
-  let default_loc = ParseLocation.mk "<?>" 0 0 0 0
-
-  let or_default_loc = function
-    | Some loc -> loc
-    | None -> default_loc
-
-  let get_loc t =
-    match t.Term.loc with Some l -> l | None -> default_loc
-
-  (* Module alias to avoid confusing untyped Terms and typed terms *)
-  module Ast = Term
-
-  (** Some maps and hashtables *)
-  module E = Map.Make(Ty.Var)
-  module F = Map.Make(T.Var)
-  module R = Hashtbl.Make(Ty.Const)
-  module S = Hashtbl.Make(T.Const)
-  module U = Hashtbl.Make(T.Cstr)
-  module V = Hashtbl.Make(T.Field)
-
-  (* Convenience functions *)
-  (* ************************************************************************ *)
-
-  let init_list n f =
-    let rec aux acc i =
-      if i > n then List.rev acc
-      else aux (f i :: acc) (i + 1)
-    in
-    aux [] 1
-
-  let replicate n x =
-    let rec aux x acc n =
-      if n <= 0 then acc else aux x (x :: acc) (n - 1)
-    in
-    aux x [] n
-
-  let take_drop n l =
-    let rec aux acc n = function
-      | r when n <= 0 -> List.rev acc, r
-      | [] -> raise (Invalid_argument "take_drop")
-      | x :: r -> aux (x :: acc) (n - 1) r
-    in
-    aux [] n l
-
-  let option_map f = function
-    | None -> None
-    | Some x -> Some (f x)
-
-  (* Fuzzy search maps *)
-  (* ************************************************************************ *)
-
-  module M = struct
-
-    module S = Spelll
-    module I = S.Index
-
-    (** We use fuzzy maps in order to give suggestions in case of typos.
-        Since such maps are not trivial to extend to Dolmen identifiers,
-        we map strings (identifier names) to list of associations. *)
-    type 'a t = (Id.t * 'a) list I.t
-
-    let eq id (x, _) = Id.equal id x
-
-    let empty = I.empty
-
-    let rec seq_to_list_ s = match s() with
-      | Seq.Nil -> []
-      | Seq.Cons (x,y) -> x :: seq_to_list_ y
-
-    let get t id =
-      let s = Id.(id.name) in
-      match seq_to_list_ (I.retrieve ~limit:0 t s) with
-      | [l] -> l
-      | [] -> []
-      | _ -> assert false
-
-    let mem id t =
-      List.exists (eq id) (get t id)
-
-    let find id t =
-      snd @@ List.find (eq id) (get t id)
-
-    let add id v t =
-      let l = get t id in
-      let l' =
-        if List.exists (eq id) (get t id) then l
-        else (id, v) :: l
-      in
-      I.add t Id.(id.name) l'
-
-    (** Return a list of suggestions for an identifier. *)
-    let suggest ~limit id t =
-      let s = Id.(id.name) in
-      let l = seq_to_list_ (I.retrieve ~limit t s) in
-      List.flatten @@ List.map (List.map fst) l
-
-  end
-
-  (* Fuzzy search hashtables *)
-  (* ************************************************************************ *)
-
-  module H = struct
-
-    type 'a t = 'a M.t ref
-
-    (** Fuzzy hashtables are just references to fuzzy maps. *)
-    let create () = ref M.empty
-
-    let find r id = M.find id !r
-
-    let suggest r id = M.suggest id !r
-
-    let add r id v =
-      r := M.add id v !r
-
-  end
+  (* Non-exported module alias to avoid confusing
+     untyped Terms and typed terms *)
+  module Id = Dolmen.Std.Id
+  module Ast = Dolmen.Std.Term
+  module Stmt = Dolmen.Std.Statement
+  module Loc = Dolmen.Std.Loc
 
   (* Types *)
   (* ************************************************************************ *)
 
+  (* Different behavior of polymorphism *)
+  type poly =
+    | Explicit
+    | Implicit
+    | Flexible
 
   (* The type of potentially expected result type for parsing an expression *)
   type expect =
@@ -210,14 +48,18 @@ module Make
     | Typed of Ty.t
 
   (* The type returned after parsing an expression. *)
-  type tag = Any : 'a Tag.t * 'a -> tag
+  type tag =
+    | Any : 'a Tag.t * 'a -> tag
 
+  (* Result of parsing an expression *)
   type res =
-    | Ttype   : res
-    | Ty      : Ty.t -> res
-    | Term    : T.t -> res
-    | Tags    : tag list -> res
+    | Ttype
+    | Ty    of Ty.t
+    | Term  of T.t
+    | Tags  of tag list
+
 
+  (* Things that can be inferred *)
   type inferred =
     | Ty_fun of Ty.Const.t
     | Term_fun of T.Const.t
@@ -227,28 +69,191 @@ module Make
     | Id of Id.t
     | Builtin of Ast.builtin
 
+  (* Not found result *)
+  type not_found = [ `Not_found ]
+
+  (* Variable that can be bound to a dolmen identifier *)
+  type var = [
+    | `Ty_var of Ty.Var.t
+    | `Term_var of T.Var.t
+    | `Letin of Ast.t * T.Var.t * T.t
+  ]
+
   (* Constants that can be bound to a dolmen identifier. *)
   type cst = [
-    | `Ty of Ty.Const.t
     | `Cstr of T.Cstr.t
-    | `Term of T.Const.t
     | `Field of T.Field.t
+    | `Ty_cst of Ty.Const.t
+    | `Term_cst of T.Const.t
+  ]
+
+  (* Result of parsing a symbol by the theory *)
+  type builtin_res = [
+    | `Ttype of (Ast.t -> Ast.t list -> unit)
+    | `Ty    of (Ast.t -> Ast.t list -> Ty.t)
+    | `Term  of (Ast.t -> Ast.t list -> T.t)
+    | `Tags  of (Ast.t -> Ast.t list -> tag list)
   ]
 
+  (* Names that are bound to a dolmen identifier by the builtins *)
+  type builtin = [
+    | `Builtin of builtin_res
+  ]
+
+  (* Either a bound variable or a bound constant *)
+  type bound = [ var | cst | builtin ]
+
+  type reason =
+    | Builtin
+    | Bound of Loc.file * Ast.t
+    | Inferred of Loc.file * Ast.t
+    | Defined of Loc.file * Stmt.def
+    | Declared of Loc.file * Stmt.decl
+  (** The type of reasons for constant typing *)
+
+  type binding = [
+    | `Not_found
+    | `Builtin of [
+        | `Ttype
+        | `Ty
+        | `Term
+        | `Tag
+      ]
+    | `Variable of [
+        | `Ty of Ty.Var.t * reason option
+        | `Term of T.Var.t * reason option
+      ]
+    | `Constant of [
+        | `Ty of Ty.Const.t * reason option
+        | `Cstr of T.Cstr.t * reason option
+        | `Term of T.Const.t * reason option
+        | `Field of T.Field.t * reason option
+      ]
+  ]
+  (** The bindings that can occur. *)
+
+  (* Maps & Hashtbls *)
+  (* ************************************************************************ *)
+
+  module M = Map.Make(Id)
+
+  module E = Map.Make(Ty.Var)
+  module F = Map.Make(T.Var)
+  module R = Map.Make(Ty.Const)
+  module S = Map.Make(T.Const)
+  module U = Map.Make(T.Cstr)
+  module V = Map.Make(T.Field)
+
+  (* Warnings & Errors *)
+  (* ************************************************************************ *)
+
+  (* Fragments of input that represent the sources of warnings/errors *)
+  type _ fragment =
+    | Ast : Ast.t -> Ast.t fragment
+    | Def : Stmt.def -> Stmt.def fragment
+    | Defs : Stmt.defs -> Stmt.defs fragment
+    | Decl : Stmt.decl -> Stmt.decl fragment
+    | Decls : Stmt.decls -> Stmt.decls fragment
+    | Located : Loc.t -> Loc.t fragment
+
+  let decl_loc d =
+    match (d : Stmt.decl) with
+    | Record { loc; _ }
+    | Abstract { loc; _ }
+    | Inductive { loc; _ } -> loc
+
+  (* Warnings *)
+  (* ******** *)
+
+  (* Warnings, parameterized by the type of fragment they can trigger on *)
+  type _ warn = ..
+
+  type _ warn +=
+    | Unused_type_variable : Ty.Var.t -> Ast.t warn
+    (* Unused quantified type variable *)
+    | Unused_term_variable : T.Var.t -> Ast.t warn
+    (* Unused quantified term variable *)
+    | Error_in_attribute : exn -> Ast.t warn
+    (* An error occurred wile parsing an attribute *)
+    | Superfluous_destructor : Id.t * Id.t * T.Const.t -> Ast.t warn
+    (* The user implementation of typed terms returned a destructor where
+       was asked for. This warning can very safely be ignored. *)
+
+  (* Special case for shadowing, as it can happen both from a term but also
+     a declaration, hence why the type variable of [warn] is left wild. *)
+  type _ warn +=
+    | Shadowing : Id.t * binding * binding -> _ warn
+    (* Shadowing of the given identifier, together with the old and current
+       binding. *)
+
+
+  (* Errors *)
+  (* ****** *)
+
+  (* Errors, parameterized by the kind of fragment they can trigger on *)
+  type _ err = ..
+
+  (* Errors that occur on declaration(s) *)
+  type _ err +=
+    | Not_well_founded_datatypes : Stmt.decl list -> Stmt.decls err
+    (* Not well-dounded datatypes definitions. *)
+
+  (* Errors that occur on term fragments, i.e. Ast.t fragments *)
+  type _ err +=
+    | Infer_type_variable : Ast.t err
+    | Expected : string * res option -> Ast.t err
+    | Bad_index_arity : string * int * int -> Ast.t err
+    | Bad_ty_arity : Ty.Const.t * int -> Ast.t err
+    | Bad_op_arity : string * int list * int -> Ast.t err
+    | Bad_cstr_arity : T.Cstr.t * int list * int -> Ast.t err
+    | Bad_term_arity : T.Const.t * int list * int -> Ast.t err
+    | Repeated_record_field : T.Field.t -> Ast.t err
+    | Missing_record_field : T.Field.t -> Ast.t err
+    | Mismatch_record_type : T.Field.t * Ty.Const.t -> Ast.t err
+    | Var_application : T.Var.t -> Ast.t err
+    | Ty_var_application : Ty.Var.t -> Ast.t err
+    | Type_mismatch : T.t * Ty.t -> Ast.t err
+    | Quantified_var_inference : Ast.t err
+    | Unhandled_builtin : Ast.builtin -> Ast.t err
+    | Cannot_tag_tag : Ast.t err
+    | Cannot_tag_ttype : Ast.t err
+    | Cannot_find : Id.t -> Ast.t err
+    | Type_var_in_type_constructor : Ast.t err
+    | Forbidden_quantifier : Ast.t err
+    | Missing_destructor : Id.t -> Ast.t err
+    | Type_def_rec : Stmt.def -> Stmt.defs err
+    | Higher_order_application : Ast.t err
+    | Higher_order_type : Ast.t err
+    | Unbound_variables : Ty.Var.t list * T.Var.t list * T.t -> Ast.t err
+    | Uncaught_exn : exn * Printexc.raw_backtrace -> Ast.t err
+    | Unhandled_ast : Ast.t err
+
+
+  (* State & Environment *)
+  (* ************************************************************************ *)
+
   (* Global, mutable state. *)
   type state = {
-    csts          : cst H.t;    (* association between dolmen ids and
-                                   types/terms constants. *)
-    ttype_locs    : reason R.t; (* stores reasons for typing of type
-                                   constructors *)
-    const_locs    : reason S.t; (* stores reasons for typing of constants *)
-    cstrs_locs    : reason U.t; (* stores reasons for typing constructors *)
-    field_locs    : reason V.t; (* stores reasons for typing record fields *)
+
+    mutable csts : cst M.t;
+    (* association between dolmen ids and types/terms constants. *)
+
+    mutable ttype_locs : reason R.t;
+    (* stores reasons for typing of type constructors *)
+    mutable const_locs : reason S.t;
+    (* stores reasons for typing of constants *)
+    mutable cstrs_locs : reason U.t;
+    (* stores reasons for typing constructors *)
+    mutable field_locs : reason V.t;
+    (* stores reasons for typing record fields *)
   }
 
   (* The local environments used for type-checking. *)
   type env = {
 
+    (* current file *)
+    file : Loc.file;
+
     (* global state *)
     st        : state;
 
@@ -256,128 +261,125 @@ module Make
     type_locs : reason E.t;
     term_locs : reason F.t;
 
-    (* local variables (mostly quantified variables) *)
-    type_vars : Ty.Var.t  M.t;
-    term_vars : T.Var.t   M.t;
+    (* bound variables *)
+    vars : var M.t;
 
     (* The current builtin symbols *)
     builtins : builtin_symbols;
 
+    (* warnings *)
+    warnings : warning -> unit;
+
     (* Additional typing info *)
+    poly         : poly;
+    quants       : bool;
+
     expect       : expect;
-    allow_shadow : bool;
     infer_base   : Ty.t option;
     infer_hook   : env -> inferred -> unit;
+
   }
 
   (* Builtin symbols, i.e symbols understood by some theories,
      but which do not have specific syntax, so end up as special
      cases of application. *)
-  and builtin_symbols = env -> Ast.t -> symbol -> Ast.t list -> res option
+  and builtin_symbols = env -> symbol -> [ builtin_res | not_found ]
 
+  (* Existencial wrapper for wranings. *)
+  and warning =
+    | Warning : env * 'a fragment * 'a warn -> warning
+
+  (* Exitencial wrapper around errors *)
+  and error =
+    | Error : env * 'a fragment * 'a err -> error
+
+  (* Convenient alias *)
   type 'a typer = env -> Ast.t -> 'a
 
+
   (* Exceptions *)
   (* ************************************************************************ *)
 
   (* Internal exception *)
   exception Found of Ast.t * res
 
-  type err = ..
-
-  type err +=
-    | Infer_type_variable
-    | Expected of string * res option
-    | Bad_op_arity of string * int * int
-    | Bad_ty_arity of Ty.Const.t * int
-    | Bad_cstr_arity of T.Cstr.t * int * int
-    | Bad_term_arity of T.Const.t * int * int
-    | Repeated_record_field of T.Field.t
-    | Missing_record_field of T.Field.t
-    | Mismatch_record_type of T.Field.t * Ty.Const.t
-    | Var_application of T.Var.t
-    | Ty_var_application of Ty.Var.t
-    | Type_mismatch of T.t * Ty.t
-    | Quantified_var_inference
-    | Unhandled_builtin of Term.builtin
-    | Cannot_tag_tag
-    | Cannot_tag_ttype
-    | Cannot_find of Id.t
-    | Type_var_in_type_constructor
-    | Missing_destructor of Id.t
-    | Higher_order_application
-    | Higher_order_type
-    | Unbound_variables of Ty.Var.t list * T.Var.t list * T.t
-    | Uncaught_exn of exn
-    | Unhandled_ast
-
   (* Exception for typing errors *)
-  exception Typing_error of err * env * Ast.t
-
-  (** Exception for redefinition/shadowing *)
-  exception Shadowing of
-      (Ty.Const.t, T.Cstr.t, T.Field.t, T.Const.t) binding *
-      (Ty.Const.t, T.Cstr.t, T.Field.t, T.Const.t) binding
-
-  (* Exception for not well-dounded datatypes definitions. *)
-  exception Not_well_founded_datatypes of Dolmen.Statement.decl list
-
-    (* TOOD: uncomment this code
-  (* Creating explanations *)
-  let mk_expl preface env fmt t = ()
-    match env.explain with
-    | `No -> ()
-    | `Yes ->
-      Format.fprintf fmt "%s\n%a" preface (explain ~full:false env) t
-    | `Full ->
-       Format.fprintf fmt "%s\n%a" preface (explain ~full:true env) t
-    *)
+  exception Typing_error of error
+
+
+  (* Warnings/Error helpers *)
+  (* ************************************************************************ *)
+
+  let _warn env fragment w =
+    env.warnings (Warning (env, fragment, w))
+
+  let _error env fragment e =
+    raise (Typing_error (Error (env, fragment, e)))
+
+  let fragment_loc :
+    type a. env -> a fragment -> Loc.full = fun env fg ->
+    let loc =
+      match fg with
+      | Ast { loc; _ } -> loc
+      | Def d -> d.loc
+      | Defs { contents = []; _ } -> Loc.no_loc
+      | Defs { contents = d :: _; _ } -> d.loc
+      | Decl d -> decl_loc d
+      | Decls { contents = []; _ } -> Loc.no_loc
+      | Decls { contents = d :: _; _ } -> decl_loc d
+      | Located l -> l
+    in
+    { file = env.file;
+      loc = loc; }
+
 
   (* Convenience functions *)
-  let _infer_var env t =
-    raise (Typing_error (Infer_type_variable, env, t))
+  (* ************************************************************************ *)
 
   let _expected env s t res =
-    raise (Typing_error (Expected (s, res), env, t))
+    _error env (Ast t) (Expected (s, res))
 
   let _bad_op_arity env s n m t =
-    raise (Typing_error (Bad_op_arity (s, n, m), env, t))
+    _error env (Ast t) (Bad_op_arity (s, [n], m))
 
   let _bad_ty_arity env f n t =
-    raise (Typing_error (Bad_ty_arity (f, n), env, t))
+    _error env (Ast t) (Bad_ty_arity (f, n))
 
-  let _bad_term_arity env f (n1, n2) t =
-    raise (Typing_error (Bad_term_arity (f, n1, n2), env, t))
+  let _bad_term_arity env f expected actual t =
+    _error env (Ast t) (Bad_term_arity (f, expected, actual))
 
-  let _bad_cstr_arity env c (n1, n2) t =
-    raise (Typing_error (Bad_cstr_arity (c, n1, n2), env, t))
+  let _bad_cstr_arity env c expected actual t =
+    _error env (Ast t) (Bad_cstr_arity (c, expected, actual))
 
   let _ty_var_app env v t =
-    raise (Typing_error (Ty_var_application v, env, t))
+    _error env (Ast t) (Ty_var_application v)
 
   let _var_app env v t =
-    raise (Typing_error (Var_application v, env, t))
+    _error env (Ast t) (Var_application v)
 
   let _type_mismatch env t ty ast =
-    raise (Typing_error (Type_mismatch (t, ty), env, ast))
+    _error env (Ast ast) (Type_mismatch (t, ty))
 
   let _record_type_mismatch env f ty_c ast =
-    raise (Typing_error (Mismatch_record_type (f, ty_c), env, ast))
+    _error env (Ast ast) (Mismatch_record_type (f, ty_c))
 
   let _field_repeated env f ast =
-    raise (Typing_error (Repeated_record_field f, env, ast))
+    _error env (Ast ast) (Repeated_record_field f)
 
   let _field_missing env f ast =
-    raise (Typing_error (Missing_record_field f, env, ast))
+    _error env (Ast ast) (Missing_record_field f)
 
   let _cannot_infer_quant_var env t =
-    raise (Typing_error (Quantified_var_inference, env, t))
+    _error env (Ast t) (Quantified_var_inference)
 
   let _unknown_builtin env ast b =
-    raise (Typing_error (Unhandled_builtin b, env, ast))
+    _error env (Ast ast) (Unhandled_builtin b)
 
-  let _uncaught_exn env ast exn =
-    raise (Typing_error (Uncaught_exn exn, env, ast))
+  let _uncaught_exn env ast exn bt =
+    _error env (Ast ast) (Uncaught_exn (exn, bt))
+
+  let _cannot_find env ast s =
+    _error env (Ast ast) (Cannot_find s)
 
   let _wrap env ast f arg =
     try f arg
@@ -393,7 +395,8 @@ module Make
     | (Typing_error _) as exn ->
       raise exn
     | exn ->
-      _uncaught_exn env ast exn
+      let bt = Printexc.get_raw_backtrace () in
+      _uncaught_exn env ast exn bt
 
   let _wrap2 env ast f a b =
     _wrap env ast (fun () -> f a b) ()
@@ -401,78 +404,129 @@ module Make
   let _wrap3 env ast f a b c =
     _wrap env ast (fun () -> f a b c) ()
 
-  (* Global Environment *)
+  (* Binding lookups *)
   (* ************************************************************************ *)
 
-  let new_state () = {
-    csts = H.create ();
-    ttype_locs = R.create 13;
-    const_locs = S.create 4013;
-    cstrs_locs = U.create 13;
-    field_locs = V.create 13;
-  }
+  let find_reason env (v : bound) =
+    try
+      let r =
+        match v with
+        | `Builtin _ -> Builtin
+        | `Ty_var v -> E.find v env.type_locs
+        | `Term_var v -> F.find v env.term_locs
+        | `Letin (_, v, _) -> F.find v env.term_locs
+        | `Ty_cst c -> R.find c env.st.ttype_locs
+        | `Term_cst c -> S.find c env.st.const_locs
+        | `Cstr c -> U.find c env.st.cstrs_locs
+        | `Field f -> V.find f env.st.field_locs
+      in
+      Some r
+    with Not_found -> assert false
 
-  type cst_or_not_found = [
-    | cst
-    | `Not_found
-  ]
+  let with_reason reason bound : binding =
+    match (bound : [ bound | not_found ]) with
+    | `Not_found -> `Not_found
+    | `Builtin `Ttype _ -> `Builtin `Ttype
+    | `Builtin `Ty _ -> `Builtin `Ty
+    | `Builtin `Term _ -> `Builtin `Term
+    | `Builtin `Tags _ -> `Builtin `Tag
+    | `Ty_var v -> `Variable (`Ty (v, reason))
+    | `Term_var v -> `Variable (`Term (v, reason))
+    | `Letin (_, v, _) -> `Variable (`Term (v, reason))
+    | `Ty_cst c -> `Constant (`Ty (c, reason))
+    | `Term_cst c -> `Constant (`Term (c, reason))
+    | `Cstr c -> `Constant (`Cstr (c, reason))
+    | `Field f -> `Constant (`Field (f, reason))
+
+  let binding_reason binding : reason option =
+    match (binding : binding) with
+    | `Not_found -> assert false
+    | `Builtin _ -> Some Builtin
+    | `Variable `Ty (_, reason)
+    | `Variable `Term (_, reason)
+    | `Constant `Ty (_, reason)
+    | `Constant `Term (_, reason)
+    | `Constant `Cstr (_, reason)
+    | `Constant `Field (_, reason)
+      -> reason
+
+  let _shadow env fragment id
+      (old : bound) reason (bound : [< bound]) =
+    let old_binding =
+      with_reason (find_reason env old) (old :> [bound | not_found])
+    in
+    let new_binding = with_reason (Some reason) (bound :> [bound | not_found]) in
+    _warn env fragment (Shadowing (id, old_binding, new_binding))
 
-  let find_global st id =
-    try (H.find st.csts id :> cst_or_not_found)
-    with Not_found -> `Not_found
 
-  let find_reason st v =
-    try match v with
-    | `Not_found -> assert false
-    | `Ty c -> R.find st.ttype_locs c
-    | `Cstr c -> U.find st.cstrs_locs c
-    | `Term c -> S.find st.const_locs c
-    | `Field f -> V.find st.field_locs f
-    with Not_found -> assert false
+  let find_var env name : [var | not_found] =
+    match M.find name env.vars with
+    | #var as res -> res
+    | exception Not_found -> `Not_found
 
-  let with_reason reason = function
+  let find_global env id : [cst | not_found] =
+    try (M.find id env.st.csts :> [cst | not_found])
+    with Not_found -> `Not_found
+
+  let find_builtin env id : [builtin | not_found] =
+    match env.builtins env (Id id) with
     | `Not_found -> `Not_found
-    | `Ty c -> `Ty (c, reason)
-    | `Cstr c -> `Cstr (c, reason)
-    | `Term c -> `Term (c, reason)
-    | `Field f -> `Field (f, reason)
+    | #builtin_res as res -> `Builtin res
 
-  let add_global env id reason v =
-    begin match find_global env.st id with
+  let find_bound env id : [ bound | not_found ] =
+    match find_var env id with
+    | #var as res -> (res :> [ bound | not_found ])
+    | `Not_found ->
+      begin match find_global env id with
+        | #cst as res -> (res :> [ bound | not_found ])
+        | `Not_found ->
+          (find_builtin env id :> [ bound | not_found ])
+      end
+
+
+  (* Global Environment *)
+  (* ************************************************************************ *)
+
+  let new_state () = {
+    csts = M.empty;
+    ttype_locs = R.empty;
+    const_locs = S.empty;
+    cstrs_locs = U.empty;
+    field_locs = V.empty;
+  }
+
+  let copy_state st = {
+    csts = st.csts;
+    ttype_locs = st.ttype_locs;
+    const_locs = st.const_locs;
+    cstrs_locs = st.cstrs_locs;
+    field_locs = st.field_locs;
+  }
+
+
+  let add_global env fragment id reason (v : cst) =
+    begin match find_bound env id with
       | `Not_found -> ()
-      | old ->
-        let old_binding = with_reason (find_reason env.st old) old in
-        let new_binding = with_reason reason v in
-        if env.allow_shadow then
-          W.shadow id old_binding new_binding
-        else
-          raise (Shadowing (old_binding, new_binding))
+      | #bound as old -> _shadow env fragment id old reason v
     end;
-    H.add env.st.csts id v
+    env.st.csts <- M.add id v env.st.csts
 
   (* Symbol declarations *)
-  let decl_ty_const env id c reason =
-    add_global env id reason (`Ty c);
-    R.add env.st.ttype_locs c reason
+  let decl_ty_const env fg id c reason =
+    add_global env fg id reason (`Ty_cst c);
+    env.st.ttype_locs <- R.add c reason env.st.ttype_locs
 
-  let decl_term_const env id c reason =
-    add_global env id reason (`Term c);
-    S.add env.st.const_locs c reason
+  let decl_term_const env fg id c reason =
+    add_global env fg id reason (`Term_cst c);
+    env.st.const_locs <- S.add c reason env.st.const_locs
 
-  let decl_term_cstr env id c reason =
-    add_global env id reason (`Cstr c);
-    U.add env.st.cstrs_locs c reason
+  let decl_term_cstr env fg id c reason =
+    add_global env fg id reason (`Cstr c);
+    env.st.cstrs_locs <- U.add c reason env.st.cstrs_locs
 
-  let decl_term_field env id f reason =
-    add_global env id reason (`Field f);
-    V.add env.st.field_locs f reason
-
-  (* Exported wrappers *)
-  let declare_ty_const env id c loc =
-    decl_ty_const env id c (Declared loc)
-
-  let declare_term_const env id c loc =
-    decl_term_const env id c (Declared loc)
+  let decl_term_field env fg id f reason =
+    add_global env fg id reason (`Field f);
+    env.st.field_locs <- V.add f reason env.st.field_locs
 
 
   (* Local Environment *)
@@ -484,15 +538,17 @@ module Make
   let empty_env
       ?(st=global)
       ?(expect=Nothing)
-      ?(allow_shadow=true)
       ?(infer_hook=(fun _ _ -> ()))
       ?infer_base
+      ?(poly=Flexible)
+      ?(quants=true)
+      ~warnings ~file
       builtins = {
+    file; st; builtins; warnings;
+    poly; quants; expect; infer_hook; infer_base;
+    vars = M.empty;
     type_locs = E.empty;
     term_locs = F.empty;
-    type_vars = M.empty;
-    term_vars = M.empty;
-    st; builtins; expect; allow_shadow; infer_hook; infer_base;
   }
 
   let expect ?(force=false) env expect =
@@ -508,117 +564,136 @@ module Make
   let new_term_name = new_name "term#"
 
   (* Add local variables to environment *)
-  let add_type_var env id v loc =
+  let add_type_var env id v ast =
+    let reason = Bound (env.file, ast) in
     let v' =
-      if M.mem id env.type_vars then
-        Ty.Var.mk (new_ty_name ())
-      else
-        v
+      match find_bound env id with
+      | `Not_found -> v
+      | #bound as old ->
+        let v' = Ty.Var.mk (new_ty_name ()) in
+        _shadow env (Ast ast) id old reason (`Ty_var v');
+        v'
     in
     v', { env with
-          type_vars = M.add id v' env.type_vars;
-          type_locs = E.add v' (Declared loc) env.type_locs;
+          vars = M.add id (`Ty_var v') env.vars;
+          type_locs = E.add v' reason env.type_locs;
         }
 
   let add_type_vars env l =
-    let l', env' = List.fold_left (fun (l, acc) (id, v, loc) ->
-        let v', acc' = add_type_var acc id v loc in
+    let l', env' = List.fold_left (fun (l, acc) (id, v, ast) ->
+        let v', acc' = add_type_var acc id v ast in
         v' :: l, acc') ([], env) l in
     List.rev l', env'
 
-  let add_term_var env id v loc =
+  let add_term_var env id v ast =
+    let reason = Bound (env.file, ast) in
     let v' =
-      if M.mem id env.type_vars then
-        T.Var.mk (new_term_name ()) (T.Var.ty v)
-      else
-        v
+      match find_bound env id with
+      | `Not_found -> v
+      | #bound as old ->
+        let v' = T.Var.mk (new_term_name ()) (T.Var.ty v) in
+        _shadow env (Ast ast) id old reason (`Term_var v');
+        v'
     in
     v', { env with
-          term_vars = M.add id v' env.term_vars;
-          term_locs = F.add v' (Declared loc) env.term_locs;
+          vars = M.add id (`Term_var v') env.vars;
+          term_locs = F.add v' reason env.term_locs;
+        }
+
+  let bind_term_var env id e v t ast =
+    let reason = Bound (env.file, ast) in
+    let v' =
+      match find_bound env id with
+      | `Not_found -> v
+      | #bound as old ->
+        let v' = T.Var.mk (new_term_name ()) (T.Var.ty v) in
+        _shadow env (Ast ast) id old reason (`Term_var v');
+        v'
+    in
+    let t' = T.bind v' t in
+    v', { env with
+          vars = M.add id (`Letin (e, v', t')) env.vars;
+          term_locs = F.add v' reason env.term_locs;
         }
 
-  let find_var env name =
-    try `Ty (M.find name env.type_vars)
-    with Not_found ->
-      begin
-        try
-          `Term (M.find name env.term_vars)
-        with Not_found ->
-          `Not_found
-      end
 
   (* Typo suggestion *)
   (* ************************************************************************ *)
 
   let suggest ~limit env id =
-    M.suggest ~limit id env.type_vars @
-    M.suggest ~limit id env.term_vars @
-    H.suggest ~limit env.st.csts id
+    let automaton = Spelll.of_string ~limit Id.(id.name) in
+    let aux id _ acc =
+      if Spelll.match_with automaton Id.(id.name)
+      then id :: acc
+      else acc
+    in
+    M.fold aux env.st.csts (M.fold aux env.vars [])
+
 
   (* Typing explanation *)
   (* ************************************************************************ *)
 
-  let get_reason_loc = function Inferred l | Declared l -> l
+  let _unused_type env v =
+    match E.find v env.type_locs with
+    (* Variable bound or inferred *)
+    | Bound (_, t) | Inferred (_, t) ->
+      _warn env (Ast t) (Unused_type_variable v)
+    (* variables should not be declare-able nor builtin *)
+    | Builtin | Declared _ | Defined _ ->
+      assert false
+
+  let _unused_term env v =
+    match F.find v env.term_locs with
+    (* Variable bound or inferred *)
+    | Bound (_, t) | Inferred (_, t) ->
+      _warn env (Ast t) (Unused_term_variable v)
+    (* variables should not be declare-able nor builtin *)
+    | Builtin | Declared _ | Defined _ ->
+      assert false
 
-  let _unused_type v env =
-    W.unused_ty_var (get_reason_loc (E.find v env.type_locs)) v
 
-  let _unused_term v env =
-    W.unused_term_var (get_reason_loc (F.find v env.term_locs)) v
+  (* Wrappers for expression building *)
+  (* ************************************************************************ *)
 
-(* TODO: uncomment this code
-  exception Continue of Expr.term list
+  (* unwrap results *)
+  let unwrap_ty env ast = function
+    | Ty ty -> ty
+    | res -> _expected env "type" ast (Some res)
 
-  let pp_reason fmt = function
-    | Inferred loc -> Format.fprintf fmt "inferred at %a" Dolmen.ParseLocation.fmt loc
-    | Declared loc -> Format.fprintf fmt "declared at %a" Dolmen.ParseLocation.fmt loc
+  let unwrap_term env ast = function
+    | Term t -> t
+    | res -> _expected env "term" ast (Some res)
 
-  let rec explain ~full env fmt t =
-    try
-      begin match t with
-        | { Expr.term = Expr.Var v } ->
-          let reason = F.find v env.term_locs in
-          Format.fprintf fmt "%a was %a\n" Expr.Print.id_ty v pp_reason reason
-        | { Expr.term = Expr.Meta m } ->
-          let f = Expr.Meta.def Expr.(m.meta_index) in
-          Format.fprintf fmt "%a was defined by %a\n"
-            Expr.Print.meta m Expr.Print.formula f
-        | { Expr.term = Expr.App (f, _, l) } ->
-          let reason = S.find const_locs f in
-          Format.fprintf fmt "%a was %a\n" Expr.Print.const_ty f pp_reason reason;
-          if full then raise (Continue l)
-      end with
-    | Not_found ->
-      Format.fprintf fmt "Couldn't find a reason..."
-    | Continue l ->
-      List.iter (explain env ~full fmt) l
-*)
+  (* Split arguments of a function/constructor application *)
+  let split_args env n_ty n_t args =
+    let n_args = List.length args in
+    match env.poly with
+    | Explicit ->
+      if n_args = n_ty + n_t then
+        `Ok (Misc.Lists.take_drop n_ty args)
+      else
+        `Bad_arity ([n_ty + n_t], n_args)
+    | Implicit ->
+      if n_args = n_t then
+        `Ok (Misc.Lists.init n_ty (fun _ -> Ast.wildcard ()), args)
+      else
+        `Bad_arity ([n_t], n_args)
+    | Flexible ->
+      if n_args = n_ty + n_t then
+        `Ok (Misc.Lists.take_drop n_ty args)
+      else if n_args = n_t then
+        `Ok (Misc.Lists.init n_ty (fun _ -> Ast.wildcard ()), args)
+      else
+        `Bad_arity ([n_t; n_ty + n_t], n_args)
 
-  (* Wrappers for expression building *)
-  (* ************************************************************************ *)
 
-  (* Wrapper around type application *)
-  let ty_apply env ast f args =
-    if List.length args = Ty.Const.arity f then Ty.apply f args
-    else _bad_ty_arity env f (Ty.Const.arity f) ast
-
-  (* Wrapper around term application. *)
-  let term_apply env ast f ty_args t_args =
-    let n1, n2 = T.Const.arity f in
-    if n1 = List.length ty_args &&
-       n2 = List.length t_args then
-      _wrap3 env ast T.apply f ty_args t_args
-    else
-      _bad_term_arity env f (n1, n2) ast
-
-  let term_apply_cstr env ast c ty_args t_args =
-    let n1, n2 = T.Cstr.arity c in
-    if n1 = List.length ty_args &&
-       n2 = List.length t_args then
-      _wrap3 env ast T.apply_cstr c ty_args t_args
-    else
-      _bad_cstr_arity env c (n1, n2) ast
+  (* wrapper for builtin application *)
+  let builtin_apply env b ast args : res =
+    match (b : builtin_res) with
+    | `Ttype f -> _wrap2 env ast f ast args; Ttype
+    | `Ty f -> Ty (_wrap2 env ast f ast args)
+    | `Term f -> Term (_wrap2 env ast f ast args)
+    | `Tags f -> Tags (_wrap2 env ast f ast args)
 
   (* Wrapper around record creation *)
   let create_record env ast l =
@@ -633,25 +708,33 @@ module Make
   let make_eq env ast_term a b =
     _wrap2 env ast_term T.eq a b
 
+  let ty_var_equal v v' = Ty.Var.compare v v' = 0
+  let t_var_equal v v' = T.Var.compare v v' = 0
+
   let mk_quant env ast mk (ty_vars, t_vars) body =
-    let fv_ty, fv_t = T.fv body in
-    (* Check that all quantified variables are actually used *)
-    List.iter (fun v ->
-        if not @@ List.exists (Ty.Var.equal v) fv_ty then _unused_type v env
-      ) ty_vars;
-    List.iter (fun v ->
-        if not @@ List.exists (T.Var.equal v) fv_t then _unused_term v env
-      ) t_vars;
-    (* Filter quantified variables from free_variables *)
-    let fv_ty = List.filter (fun v ->
-        not (List.exists (Ty.Var.equal v) ty_vars)) fv_ty in
-    let fv_t = List.filter (fun v ->
-        not (List.exists (T.Var.equal v) t_vars)) fv_t in
-    (* Create the quantified formula *)
-    _wrap3 env ast mk (fv_ty, fv_t) (ty_vars, t_vars) body
-
-  let infer env ast s args loc =
-    if Id.(s.ns = Var) then _infer_var env ast;
+    if not env.quants then
+      _error env (Ast ast) Forbidden_quantifier
+    else begin
+      let fv_ty, fv_t = T.fv body in
+      (* Emit warnings for quantified variables that are unused *)
+      List.iter (fun v ->
+          if not @@ List.exists (ty_var_equal v) fv_ty then _unused_type env v
+        ) ty_vars;
+      List.iter (fun v ->
+          if not @@ List.exists (t_var_equal v) fv_t then _unused_term env v
+        ) t_vars;
+      (* Filter quantified variables from free_variables *)
+      let fv_ty = List.filter (fun v ->
+          not (List.exists (ty_var_equal v) ty_vars)) fv_ty in
+      let fv_t = List.filter (fun v ->
+          not (List.exists (t_var_equal v) t_vars)) fv_t in
+      (* Create the quantified formula *)
+      _wrap3 env ast mk (fv_ty, fv_t) (ty_vars, t_vars) body
+    end
+
+  let infer env ast s args s_ast =
+    if Id.(s.ns = Var) then
+      _error env (Ast ast) Infer_type_variable;
     match env.expect, env.infer_base with
     | Nothing, _ -> None
     | Type, _ ->
@@ -659,23 +742,27 @@ module Make
       let ret = Ty.Const.mk (Id.full_name s) n in
       let res = Ty_fun ret in
       env.infer_hook env res;
-      decl_ty_const env s ret (Inferred loc);
+      decl_ty_const env (Ast ast) s ret (Inferred (env.file, s_ast));
       Some res
     | Typed _, None -> None
     | Typed ty, Some base ->
       let n = List.length args in
-      let ret = T.Const.mk (Id.full_name s) [] (replicate n base) ty in
+      let ret = T.Const.mk
+          (Id.full_name s) [] (Misc.Lists.replicate n base) ty
+      in
       let res = Term_fun ret in
       env.infer_hook env res;
-      decl_term_const env s ret (Inferred loc);
+      decl_term_const env (Ast ast) s ret (Inferred (env.file, s_ast));
       Some res
 
+
   (* Tag application *)
   (* ************************************************************************ *)
 
-  let apply_tag env ast tag v = function
-    | Ttype -> raise (Typing_error (Cannot_tag_ttype, env, ast))
-    | Tags _ -> raise (Typing_error (Cannot_tag_tag, env, ast))
+  let apply_tag env ast tag v res =
+    match (res : res) with
+    | Ttype -> _error env (Ast ast) Cannot_tag_ttype
+    | Tags _ -> _error env (Ast ast) Cannot_tag_tag
     | Ty ty -> Ty.tag ty tag v
     | Term t -> T.tag t tag v
 
@@ -690,8 +777,8 @@ module Make
   let expect_prop env =
     expect env (Typed Ty.prop)
 
-  let rec parse_expr (env : env) t =
-    let res = match t with
+  let rec parse_expr (env : env) t : res =
+    let res : res = match t with
 
       (* Ttype & builtin types *)
       | { Ast.term = Ast.Builtin Ast.Ttype; _ } ->
@@ -786,6 +873,10 @@ module Make
       | { Ast.term = Ast.Binder (Ast.Ex, _, _); _ } ->
         parse_quant T.ex Ast.Ex env t [] [] t
 
+      (* Pattern matching *)
+      | { Ast.term = Ast.Match (scrutinee, branches); _ } ->
+        parse_match env t scrutinee branches
+
       (* (Dis)Equality *)
       | { Ast.term = Ast.App ({Ast.term = Ast.Builtin Ast.Eq; _ }, l); _ } as t ->
         begin match l with
@@ -804,17 +895,10 @@ module Make
 
       (* General case: application *)
       | { Ast.term = Ast.Symbol s; _ } as ast ->
-        parse_app env ast s []
-      | { Ast.term = Ast.App ({ Ast.term = Ast.Symbol s; _ }, l); _ } as ast ->
-        parse_app env ast s l
-
-      | { Ast.term = Ast.App ({ Ast.term = Ast.Colon({Ast.term = Ast.Symbol s; _},expected);_}, l); _ } as ast ->
-        let t = match parse_app env ast s l with
-          | Term t -> t
-          | res -> _expected env "term" ast (Some res)
-        in
-        let ty = parse_ty env expected in
-        Term (T.ensure t ty)
+        parse_app env ast s ast []
+      | { Ast.term = Ast.App (
+          { Ast.term = Ast.Symbol s; _ } as s_ast, l); _ } as ast ->
+        parse_app env ast s s_ast l
 
       (* If-then-else *)
       | { Ast.term = Ast.App ({ Ast.term = Ast.Builtin Ast.Ite; _}, l); _ } as ast ->
@@ -845,12 +929,16 @@ module Make
       | { Ast.term = Ast.Colon (a, expected); _ } ->
         parse_ensure env a expected
 
+      (* Sometimes parser creates extra applications *)
+      | { Ast.term = Ast.App (t, []); _ } ->
+        parse_expr env t
+
       (* Explicitly catch higher-order application. *)
       | { Ast.term = Ast.App ({ Ast.term = Ast.App _; _ }, _); _ } as ast ->
-        raise (Typing_error (Higher_order_application, env, ast))
+        _error env (Ast ast) Higher_order_application
 
       (* Other cases *)
-      | ast -> raise (Typing_error (Unhandled_ast, env, ast))
+      | ast -> _error env (Ast ast) Unhandled_ast
     in
     apply_attr env res t t.Ast.attr
 
@@ -875,8 +963,11 @@ module Make
           parse_attrs env ast (l @ acc) r
         | res ->
           _expected env "tag" a (Some res)
-        | exception (Typing_error (_, _, t) as exn) ->
-          W.error_in_attribute (get_loc t) exn;
+        | exception (Typing_error Error (_, Ast t, _) as exn) ->
+          _warn env (Ast t) (Error_in_attribute exn);
+          parse_attrs env ast acc r
+        | exception exn ->
+          _warn env (Ast a) (Error_in_attribute exn);
           parse_attrs env ast acc r
       end
 
@@ -900,10 +991,10 @@ module Make
         fun (l1, l2, acc) v ->
           match parse_var acc v with
           | `Ty (id, v') ->
-            let v'', acc' = add_type_var acc id v' (get_loc v) in
+            let v'', acc' = add_type_var acc id v' v in
             (v'' :: l1, l2, acc')
           | `Term (id, v') ->
-            let v'', acc' = add_term_var acc id v' (get_loc v) in
+            let v'', acc' = add_term_var acc id v' v in
             (l1, v'' :: l2, acc')
       ) ([], [], env) l in
     List.rev ttype_vars, List.rev typed_vars, env'
@@ -917,6 +1008,66 @@ module Make
       let f = mk_quant env ast mk (ttype_acc, ty_acc) body in
       Term f
 
+  and parse_match env ast scrutinee branches =
+    let t = parse_term env scrutinee in
+    let l = List.map (parse_branch (T.ty t) env) branches in
+    Term (_wrap2 env ast T.pattern_match t l)
+
+  and parse_branch ty env (pattern, body) =
+    let p, env = parse_pattern ty env pattern in
+    let b = parse_term env body in
+    (p, b)
+
+  and parse_pattern ty env t =
+    match t with
+    | { Ast.term = Ast.Symbol s; _ } as ast_s ->
+      parse_pattern_app ty env t ast_s s []
+    | { Ast.term = Ast.App (
+        ({ Ast.term = Ast.Symbol s; _ } as ast_s), args); _ } ->
+      parse_pattern_app ty env t ast_s s args
+    | _ -> _expected env "pattern" t None
+
+  and parse_pattern_app ty env ast ast_s s args =
+    match find_bound env s with
+    | `Cstr c -> parse_pattern_app_cstr ty env ast c args
+    | _ ->
+      begin match args with
+        | [] -> parse_pattern_var ty env ast_s s
+        | _ -> _expected env "a variable (or an ADT constructor)" ast_s None
+      end
+
+  and parse_pattern_var ty env ast s =
+    let v = T.Var.mk (Id.full_name s) ty in
+    let v, env = add_term_var env s v ast in
+    T.of_var v, env
+
+  and parse_pattern_app_cstr ty env t c args =
+    (* Inlined version of parse_app_cstr *)
+    let n_ty, n_t = T.Cstr.arity c in
+    let ty_l, t_l =
+      match split_args env n_ty n_t args with
+      | `Ok (l, l') -> l, l'
+      | `Bad_arity (expected, actual) ->
+        _bad_cstr_arity env c expected actual t
+    in
+    (* We can't allow binding new type variables here *)
+    let ty_args = List.map (parse_ty env) ty_l in
+    (* Compute the expected types of arguments *)
+    let ty_arity = _wrap3 env t T.Cstr.pattern_arity c ty ty_args in
+    (* Pattern args are allowed to introduce new variables *)
+    let t_args, env = parse_pattern_app_cstr_args env t_l ty_arity in
+    let res = _wrap3 env t T.apply_cstr c ty_args t_args in
+    res, env
+
+  and parse_pattern_app_cstr_args env args args_ty =
+    let l, env =
+      List.fold_left2 (fun (l, env) arg ty ->
+        let arg, env = parse_pattern ty env arg in
+        (arg :: l, env)
+        ) ([], env) args args_ty
+    in
+    List.rev l, env
+
   and parse_let env acc f = function
     | [] -> (* TODO: use continuation to avoid stack overflow on packs of let-bindings ? *)
       let l = List.rev acc in
@@ -933,7 +1084,7 @@ module Make
                 { Ast.term = Ast.Symbol s; _ } as w; e]); _ } ->
           let t = parse_term env e in
           let v = T.Var.mk (Id.full_name s) (T.ty t) in
-          let v', env' = add_term_var env s v (get_loc w) in
+          let v', env' = bind_term_var env s e v t w in
           parse_let env' ((v', t) :: acc) f r
         | t -> _expected env "variable binding" t None
       end
@@ -942,12 +1093,10 @@ module Make
     match ast with
     | { Ast.term = Ast.Symbol s; _ }
     | { Ast.term = Ast.App ({ Ast.term = Ast.Symbol s; _ }, []); _} ->
-      begin match find_global env.st s with
+      begin match find_bound env s with
         | `Field f -> f
-        | `Not_found ->
-          raise (Typing_error (Cannot_find s, env, ast))
-        | _ ->
-          _expected env "record field" ast None
+        | `Not_found -> _cannot_find env ast s
+        | _ -> _expected env "record field" ast None
       end
     | _ ->
       _expected env "record field name" ast None
@@ -985,71 +1134,63 @@ module Make
     | l ->
       _bad_op_arity env "field record access" 2 (List.length l) ast
 
-  and parse_app env ast s args =
-    match find_var env s with
-    | `Ty v ->
+  and parse_app env ast s s_ast args =
+    match find_bound env s with
+    | `Ty_var v ->
       if args = [] then Ty (Ty.of_var v)
       else _ty_var_app env v ast
-    | `Term v ->
+    | `Term_var v ->
       if args = [] then Term (T.of_var v)
       else _var_app env v ast
+    | `Letin (_, v, t) ->
+      if args = [] then Term t
+      else _var_app env v ast
+    | `Ty_cst f ->
+      parse_app_ty env ast f args
+    | `Term_cst f ->
+      parse_app_term env ast f args
+    | `Cstr c ->
+      parse_app_cstr env ast c args
+    | `Field _f ->
+      _expected env "not a field name" s_ast None
+    | `Builtin b ->
+      builtin_apply env b ast args
     | `Not_found ->
-      begin match find_global env.st s with
-        | `Ty f ->
-          parse_app_ty env ast f args
-        | `Cstr c ->
-          parse_app_cstr env ast c args
-        | `Term f ->
-          parse_app_term env ast f args
-        | `Field _f ->
-          assert false
-        | `Not_found ->
-          begin match env.builtins env ast (Id s) args with
-            | Some res -> res
-            | None ->
-              begin match infer env ast s args (get_loc ast) with
-                | Some Ty_fun f -> parse_app_ty env ast f args
-                | Some Term_fun f -> parse_app_term env ast f args
-                | None ->
-                  W.not_found s (fun limit -> suggest ~limit env s);
-                  raise (Typing_error (Cannot_find s, env, ast))
-              end
-            | exception T.Wrong_type (t, ty) ->
-              _type_mismatch env t ty ast
-            | exception (Typing_error _ as exn) ->
-              raise exn
-            | exception exn ->
-              _uncaught_exn env ast exn
-          end
+      begin match infer env ast s args s_ast with
+        | Some Ty_fun f -> parse_app_ty env ast f args
+        | Some Term_fun f -> parse_app_term env ast f args
+        | None -> _cannot_find env ast s
       end
 
   and parse_app_ty env ast f args =
+    if List.length args <> Ty.Const.arity f then
+      _bad_ty_arity env f (List.length args) ast;
     let l = List.map (parse_ty env) args in
-    Ty (ty_apply env ast f l)
+    Ty (Ty.apply f l)
 
   and parse_app_term env ast f args =
-    let n_args = List.length args in
     let n_ty, n_t = T.Const.arity f in
     let ty_l, t_l =
-      if n_args = n_ty + n_t then take_drop n_ty args
-      else if n_args = n_t then
-        init_list n_ty (fun _ -> Ast.wildcard ()), args
-      else _bad_term_arity env f (n_ty, n_t) ast
+      match split_args env n_ty n_t args with
+      | `Ok (l, l') -> l, l'
+      | `Bad_arity (expected, actual) ->
+        _bad_term_arity env f expected actual ast
     in
     let ty_args = List.map (parse_ty env) ty_l in
     let t_args = List.map (parse_term env) t_l in
-    Term (term_apply env ast f ty_args t_args)
+    Term (_wrap3 env ast T.apply f ty_args t_args)
 
   and parse_app_cstr env ast c args =
-    let n_args = List.length args in
     let n_ty, n_t = T.Cstr.arity c in
     let ty_l, t_l =
-      if n_args = n_ty + n_t then take_drop n_ty args
-      else _bad_cstr_arity env c (n_ty, n_t) ast
+      match split_args env n_ty n_t args with
+      | `Ok (l, l') -> l, l'
+      | `Bad_arity (expected, actual) ->
+        _bad_cstr_arity env c expected actual ast
     in
     let ty_args = List.map (parse_ty env) ty_l in
     let t_args = List.map (parse_term env) t_l in
-    Term (term_apply_cstr env ast c ty_args t_args)
+    Term (_wrap3 env ast T.apply_cstr c ty_args t_args)
 
   and parse_ite env ast = function
     | [c; a; b] ->
@@ -1066,19 +1207,15 @@ module Make
     Term (T.ensure t ty)
 
   and parse_builtin env ast b args =
-    match env.builtins env ast (Builtin b) args with
-    | Some res -> res
-    | None -> _unknown_builtin env ast b
+    match env.builtins env (Builtin b) with
+    | `Not_found -> _unknown_builtin env ast b
+    | #builtin_res as b -> builtin_apply env b ast args
 
   and parse_ty env ast =
-    match parse_expr (expect env Type) ast with
-    | Ty ty -> ty
-    | res -> _expected env "type" ast (Some res)
+    unwrap_ty env ast (parse_expr (expect env Type) ast)
 
   and parse_term env ast =
-    match parse_expr (expect_base env) ast with
-    | Term t -> t
-    | res -> _expected env "term" ast (Some res)
+    unwrap_term env ast (parse_expr (expect_base env) ast)
 
   and parse_prop env ast =
     match parse_expr (expect_prop env) ast with
@@ -1087,7 +1224,7 @@ module Make
 
   let parse_ttype_var env t =
     match parse_var (expect ~force:true env Type) t with
-    | `Ty (id, v) -> (id, v, get_loc t)
+    | `Ty (id, v) -> (id, v, t)
     | `Term (_, v) ->
       _expected env "type variable" t (Some (Term (T.of_var v)))
 
@@ -1109,9 +1246,10 @@ module Make
         | Ttype ->
           begin match ttype_vars with
             | (h, _) :: _ ->
-              raise (Typing_error (Type_var_in_type_constructor, env, h))
+              _error env (Ast h) Type_var_in_type_constructor
             | [] ->
-              let aux n = function
+              let aux n arg =
+                match (arg : _ * res) with
                 | (_, Ttype) -> n + 1
                 | (ast, res) -> raise (Found (ast, res))
               in
@@ -1119,11 +1257,12 @@ module Make
                 match List.fold_left aux 0 ty_args with
                 | n -> `Ty_cstr n
                 | exception Found (err, _) ->
-                  raise (Typing_error (Type_var_in_type_constructor, env, err))
+                  _error env (Ast err) Type_var_in_type_constructor
               end
           end
         | Ty ret ->
-          let aux acc = function
+          let aux acc arg =
+            match (arg : _ * res) with
             | (_, Ty t) -> t :: acc
             | (ast, res) -> raise (Found (ast, res))
           in
@@ -1142,7 +1281,7 @@ module Make
     | { Ast.term = Ast.App ({ Ast.term = Ast.Builtin Ast.Product; _}, l); _ } ->
       List.flatten @@ List.map (parse_sig_arg env) l
     | { Ast.term = Ast.Binder (Ast.Arrow, _, _); _ } as ast ->
-      raise (Typing_error (Higher_order_type, env, ast))
+      _error env (Ast ast) Higher_order_type
     | t ->
       [t, parse_expr env t]
 
@@ -1174,7 +1313,7 @@ module Make
   (* ************************************************************************ *)
 
   let decl_id t =
-    match (t : Statement.decl) with
+    match (t : Stmt.decl) with
     | Abstract { id; _ }
     | Record { id; _ }
     | Inductive { id; _ } -> id
@@ -1190,7 +1329,7 @@ module Make
     with Exit -> true
 
   let well_founded_aux l t =
-    match (t : Statement.decl) with
+    match (t : Stmt.decl) with
     | Abstract _ -> true
     | Inductive { cstrs; _ } ->
       List.exists (fun (_, args) ->
@@ -1207,8 +1346,8 @@ module Make
             ) l)
         ) fields
 
-  let rec check_well_founded l =
-    match (l : Statement.decl list) with
+  let rec check_well_founded env d l =
+    match (l : Stmt.decl list) with
     | [] -> ()
     | _ ->
       let has_progressed = ref false in
@@ -1218,12 +1357,11 @@ module Make
           not b
         ) l in
       if !has_progressed then
-        check_well_founded l'
+        check_well_founded env d l'
       else
-        raise (Not_well_founded_datatypes l')
+        _error env (Decls d) (Not_well_founded_datatypes l')
 
-  let record env ty_cst { Statement.vars; fields; loc; _ } =
-    let loc = or_default_loc loc in
+  let record env d ty_cst { Stmt.vars; fields; _ } =
     let ttype_vars = List.map (parse_ttype_var env) vars in
     let ty_vars, env = add_type_vars env ttype_vars in
     let l = List.map (fun (id, t) ->
@@ -1232,11 +1370,10 @@ module Make
       ) fields in
     let field_list = T.define_record ty_cst ty_vars l in
     List.iter2 (fun (id, _) field ->
-        decl_term_field env id field (Declared loc)
+        decl_term_field env (Decl d) id field (Declared (env.file, d))
       ) fields field_list
 
-  let inductive env ty_cst { Statement.id; vars; cstrs; loc; _ } =
-    let loc = or_default_loc loc in
+  let inductive env d ty_cst { Stmt.id; vars; cstrs; _ } =
     (* Parse the type variables *)
     let ttype_vars = List.map (parse_ttype_var env) vars in
     let ty_vars, env = add_type_vars env ttype_vars in
@@ -1250,7 +1387,7 @@ module Make
     (* Constructors with strings for names *)
     let cstrs_with_strings = List.map (fun (id, args) ->
         Id.full_name id, List.map (fun (_, ty, dstr) ->
-            ty, option_map Id.full_name dstr
+            ty, Misc.Options.map Id.full_name dstr
           ) args
       ) cstrs_with_ids in
     (* Call the T module to define the adt and get the typed constructors
@@ -1258,83 +1395,126 @@ module Make
     let defined_cstrs = T.define_adt ty_cst ty_vars cstrs_with_strings in
     (* Register the constructors and destructors in the global env. *)
     List.iter2 (fun (cid, pargs) (c, targs) ->
-        let reason = Declared loc in
-        decl_term_cstr env cid c reason;
+        decl_term_cstr env (Decl d) cid c (Declared (env.file, d));
         List.iter2 (fun (t, _, dstr) (_, o) ->
             match dstr, o with
             | None, None -> ()
-            | None, Some c -> W.superfluous_destructor loc id cid c
-            | Some id, Some const -> decl_term_const env id const reason
+            | None, Some c ->
+              _warn env (Ast t) (Superfluous_destructor (id, cid, c))
+            | Some id, Some const ->
+              decl_term_const env (Decl d) id const (Declared (env.file, d))
             | Some id, None ->
-              raise (Typing_error (Missing_destructor id, env, t))
+              _error env (Ast t) (Missing_destructor id)
           ) pargs targs
       ) cstrs_with_ids defined_cstrs
 
-  let decl env cst t =
-    match cst, (t : Statement.decl) with
+  let define_decl env (_, cst) t =
+    match cst, (t : Stmt.decl) with
     | _, Abstract _ -> ()
     | `Term_decl _, Inductive _ -> assert false
-    | `Type_decl c, Inductive i -> inductive env c i
+    | `Type_decl c, Inductive i -> inductive env t c i
     | `Term_decl _, Record _ -> assert false
-    | `Type_decl c, Record r -> record env c r
+    | `Type_decl c, Record r -> record env t c r
 
-  let decls env ?attr l =
+  let parse_decl env tags (t : Stmt.decl) =
+    match t with
+    | Abstract { id; ty; _ } ->
+      begin match parse_sig env ty with
+        | `Ty_cstr n ->
+          let c = Ty.Const.mk (Id.full_name id) n in
+          List.iter (fun (Any (tag, v)) -> Ty.Const.tag c tag v) tags;
+          id, `Type_decl c
+        | `Fun_ty (vars, args, ret) ->
+          let f = T.Const.mk (Id.full_name id) vars args ret in
+          List.iter (fun (Any (tag, v)) -> T.Const.tag f tag v) tags;
+          id, `Term_decl f
+      end
+    | Record { id; vars; _ }
+    | Inductive { id; vars; _ } ->
+      let n = List.length vars in
+      let c = Ty.Const.mk (Id.full_name id) n in
+      List.iter (fun (Any (tag, v)) -> Ty.Const.tag c tag v) tags;
+      id, `Type_decl c
+
+  let record_decl env (id, tdecl) (t : Stmt.decl) =
+    match tdecl with
+    | `Type_decl c -> decl_ty_const env (Decl t) id c (Declared (env.file, t))
+    | `Term_decl f -> decl_term_const env (Decl t) id f (Declared (env.file, t))
+
+  let decls env ?attr (d: Stmt.decl Stmt.group) =
     let tags = match attr with
       | None -> []
       | Some a -> parse_attr_and env a
     in
-    (* Check well-foundedness *)
-    check_well_founded l;
-    (* First create (in the global env) the type const for each adt *)
-    let l_decl = List.map (fun (t : Statement.decl) ->
-        match t with
-        | Abstract { id; ty; loc; } ->
-          begin match parse_sig env ty with
-            | `Ty_cstr n ->
-              let c = Ty.Const.mk (Id.full_name id) n in
-              List.iter (fun (Any (tag, v)) -> Ty.Const.tag c tag v) tags;
-              decl_ty_const env id c (Declared (or_default_loc loc));
-              `Type_decl c
-            | `Fun_ty (vars, args, ret) ->
-              let f = T.Const.mk (Id.full_name id) vars args ret in
-              List.iter (fun (Any (tag, v)) -> T.Const.tag f tag v) tags;
-              decl_term_const env id f (Declared (or_default_loc loc));
-              `Term_decl f
-          end
-        | Record { id; vars; loc; _ }
-        | Inductive { id; vars; loc; _ } ->
-          let n = List.length vars in
-          let c = Ty.Const.mk (Id.full_name id) n in
-          List.iter (fun (Any (tag, v)) -> Ty.Const.tag c tag v) tags;
-          decl_ty_const env id c (Declared (or_default_loc loc));
-          `Type_decl c
-      ) l in
-    (* Parse each definition
-       TODO: parse (and thus define them with T) in the topological order
+    if d.recursive then begin
+      (* Check well-foundedness *)
+      check_well_founded env d d.contents;
+      (* First pre-parse all definitions and generate the typed symbols for them *)
+      let parsed = List.map (parse_decl env tags) d.contents in
+      (* Then, since the decls are recursive, register in the global env the type
+         const for each decl before fully parsing and defining them. *)
+      let () = List.iter2 (record_decl env) parsed d.contents in
+      (* Then parse the complete type definition and define them.
+         TODO: parse (and thus define them with T) in the topological order
              defined by the well-founded check ? *)
-    List.iter2 (decl env) l_decl l;
-    (* Return the defined types *)
-    l_decl
-
-  (* High-level parsing functions *)
+      List.iter2 (define_decl env) parsed d.contents;
+      (* Return the defined types *)
+      List.map snd parsed
+    end else begin
+      List.map (fun t ->
+          (* First pre-parse all definitions and generate the typed symbols for them *)
+          let parsed = parse_decl env tags t in
+          (* Then parse the complete type definition and define them. *)
+          let () = define_decl env parsed t in
+          (* Finally record them in the state *)
+          let () = record_decl env parsed t in
+          (* return *)
+          snd parsed
+        ) d.contents
+    end
+
+  (* Definitions *)
   (* ************************************************************************ *)
 
-  let new_def env t ?attr id =
+  let parse_def_sig env tags (d: Stmt.def) =
+    parse_decl env tags (Abstract { id = d.id; ty = d.ty; loc = d.loc; })
+
+  let record_def d env (id, tdecl) (t : Stmt.def) =
+    match tdecl with
+    | `Type_decl _ -> _error env (Defs d) (Type_def_rec t)
+    | `Term_decl f -> decl_term_const env (Def t) id f (Defined (env.file, t))
+
+  let parse_def env (_, ssig) (d : Stmt.def) =
+    match ssig, parse_fun [] [] env d.body with
+    | `Type_decl c, `Ty (ty_args, body) ->
+      `Type_def (d.id, c, ty_args, body)
+    | `Term_decl f, `Term (ty_args, t_args, body) ->
+      `Term_def (d.id, f, ty_args, t_args, body)
+    | `Term_decl _, `Ty _ -> assert false
+    | `Type_decl _, `Term _ -> assert false
+
+  let defs env ?attr (d : Stmt.defs) =
     let tags = match attr with
       | None -> []
       | Some a -> parse_attr_and env a
     in
-    match parse_fun [] [] env t with
-    | `Ty (ty_args, body) ->
-      `Type_def (id, tags, ty_args, body)
-    | `Term (ty_args, t_args, body) ->
-      `Term_def (id, tags, ty_args, t_args, body)
+    if d.recursive then begin
+      let sigs = List.map (parse_def_sig env tags) d.contents in
+      let () = List.iter2 (record_def d env) sigs d.contents in
+      List.map2 (parse_def env) sigs d.contents
+    end else begin
+      List.map (fun t ->
+          parse_def env (parse_def_sig env tags t) t
+        ) d.contents
+    end
+
+  (* High-level parsing function *)
+  (* ************************************************************************ *)
 
   let parse env ast =
     let res = parse_prop env ast in
     match T.fv res with
     | [], [] -> res
-    | tys, ts ->
-      raise (Typing_error (Unbound_variables (tys, ts, res), env, ast))
+    | tys, ts -> _error env (Ast ast) (Unbound_variables (tys, ts, res))
 
 end
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/tff.mli b/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/tff.mli
index fffc2fe74448f0ba4e5668d81944790dd052417a..73756a7ca94a0ae614453cb71cb3d44b04c2e51e 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/tff.mli
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/tff.mli
@@ -6,66 +6,15 @@
 module type S = Tff_intf.S
 (** Typechecker external interface *)
 
-type reason = Tff_intf.reason =
-  | Inferred of Dolmen.ParseLocation.t
-  | Declared of Dolmen.ParseLocation.t (**)
-(** The type of reasons for constant typing *)
-
-type ('ty_const, 'term_cstr, 'term_field, 'term_const) binding = [
-  | ('ty_const, 'term_cstr, 'term_field, 'term_const) Tff_intf.binding
-]
-(** The bindings that can occur inside the typechecker. *)
-
-(** Module type to define various warning functions that may
-    be called during typechecking. *)
-module type Warn = sig
-
-  type ty
-  type ty_var
-  type ty_const
-
-  type term
-  type term_var
-  type term_cstr
-  type term_const
-  type term_field
-
-  val shadow : Dolmen.Id.t ->
-    (ty_const, term_cstr, term_field, term_const) binding ->
-    (ty_const, term_cstr, term_field, term_const) binding ->
-    unit
-
-  val unused_ty_var : Dolmen.ParseLocation.t -> ty_var -> unit
-  val unused_term_var : Dolmen.ParseLocation.t -> term_var -> unit
-
-  val error_in_attribute : Dolmen.ParseLocation.t -> exn -> unit
-
-  val not_found : Dolmen.Id.t -> (int -> Dolmen.Id.t list) -> unit
-
-  val superfluous_destructor :
-    Dolmen.ParseLocation.t -> Dolmen.Id.t -> Dolmen.Id.t -> term_const -> unit
-
-end
-
 module Make
-    (Tag: Dolmen_intf.Tag.S)
-    (Ty: Dolmen_intf.Type.Tff
+    (Tag: Dolmen.Intf.Tag.S)
+    (Ty: Dolmen.Intf.Ty.Tff
      with type 'a tag := 'a Tag.t)
-    (T: Dolmen_intf.Term.Tff
+    (T: Dolmen.Intf.Term.Tff
      with type ty := Ty.t
       and type ty_var := Ty.Var.t
       and type ty_const := Ty.Const.t
       and type 'a tag := 'a Tag.t)
-    (W : Warn
-     with type ty := Ty.t
-      and type ty_var := Ty.Var.t
-      and type ty_const := Ty.Const.t
-      and type term := T.t
-      and type term_var := T.Var.t
-      and type term_cstr := T.Cstr.t
-      and type term_const := T.Const.t
-      and type term_field := T.Field.t
-    )
   : S with module Tag = Tag
        and module Ty = Ty
        and module T = T
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/tff_intf.ml b/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/tff_intf.ml
index 46f7d2e87bb925fcd04a085973c767fcc0adf641..86fbd96e34c87e452170cd20bcc6e7ea5a91cb75 100644
--- a/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/tff_intf.ml
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/src/typecheck/tff_intf.ml
@@ -6,33 +6,16 @@
     This module defines the external typechcker interface, that is,
     the interface of an instantiated typechecker. *)
 
-(** {1 Useful types} *)
-
-type reason =
-  | Inferred of Dolmen.ParseLocation.t
-  | Declared of Dolmen.ParseLocation.t (**)
-(** The type of reasons for constant typing *)
-
-type ('ty_const, 'term_cstr, 'term_field, 'term_const) binding = [
-  | `Not_found
-  | `Ty of 'ty_const * reason
-  | `Cstr of 'term_cstr * reason
-  | `Term of 'term_const * reason
-  | `Field of 'term_field * reason
-]
-(** The bindings that can occur inside the typechecker. *)
-
-
 (** {1 Typechecker interface} *)
 
 (** Typechecker interface *)
 module type S = sig
 
   (** {2 Module aliases} *)
-  module Tag: Dolmen_intf.Tag.S
-  module Ty: Dolmen_intf.Type.Tff
+  module Tag: Dolmen.Intf.Tag.S
+  module Ty: Dolmen.Intf.Ty.Tff
     with type 'a tag := 'a Tag.t
-  module T: Dolmen_intf.Term.Tff
+  module T: Dolmen.Intf.Term.Tff
     with type ty := Ty.t
      and type ty_var := Ty.Var.t
      and type ty_const := Ty.Const.t
@@ -40,11 +23,19 @@ module type S = sig
 
   (** {2 Type definitions} *)
 
-  type state
-  (** The type of mutable state for typechecking. *)
-
-  type env
-  (** The type of environments for typechecking. *)
+  type poly =
+    | Explicit
+    (** Type arguments must be explicitly given in funciton applications *)
+    | Implicit
+    (** Type arguments are not given in funciton applications, and instead
+        type annotations/coercions are used to disambiguate applications
+        of polymorphic symbols. *)
+    | Flexible
+    (** Mix between explicit and implicit: depending on the arity of a
+        symbol and the number of arguments provided, either the provided
+        type arguments are used, or wildcards are generated for all of them,
+        and later instantiated when needed. *)
+  (** The various polymorphism mode for the typechecker *)
 
   type expect =
     | Nothing
@@ -57,88 +48,256 @@ module type S = sig
   (** Existencial wrapper around tags *)
 
   type res =
-    | Ttype   : res
-    | Ty      : Ty.t -> res
-    | Term    : T.t -> res
-    | Tags    : tag list -> res (**)
+    | Ttype
+    | Ty    of Ty.t
+    | Term  of T.t
+    | Tags  of tag list (**)
   (** The results of parsing an untyped term.  *)
 
+  type builtin_res = [
+    | `Ttype of (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> unit)
+    | `Ty    of (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> Ty.t)
+    | `Term  of (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> T.t)
+    | `Tags  of (Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> tag list)
+  ]
+  (** The result of parsing a symbol by the theory *)
+
+  type not_found = [ `Not_found ]
+  (** Not bound bindings *)
+
+  type var = [
+    | `Ty_var of Ty.Var.t
+    | `Term_var of T.Var.t
+    | `Letin of Dolmen.Std.Term.t * T.Var.t * T.t
+  ]
+  (** Variable bindings *)
+
+  type cst = [
+    | `Cstr of T.Cstr.t
+    | `Field of T.Field.t
+    | `Ty_cst of Ty.Const.t
+    | `Term_cst of T.Const.t
+  ]
+  (** Constant bindings *)
+
+  type builtin = [
+    | `Builtin of builtin_res
+  ]
+  (** Builtin binding *)
+
+  type bound = [ var | cst | builtin ]
+  (* All internal bindings *)
+
   type inferred =
     | Ty_fun of Ty.Const.t
-    | Term_fun of T.Const.t
-    (** The type for inferred symbols. *)
-
-  type err = ..
-
-  type err +=
-    | Infer_type_variable
-    | Expected of string * res option
-    | Bad_op_arity of string * int * int
-    | Bad_ty_arity of Ty.Const.t * int
-    | Bad_cstr_arity of T.Cstr.t * int * int
-    | Bad_term_arity of T.Const.t * int * int
-    | Repeated_record_field of T.Field.t
-    | Missing_record_field of T.Field.t
-    | Mismatch_record_type of T.Field.t * Ty.Const.t
-    | Var_application of T.Var.t
-    | Ty_var_application of Ty.Var.t
-    | Type_mismatch of T.t * Ty.t
-    | Quantified_var_inference
-    | Unhandled_builtin of Dolmen.Term.builtin
-    | Cannot_tag_tag
-    | Cannot_tag_ttype
-    | Cannot_find of Dolmen.Id.t
-    | Type_var_in_type_constructor
-    | Missing_destructor of Dolmen.Id.t
-    | Higher_order_application
-    | Higher_order_type
-    | Unbound_variables of Ty.Var.t list * T.Var.t list * T.t
-    | Uncaught_exn of exn
-    | Unhandled_ast (**)
-  (** The list of potential errors that can arise during typechecking. *)
-
-  exception Typing_error of err * env * Dolmen.Term.t
-  (** Exception raised when a typing error is encountered. *)
-
-  exception Shadowing of
-      (Ty.Const.t, T.Cstr.t, T.Field.t, T.Const.t) binding *
-      (Ty.Const.t, T.Cstr.t, T.Field.t, T.Const.t) binding
-  (** Exception raised upon redefinition of symbols/constants
-      when it is not allowed by the env. *)
-
-  exception Not_well_founded_datatypes of Dolmen.Statement.decl list
-  (** Exception raised when a list of inductive datatypes could not be proved to
-      be well-founded. *)
-
-  type 'a typer = env -> Dolmen.Term.t -> 'a
+    | Term_fun of T.Const.t (**)
+  (** The type for inferred symbols. *)
+
+  type reason =
+    | Builtin
+    | Bound of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
+    | Inferred of Dolmen.Std.Loc.file * Dolmen.Std.Term.t
+    | Defined of Dolmen.Std.Loc.file * Dolmen.Std.Statement.def
+    | Declared of Dolmen.Std.Loc.file * Dolmen.Std.Statement.decl
+  (** The type of reasons for constant typing *)
+
+  type binding = [
+    | `Not_found
+    | `Builtin of [
+        | `Ttype
+        | `Ty
+        | `Term
+        | `Tag
+      ]
+    | `Variable of [
+        | `Ty of Ty.Var.t * reason option
+        | `Term of T.Var.t * reason option
+      ]
+    | `Constant of [
+        | `Ty of Ty.Const.t * reason option
+        | `Cstr of T.Cstr.t * reason option
+        | `Term of T.Const.t * reason option
+        | `Field of T.Field.t * reason option
+      ]
+  ]
+  (** The bindings that can occur. *)
+
+
+  (** {2 Errors and warnings} *)
+
+  type _ fragment =
+    | Ast : Dolmen.Std.Term.t -> Dolmen.Std.Term.t fragment
+    | Def : Dolmen.Std.Statement.def -> Dolmen.Std.Statement.def fragment
+    | Defs : Dolmen.Std.Statement.defs -> Dolmen.Std.Statement.defs fragment
+    | Decl : Dolmen.Std.Statement.decl -> Dolmen.Std.Statement.decl fragment
+    | Decls : Dolmen.Std.Statement.decls -> Dolmen.Std.Statement.decls fragment
+    | Located : Dolmen.Std.Loc.t -> Dolmen.Std.Loc.t fragment (**)
+  (** Fragments of input that represent the sources of warnings/errors *)
+
+  type _ warn = ..
+  (** The type of warnings, parameterized by the type of fragment they can
+      trigger on *)
+
+  type _ warn +=
+    | Unused_type_variable : Ty.Var.t -> Dolmen.Std.Term.t warn
+    (** Unused quantified type variable *)
+    | Unused_term_variable : T.Var.t -> Dolmen.Std.Term.t warn
+    (** Unused quantified term variable *)
+    | Error_in_attribute : exn -> Dolmen.Std.Term.t warn
+    (** An error occurred wile parsing an attribute *)
+    | Superfluous_destructor :
+        Dolmen.Std.Id.t * Dolmen.Std.Id.t * T.Const.t -> Dolmen.Std.Term.t warn
+    (** The user implementation of typed terms returned a destructor where
+        was asked for. This warning can very safely be ignored. *)
+  (** Warnings that cna trigger on regular parsed terms. *)
+
+  type _ warn +=
+    | Shadowing : Dolmen.Std.Id.t * binding * binding -> _ warn
+    (** Shadowing of the given identifier,
+        together with the old and current binding. *)
+  (** Special case of warnings for shadowing, as it can happen both from a
+      term but also a declaration, hence why the type variable of [warn] is
+      left wild. *)
+
+  type _ err = ..
+  (** The type of errors, parameterized by the type of fragment they can
+      trigger on *)
+
+  type _ err +=
+    | Not_well_founded_datatypes :
+        Dolmen.Std.Statement.decl list -> Dolmen.Std.Statement.decls err
+    (** Not well-dounded datatypes definitions. *)
+  (** Errors that occur on declaration(s) *)
+
+  type _ err +=
+    | Infer_type_variable : Dolmen.Std.Term.t err
+    (** The type of a bound variable had to be inferred which is forbidden. *)
+    | Expected : string * res option -> Dolmen.Std.Term.t err
+    (** The parsed term didn't match the expected shape *)
+    | Bad_index_arity : string * int * int -> Dolmen.Std.Term.t err
+    (** [Bad_index_arity (name, expected, actual)] denotes an error where
+        an indexed family of operators (based on [name]) expect to be indexed
+        by [expected] arguments but got [actual] instead. *)
+    | Bad_ty_arity : Ty.Const.t * int -> Dolmen.Std.Term.t err
+    (** [Bad_ty_arity (cst, actual)] denotes a type constant that was applied
+        to [actual] arguments, but which has a different arity (which should
+        be accessible by getting its type/sort/arity). *)
+    | Bad_op_arity : string * int list * int -> Dolmen.Std.Term.t err
+    (** [Bad_op_arity (name, expected, actual)] denotes a named operator
+        (which may be a builtin operator, a top-level defined constant which
+        is being subtituted, etc...) expecting a number of arguments among
+        the [expected] list, but instead got [actual] number of arguments. *)
+    | Bad_cstr_arity : T.Cstr.t * int list * int -> Dolmen.Std.Term.t err
+    (** [Bad_cstr_arity (cstr, expected, actual)] denotes an ADT constructor,
+        which was expecting one of [expected] arguments, but which was applied
+        to [actual] arguments. *)
+    | Bad_term_arity : T.Const.t * int list * int -> Dolmen.Std.Term.t err
+    (** [Bad_term_arity (func, expected, actual)] denotes a funciton symbol,
+        which was expecting one of [expected] arguments, but which was applied
+        to [actual] arguments. *)
+    | Repeated_record_field : T.Field.t -> Dolmen.Std.Term.t err
+    (** [Repeated_record_field f] denotes an error within an expression
+        that builds a record by giving values to all fields, but where the
+        field [f] appears more than once. *)
+    | Missing_record_field : T.Field.t -> Dolmen.Std.Term.t err
+    (** [Missing_record_field f] denotes an error within an expression
+        that builds a record by giving values to all fields, but where the
+        field [f] does not appear. *)
+    | Mismatch_record_type : T.Field.t * Ty.Const.t -> Dolmen.Std.Term.t err
+    (** [Mismatch_record_type (f, r)] denotes an error where while building
+        a record expression for a record of type [c], a field [f] belonging
+        to another record type was used. *)
+    | Var_application : T.Var.t -> Dolmen.Std.Term.t err
+    (** [Var_application v] denotes a variable which was applied to other
+        terms, which is forbidden in first-order formulas. *)
+    | Ty_var_application : Ty.Var.t -> Dolmen.Std.Term.t err
+    (** [Ty_var_application v] denotes a type variable which was applied to
+        other terms, which is forbidden in first-order formulas. *)
+    | Type_mismatch : T.t * Ty.t -> Dolmen.Std.Term.t err
+    (** *)
+    | Quantified_var_inference : Dolmen.Std.Term.t err
+    (** Quantified variable without a type *)
+    | Unhandled_builtin : Dolmen.Std.Term.builtin -> Dolmen.Std.Term.t err
+    (** *)
+    | Cannot_tag_tag : Dolmen.Std.Term.t err
+    (** *)
+    | Cannot_tag_ttype : Dolmen.Std.Term.t err
+    (** *)
+    | Cannot_find : Dolmen.Std.Id.t -> Dolmen.Std.Term.t err
+    (** *)
+    | Type_var_in_type_constructor : Dolmen.Std.Term.t err
+    (** *)
+    | Forbidden_quantifier : Dolmen.Std.Term.t err
+    (** *)
+    | Missing_destructor : Dolmen.Std.Id.t -> Dolmen.Std.Term.t err
+    (** *)
+    | Type_def_rec : Dolmen.Std.Statement.def -> Dolmen.Std.Statement.defs err
+    (** *)
+    | Higher_order_application : Dolmen.Std.Term.t err
+    (** *)
+    | Higher_order_type : Dolmen.Std.Term.t err
+    (** *)
+    | Unbound_variables : Ty.Var.t list * T.Var.t list * T.t -> Dolmen.Std.Term.t err
+    (** *)
+    | Uncaught_exn : exn * Printexc.raw_backtrace -> Dolmen.Std.Term.t err
+    (** *)
+    | Unhandled_ast : Dolmen.Std.Term.t err
+    (** *)
+  (** Errors that occur on regular parsed terms. *)
+
+
+  (** {2 Global State} *)
+
+  type state
+  (** The type of mutable state for typechecking. *)
+
+  val new_state : unit -> state
+  (** Create a new state. *)
+
+  val copy_state : state -> state
+  (** Make a copy of the global state included in the env *)
+
+
+  (** {2 Typing Environment} *)
+
+  type env
+  (** The type of environments for typechecking. *)
+
+  type 'a typer = env -> Dolmen.Std.Term.t -> 'a
   (** A general type for typers. Takes a local environment and the current untyped term,
       and return a value. The typer may need additional information for parsing,
       in which case the return value will be a function.
       @raise Typing_error *)
 
   type symbol =
-    | Id of Dolmen.Id.t
-    | Builtin of Dolmen.Term.builtin
+    | Id of Dolmen.Std.Id.t
+    | Builtin of Dolmen.Std.Term.builtin
     (** Wrapper around potential function symbols from the Dolmen AST. *)
 
-  type builtin_symbols = (symbol -> Dolmen.Term.t list -> res option) typer
-  (** The type of a typer for builtin symbols. Takes the name of the symbol and the arguments
-      applied to it, and can return a typechecking result.
-      Can be useful for extensions to define overloaded operators such as addition in arithmetic,
-      since the exact function symbol returned can depend on the arguments (or even be different
-      between two calls with the same arguments). *)
+  type builtin_symbols = env -> symbol -> [ builtin_res | not_found ]
+  (** The type of a typer for builtin symbols. Given the environment and a symbol,
+      the theory should return a typing function if the symbol belongs to the
+      theory. This typing function takes first the ast term of the whole
+      application that is beign typechecked, and the list of arguments to the
+      symbol. *)
 
-  (** {2 Environments} *)
+  type warning =
+    | Warning : env * 'a fragment * 'a warn -> warning (**)
+  (** Existential wrapper around warnings *)
 
-  val new_state : unit -> state
-  (** Create a new state. *)
+  type error =
+    | Error : env * 'a fragment * 'a err -> error (**)
+  (** Existential wrapper around errors *)
+
+  exception Typing_error of error
+  (** Exception for typing errors *)
 
   val empty_env :
-    ?st:state ->
-    ?expect:expect ->
-    ?allow_shadow:bool ->
+    ?st:state -> ?expect:expect ->
     ?infer_hook:(env -> inferred -> unit) ->
-    ?infer_base:Ty.t ->
+    ?infer_base:Ty.t -> ?poly:poly -> ?quants:bool ->
+    warnings:(warning -> unit) ->
+    file:Dolmen.Std.Loc.file ->
     builtin_symbols -> env
   (** Create a new environment. *)
 
@@ -146,29 +305,45 @@ module type S = sig
   (** Returns the same environment but with the given expectation,
       except if the environnement already except [Nothing]. *)
 
-  val find_var :
-    env -> Dolmen.Id.t ->
-    [ `Not_found
-    | `Ty of Ty.Var.t
-    | `Term of T.Var.t ]
-  (** Lookup a variable in an environment. *)
 
-  val declare_ty_const :
-    env -> Dolmen.Id.t -> Ty.Const.t -> Dolmen.ParseLocation.t -> unit
-  (** Declare a new type constant. *)
+  (** {2 Location helpers} *)
+
+  val fragment_loc : env -> _ fragment -> Dolmen.Std.Loc.full
+  (** Convenient function to get the location of a fragment. *)
+
+  val binding_reason : binding -> reason option
+  (** Extract the reason from a binding
+      @raise Invalid_argument if the binding is [`Not_found] *)
+
 
-  val declare_term_const :
-    env -> Dolmen.Id.t -> T.Const.t -> Dolmen.ParseLocation.t -> unit
-  (** Declare a new term constant. *)
+  (** {2 Builtin helpers} *)
 
+  val find_var : env -> Dolmen.Std.Id.t -> [ var | not_found ]
+  (** Try and find the given id in the set of locally bound variables. *)
 
-  (** {2 Parsing helpers} *)
+  val find_global : env -> Dolmen.Std.Id.t -> [ cst | not_found ]
+  (** Try and find the given id in the set of globally bound constants. *)
 
-  val ty_apply :
-    (Ty.Const.t -> Ty.t list -> Ty.t) typer
-  val term_apply :
-    (T.Const.t -> Ty.t list -> T.t list -> T.t) typer
-  (** Wrappers for making applications, so that it raises the right exceptions. *)
+  val find_builtin : env -> Dolmen.Std.Id.t -> [ builtin | not_found ]
+  (** Try and find the given id in the set of bound builtin symbols. *)
+
+  val find_bound : env -> Dolmen.Std.Id.t -> [ bound | not_found ]
+  (** Try and find a bound identifier in the env, whetehr it be locally bound
+      (such as bound variables), constants bound at top-level, or builtin
+      symbols bound by the builtin theory. *)
+
+
+  (** {2 Errors & Warnings} *)
+
+  val _warn : env -> 'a fragment -> 'a warn -> unit
+  (** Emit a warning *)
+
+  val _error : env -> 'a fragment -> 'a err -> _
+  (** Raise an error *)
+
+  val suggest : limit:int -> env -> Dolmen.Std.Id.t -> Dolmen.Std.Id.t list
+  (** From a dolmen identifier, return a list of existing bound identifiers
+      in the env that are up to [~limit] in terms of distance of edition. *)
 
 
   (** {2 Parsing functions} *)
@@ -182,26 +357,33 @@ module type S = sig
   (** Wrappers around {parse_expr} to set the expect field of the env,
       and unwrap an expected return value. *)
 
-  val parse_app_ty : (Ty.Const.t -> Dolmen.Term.t list -> res) typer
-  val parse_app_term : (T.Const.t -> Dolmen.Term.t list -> res) typer
+  val parse_app_ty : (Ty.Const.t -> Dolmen.Std.Term.t list -> res) typer
+  val parse_app_term : (T.Const.t -> Dolmen.Std.Term.t list -> res) typer
   (** Function used for parsing applications. The first dolmen term given
       is the application term being parsed (used for reporting errors). *)
 
+  val unwrap_ty : env -> Dolmen.Std.Term.t -> res -> Ty.t
+  val unwrap_term : env -> Dolmen.Std.Term.t -> res -> T.t
+  (** Unwrap a result, raising the adequate typing error
+      if the result if not as expected. *)
+
+
   (** {2 High-level functions} *)
 
   val decls :
-    env -> ?attr:Dolmen.Term.t ->
-    Dolmen.Statement.decl list ->
-    [ `Type_decl of Ty.Const.t
-    | `Term_decl of T.Const.t
+    env -> ?attr:Dolmen.Std.Term.t ->
+    Dolmen.Std.Statement.decls -> [
+      | `Type_decl of Ty.Const.t
+      | `Term_decl of T.Const.t
     ] list
   (** Parse a list of potentially mutually recursive declarations. *)
 
-  val new_def :
-    (?attr:Dolmen.Term.t -> Dolmen.Id.t ->
-     [ `Type_def of Dolmen.Id.t * tag list * Ty.Var.t list * Ty.t
-     | `Term_def of Dolmen.Id.t * tag list * Ty.Var.t list * T.Var.t list * T.t
-     ]) typer
+  val defs :
+    env -> ?attr:Dolmen.Std.Term.t ->
+    Dolmen.Std.Statement.defs -> [
+      | `Type_def of Dolmen.Std.Id.t * Ty.Const.t * Ty.Var.t list * Ty.t
+      | `Term_def of Dolmen.Std.Id.t * T.Const.t * Ty.Var.t list * T.Var.t list * T.t
+    ] list
   (** Parse a definition *)
 
   val parse : T.t typer
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/tools/dune b/Src/COLIBRI/simplex_ocaml/dolmen/tools/dune
new file mode 100644
index 0000000000000000000000000000000000000000..2733a289be42b56dca4d613270081bfa1f752194
--- /dev/null
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/tools/dune
@@ -0,0 +1,6 @@
+
+(executable
+  (name       gentests)
+  (libraries  unix)
+)
+
diff --git a/Src/COLIBRI/simplex_ocaml/dolmen/tools/gentests.ml b/Src/COLIBRI/simplex_ocaml/dolmen/tools/gentests.ml
new file mode 100644
index 0000000000000000000000000000000000000000..4a4236a2dda3aea8dcebe8443d5476a8c8d4b742
--- /dev/null
+++ b/Src/COLIBRI/simplex_ocaml/dolmen/tools/gentests.ml
@@ -0,0 +1,175 @@
+
+(* This file is free software, part of dolmen. See file "LICENSE" for more information *)
+
+
+(* Helper functions *)
+(* ************************************************************************* *)
+
+let output_of_problem file =
+  Filename.chop_extension file ^ ".output"
+
+let expected_of_problem file =
+  Filename.chop_extension file ^ ".expected"
+
+let is_a_pb file =
+  match Filename.extension file with
+  | ".ae"
+  | ".cnf"
+  | ".icnf"
+  | ".smt2"
+  | ".p"
+  | ".zf"
+    -> true
+  | _
+    -> false
+
+
+(* Unix helper functions *)
+(* ************************************************************************* *)
+
+(* touch the file *)
+let touch file =
+  if Sys.file_exists file then
+    true
+  else
+    let ch = open_out file in
+    let () = close_out ch in
+    false
+
+(* read a file and print it out *)
+let cat fmt file =
+  let ch = open_in file in
+  try while true do
+      let s = input_line ch in
+      Format.fprintf fmt "%s@\n" s
+    done
+  with End_of_file ->
+    Format.fprintf fmt "@."
+
+
+(* Scan a folder *)
+let scan_folder path =
+  let handle = Unix.opendir path in
+  let rec aux files folders h =
+    match Unix.readdir h with
+    | exception End_of_file ->
+      Unix.closedir h;
+      files, folders
+    | "." | ".." ->
+      aux files folders h
+    | s ->
+      let f = Filename.concat path s in
+      let stat = Unix.stat f in
+      begin match stat.st_kind with
+        | Unix.S_REG -> aux (s :: files) folders h
+        | Unix.S_DIR -> aux files (s :: folders) h
+        | _ -> aux files folders h
+      end
+  in
+  aux [] [] handle
+
+
+(* Base stanza *)
+(* ************************************************************************* *)
+
+let rec pp_exit_codes fmt = function
+  | [] -> assert false
+  | [x] -> Format.fprintf fmt "%d" x
+  | x :: r -> Format.fprintf fmt "(or %d %a)" x pp_exit_codes r
+
+let test_stanza fmt (exit_codes, pb_file) =
+  let output_file = output_of_problem pb_file in
+  let expected_file = expected_of_problem pb_file in
+  Format.fprintf fmt {|
+; Test for %s
+(rule
+  (target  %s)
+  (deps    %s)
+  (package dolmen_bin)
+  (action (chdir %%{workspace_root}
+           (with-outputs-to %%{target}
+            (with-accepted-exit-codes %a
+             (run dolmen %%{deps} %%{read-lines:flags.dune}))))))
+(rule
+  (alias runtest)
+  (action (diff %s %s)))
+|}
+    pb_file output_file pb_file
+    pp_exit_codes exit_codes
+    expected_file output_file
+
+
+(* Generating a test case *)
+(* ************************************************************************* *)
+
+let is_empty_or_create file =
+  if touch file then
+    let ch = open_in file in
+    try
+      let _ = input_char ch in
+      false
+    with End_of_file ->
+      true
+  else
+    true
+
+let gen_test fmt path pb =
+  let expected_file = Filename.concat path (expected_of_problem pb) in
+  let exit_codes = if is_empty_or_create expected_file then [0] else [0; 1] in
+  test_stanza fmt (exit_codes, pb)
+
+
+(* Generating tests for a folder and its files *)
+(* ************************************************************************* *)
+
+let is_not_empty_or_delete file =
+  if Sys.file_exists file then
+    let ch = open_in file in
+    try
+      let _ = input_char ch in
+      true
+    with End_of_file ->
+      let () = Sys.remove file in
+      false
+  else
+    false
+
+
+let gen_tests path files =
+  match List.filter is_a_pb files with
+  | [] -> ()
+  | pbs ->
+    let _ = touch (Filename.concat path "flags.dune") in
+    let ch = open_out (Filename.concat path "dune") in
+    let fmt = Format.formatter_of_out_channel ch in
+    let () = Format.fprintf fmt "; File auto-generated by gen-dune.ml@\n" in
+    let () =
+      let templ = Filename.concat path "dune.templ" in
+      if is_not_empty_or_delete templ then begin
+        Format.fprintf fmt
+          "; Template begin@\n%a@\n; Template end@\n@\n"
+          cat templ
+      end
+    in
+    let () = Format.fprintf fmt "; Auto-generated part begin@\n" in
+    let () = List.iter (gen_test fmt path) pbs in
+    let () = Format.fprintf fmt "; Auto-generated part end@." in
+    close_out ch
+
+
+(* Generating tests recursively for a folder and its children *)
+(* ************************************************************************* *)
+
+let rec gen_tests_rec path =
+  let files, folders = scan_folder path in
+  let () = gen_tests path files in
+  List.iter gen_tests_rec (List.map (Filename.concat path) folders)
+
+
+(* Main point of entry *)
+(* ************************************************************************* *)
+
+let () =
+  let root = if Array.length Sys.argv >= 2 then Sys.argv.(1) else "." in
+  gen_tests_rec root
+
diff --git a/Src/COLIBRI/simplex_ocaml/dune-workspace b/Src/COLIBRI/simplex_ocaml/dune-workspace
index bd3920b49243a21fcb605acde4ff15471ef16636..f9fec08bd8fa58334397ce0a608777a3439c6176 100644
--- a/Src/COLIBRI/simplex_ocaml/dune-workspace
+++ b/Src/COLIBRI/simplex_ocaml/dune-workspace
@@ -1,4 +1,4 @@
 (lang dune 1.0)
 
 (context default)
-;(context (opam (switch 4.07.0) (targets native)))
+;(context (name docker) (opam (switch 4.07) (targets native)))
diff --git a/Src/COLIBRI/simplex_ocaml/parser.ml b/Src/COLIBRI/simplex_ocaml/parser.ml
index e436fb57d3d5bb1ec746fe8f5afff31e0aa1a3b2..d4066cac901c4d8e86fcbf6c4c6000c84da7025f 100644
--- a/Src/COLIBRI/simplex_ocaml/parser.ml
+++ b/Src/COLIBRI/simplex_ocaml/parser.ml
@@ -1,4 +1,49 @@
-module Typer = Dolmen_loop.Typer.Make(Dolmen_loop.State.For_typer)
+module State = struct
+  include (Dolmen_loop.State : ((module type of Dolmen_loop.State) with type t := Dolmen_loop.State.t))
+  (* include Dolmen_loop.State *)
+  type error_state = {
+    warns : string list;
+    error : [ `No_error | `Error of string ]
+  }
+
+  type t = error_state state
+
+  let pp_loc fmt o =
+    match o with
+    | None -> ()
+    | Some loc ->
+      Format.fprintf fmt "%a:@ " Dolmen.Std.Loc.fmt loc
+
+  let error ?loc state format =
+    let loc = Dolmen.Std.Misc.opt_map loc Dolmen.Std.Loc.full_loc in
+    Format.kasprintf (fun s ->
+        let s = Str.global_replace (Str.regexp_string "\"") "\"\"" s in
+        { state with solve_state = { state.solve_state with error = `Error s } } )
+      ("Error @[<hov>%a" ^^ format ^^ "@]@.")
+      pp_loc loc
+
+  let set_logic st _ = st (** keep ALL *)
+
+  let warn ?loc st format =
+    let loc = Dolmen.Std.Misc.opt_map loc Dolmen.Std.Loc.full_loc in
+    let aux s =
+      let s = Str.global_replace (Str.regexp_string "\"") "\"\"" s in
+      { st with solve_state = { st.solve_state with warns = s::st.solve_state.warns } }
+    in
+    Format.kasprintf aux
+      ("@[<v>%a%s @[<hov>" ^^ format ^^ "@]@]@.")
+      pp_loc loc
+      "Warning"
+
+end
+
+module Parser = Dolmen_loop.Parser.Pipe(Dolmen.Std.Expr)(State)
+module Header = Dolmen_loop.Headers.Pipe(State)
+module Typer = struct
+  module T = Dolmen_loop.Typer.Make(State)
+  include T
+  include Dolmen_loop.Typer.Pipe(Dolmen.Std.Expr)(State)(T)
+end
 
 module Colibri_Builtins  = struct
 
@@ -18,17 +63,21 @@ module Colibri_Builtins  = struct
     | Array of 'offset ty * 'offset ty
     | Bitv of 'offset
     | Fp of 'offset * 'offset
-    | Var of Dolmen.Expr.Ty.Var.t
+    | Var of Dolmen.Std.Expr.Ty.Var.t
 
-  type Dolmen.Expr.builtin +=
+  type Dolmen.Std.Expr.builtin +=
     | Colibri_builtin of (string*int array)
 
 
   type builtin = {
-    app: Type.env -> Dolmen.Term.t -> Dolmen.Term.t list -> int array -> Type.res option
+    app: Dolmen_loop.Typer.T.env -> Dolmen.Std.Term.t -> Dolmen.Std.Term.t list -> int array -> Dolmen.Std.Expr.term
   ; param_explicit_arity: int
   ; param_implicit_arity: int
   }
+
+  type 'a Dolmen_loop.Typer.T.err +=
+    Generic_type_error of string
+
   let registered = Hashtbl.create 10
 
   let split_id = Dolmen_std.Misc.split_on_char '\000'
@@ -38,32 +87,34 @@ module Colibri_Builtins  = struct
       let i = int_of_string s in
       if 0 < i then i else raise Exit
     with Failure _ | Exit ->
-      let err = Type.Expected ("an integer greater than 0", None) in
-      raise (Type.Typing_error (err, env, ast))
+      let err = Dolmen_loop.Typer.T.Expected ("an integer greater than 0", None) in
+      Dolmen_loop.Typer.T._error env (Dolmen_loop.Typer.T.Ast ast) err
 
-  let parse_id env ast id args =
+  let parse_id env id =
     match split_id id with
     | name :: r -> begin
         match Hashtbl.find_opt registered name with
-        | None -> None
+        | None -> `Not_found
         | Some builtin ->
-          let r = Array.map (parse_int_pos env ast) (Array.of_list  r) in
-          let n = Array.length r in
-          if n = builtin.param_explicit_arity then
-            builtin.app env ast args r
-          else begin
-            let err = Type.Bad_op_arity (name, n, builtin.param_explicit_arity) in
-            raise (Type.Typing_error (err, env, ast))
+          `Term begin fun ast args ->
+            let r = Array.map (parse_int_pos env ast) (Array.of_list  r) in
+            let n = Array.length r in
+            if n = builtin.param_explicit_arity then
+              builtin.app env ast args r
+            else begin
+              let err = Dolmen_loop.Typer.T.Bad_op_arity (name, [n], builtin.param_explicit_arity) in
+              Dolmen_loop.Typer.T._error env (Dolmen_loop.Typer.T.Ast ast) err
+            end
           end
       end
-    | [] -> None
+    | [] -> `Not_found
 
-  let parse : Type.builtin_symbols = fun env ast s args ->
+  let parse : Dolmen_loop.Typer.T.builtin_symbols = fun env s ->
     match s with
     (* sort *)
-    | Type.Id { Dolmen.Id.ns = Dolmen.Id.Term; name; } ->
-      parse_id env ast name args
-    | _ -> None
+    | Dolmen_loop.Typer.T.Id { Dolmen.Std.Id.ns = Dolmen.Std.Id.Term; name; } ->
+      parse_id env name
+    | _ -> `Not_found
 
   let () = Typer.additional_builtins := parse
 
@@ -97,23 +148,23 @@ module Colibri_Builtins  = struct
       let off2 = compute_offset_for_result params off2 in
       if not (off1 = off2) then
         let err =
-          Typer.Generic_type_error
+          Generic_type_error
             (Format.asprintf "Checks %s failed %i <> %i" s off1 off2)
         in
-        raise (Type.Typing_error(err,env,ast))
+        Dolmen_loop.Typer.T._error env (Ast ast) err
 
   let rec instantiate_type compute_offset params = function
-    | Int -> Dolmen.Expr.Ty.int
-    | Real -> Dolmen.Expr.Ty.real
-    | Bool -> Dolmen.Expr.Ty.prop
-    | Array(a,b) -> Dolmen.Expr.Ty.array
+    | Int -> Dolmen.Std.Expr.Ty.int
+    | Real -> Dolmen.Std.Expr.Ty.real
+    | Bool -> Dolmen.Std.Expr.Ty.prop
+    | Array(a,b) -> Dolmen.Std.Expr.Ty.array
                       (instantiate_type compute_offset params a)
                       (instantiate_type compute_offset params b)
-    | Bitv off -> Dolmen.Expr.Ty.bitv (compute_offset params off)
-    | Fp (off1,off2) -> Dolmen.Expr.Ty.float
+    | Bitv off -> Dolmen.Std.Expr.Ty.bitv (compute_offset params off)
+    | Fp (off1,off2) -> Dolmen.Std.Expr.Ty.float
                           (compute_offset params off1)
                           (compute_offset params off2)
-    | Var v -> Dolmen.Expr.Ty.of_var v
+    | Var v -> Dolmen.Std.Expr.Ty.of_var v
 
 
   let unify_offset env ast params off i =
@@ -122,43 +173,43 @@ module Colibri_Builtins  = struct
     | Some j when i = j -> ()
     | Some j ->
       let err =
-        Typer.Generic_type_error
+        Generic_type_error
           (Format.asprintf "Can't unify type parameters (bitv or fp) %i instead of %i" i j)
       in
-      raise (Type.Typing_error(err,env,ast))
+      Dolmen_loop.Typer.T._error env (Ast ast) err
 
-  let rec unify_types env ast params (ty:Dolmen.Expr.Ty.t) arg =
+  let rec unify_types env ast params (ty:Dolmen.Std.Expr.Ty.t) arg =
     let error expected =
       let err =
-        Type.Expected(expected,Some (Type.Ty ty))
+        Dolmen_loop.Typer.T.Expected(expected,Some (Dolmen_loop.Typer.T.Ty ty))
       in
-      raise (Type.Typing_error(err,env,ast))
+      Dolmen_loop.Typer.T._error env (Ast ast) err
     in
     match arg with
     | Bitv off -> begin
         match ty with
-        | { descr = App ({ builtin = Dolmen.Expr.Bitv i; _ }, _); _ } ->
+        | { descr = App ({ builtin = Dolmen.Std.Expr.Bitv i; _ }, _); _ } ->
           unify_offset env ast params off i
         | _ ->
           error "Bitv"
       end
     | Fp (off1,off2) -> begin
         match ty with
-        | { descr = App ({ builtin = Dolmen.Expr.Float(i,j); _ }, _); _ } ->
+        | { descr = App ({ builtin = Dolmen.Std.Expr.Float(i,j); _ }, _); _ } ->
           unify_offset env ast params off1 i;
           unify_offset env ast params off2 j
         | _ -> error "FloatingPoint"
       end
     | Array(a,b) -> begin
       match ty with
-        | { descr = App ({ builtin = Dolmen.Expr.Array; _ }, [i;j]); _ } ->
+        | { descr = App ({ builtin = Dolmen.Std.Expr.Array; _ }, [i;j]); _ } ->
           unify_types env ast params i a;
           unify_types env ast params j b
         | _ -> error "array"
     end
-    | Int -> if not (Dolmen.Expr.Ty.(equal ty int)) then error "int"
-    | Real -> if not (Dolmen.Expr.Ty.(equal ty real)) then error "real"
-    | Bool -> if not (Dolmen.Expr.Ty.(equal ty prop)) then error "bool"
+    | Int -> if not (Dolmen.Std.Expr.Ty.(equal ty int)) then error "int"
+    | Real -> if not (Dolmen.Std.Expr.Ty.(equal ty real)) then error "real"
+    | Bool -> if not (Dolmen.Std.Expr.Ty.(equal ty prop)) then error "bool"
     | Var _ -> () (* will be checked by Dolmen inferred engine *)
 
 
@@ -166,82 +217,39 @@ module Colibri_Builtins  = struct
     let symbol =
       with_cache ~cache:(Hashtbl.create 13) (fun params ->
           assert ( Array.length params = param_explicit_arity + param_implicit_arity );
-          Dolmen.Expr.Id.const ~name ~builtin:(Colibri_builtin (name,params))
+          Dolmen.Std.Expr.Id.const ~name ~builtin:(Colibri_builtin (name,params))
             name poly
             (List.map (instantiate_type compute_offset_for_args params) args)
             (instantiate_type compute_offset_for_result params res))
     in
     let len = List.length args in
     let app env ast targs instantiation_explicit =
-      Dolmen_type.Base.make_opn len (module Type) env ast name targs
-        (fun l ->
-           let instantiation = Array.make (param_explicit_arity + param_implicit_arity) None in
-           Array.iteri (fun i k -> instantiation.(i) <- Some k) instantiation_explicit;
-           let l = List.map (Type.parse_term env) l in
-           List.iter2 (fun t arg -> unify_types env ast instantiation (Dolmen.Expr.Term.ty t) arg) l args;
-           let instantiation = Array.map (function
-               | Some x -> x
-               | None ->
-                 let err = Typer.Generic_type_error "Internal error: some parameter are unbounded" in
-                 raise (Type.Typing_error (err, env, ast))
-             ) instantiation in
-           List.iter (check_offsets env ast instantiation) checks;
-           Type.Term (Dolmen.Expr.Term.apply
-                               (symbol instantiation)
-                               (List.map (fun _ -> Dolmen.Expr.Ty.wildcard ()) poly)
-                               l))
+      let l = List.length args in
+      if not (l = len)
+      then
+        Dolmen_loop.Typer.T._error env (Dolmen_loop.Typer.T.Ast ast)
+          (Dolmen_loop.Typer.T.Bad_op_arity (name, [len], l))
+      else
+        let instantiation = Array.make (param_explicit_arity + param_implicit_arity) None in
+        Array.iteri (fun i k -> instantiation.(i) <- Some k) instantiation_explicit;
+        let targs = List.map (Dolmen_loop.Typer.T.parse_term env) targs in
+        List.iter2 (fun t arg -> unify_types env ast instantiation (Dolmen.Std.Expr.Term.ty t) arg) targs args;
+        let instantiation = Array.map (function
+            | Some x -> x
+            | None ->
+              let err = Generic_type_error "Internal error: some parameter are unbounded" in
+              Dolmen_loop.Typer.T._error env (Ast ast) err
+          ) instantiation in
+        List.iter (check_offsets env ast instantiation) checks;
+        Dolmen.Std.Expr.Term.apply
+          (symbol instantiation)
+          (List.map (fun _ -> Dolmen.Std.Expr.Ty.wildcard ()) poly)
+          targs
     in
     Hashtbl.add registered name { app; param_explicit_arity; param_implicit_arity }
 end
 
-
-module Bin_state = struct
-  include Dolmen.State
-
-  include Dolmen_loop.State.Make(struct
-      type ty_state = Typer.T.state
-    end)
-
-  (* type nonrec t = {
-   *   base: t;
-   *   statements: Dolmen.Term.t list;
-   * }
-   * let time_limit t = time_limit t.base
-   * let size_limit t = size_limit t.base
-   * let is_interactive t = is_interactive t.base
-   * let set_mode t x = { t with base = set_mode t.base x }
-   * let set_lang t x = { t with base = set_lang t.base x }
-   * let input_mode t = input_mode t.base
-   * let input_lang t = input_lang t.base
-   * let input_dir t = input_dir t.base
-   * let input_source t = input_source t.base
-   * let warn t x s = { t with base = warn t.base x s }
-   * let set_logic t s = { t with base = set_logic t.base s }
-   * let set_info t i = { t with base = set_info t.base i }
-   * let set_option t i = { t with base = set_option t.base i }
-   * let typecheck t = typecheck t.base *)
-
-  let pp_loc fmt o =
-    match o with
-    | None -> ()
-    | Some loc ->
-      Format.fprintf fmt "%a:@ " Dolmen.ParseLocation.fmt loc
-
-  let error ?loc _ format =
-    Format.kasprintf Ocaml_eclipse.(fun s ->
-        let s = Str.global_replace (Str.regexp_string "\"") "\"\"" s in
-        Constr("error", [| String s |] ))
-      ("Error @[<hov>%a" ^^ format ^^ "@]@.")
-      pp_loc loc
-
-  let set_logic st _ = st (** keep ALL *)
-
-end
-
-module Pipe = Dolmen_loop.Pipes.Make(Dolmen.Expr)(Bin_state)(Typer)
-
 module Errors = struct
-  module State = Bin_state
   let sigint st = State.error st "User Interrupt"
   let out_of_time st = State.error st "Time limit reached"
   let out_of_space st = State.error st "Memory limit reached"
@@ -252,116 +260,124 @@ let input_to_string = function
   | `Raw _ -> "<raw>"
   | `File f -> f
 
-let default_loc (st : State.t) =
-  Dolmen.ParseLocation.mk
-    (input_to_string st.input_source) 0 0 0 0
-
-let get_loc st = function
-  | Some l -> l
-  | None -> default_loc st
-
+let mk_error ?loc _ format =
+  let loc = Dolmen.Std.Misc.opt_map loc Dolmen.Std.Loc.full_loc in
+  Format.kasprintf (fun s ->
+      let s = Str.global_replace (Str.regexp_string "\"") "\"\"" s in
+      s )
+    ("Error @[<hov>%a" ^^ format ^^ "@]@.")
+    State.pp_loc loc
 
 let exn st = function
   (* Parsing errors *)
-  | Dolmen.ParseLocation.Uncaught (loc, exn) ->
-    State.error st "%a:@\n%s@."
-      Dolmen.ParseLocation.fmt loc (Printexc.to_string exn)
-  | Dolmen.ParseLocation.Lexing_error (loc, msg) ->
-    State.error st "%a:@\nLexing error: invalid character '%s'@."
-      Dolmen.ParseLocation.fmt loc msg
-  | Dolmen.ParseLocation.Syntax_error (loc, msg) ->
-    State.error st "%a:@\n%s@."
-      Dolmen.ParseLocation.fmt loc
-      (match msg with "" -> "Syntax error" | x -> x)
+  | Dolmen.Std.Loc.Uncaught (loc, exn) ->
+    let file = Dolmen_loop.State.input_file_loc st in
+    mk_error ~loc:{ file; loc; } st "%s" (Printexc.to_string exn)
+  | Dolmen.Std.Loc.Lexing_error (loc, lex) ->
+    let file = Dolmen_loop.State.input_file_loc st in
+    mk_error ~loc:{ file; loc; } st "Lexing error: invalid character '%s'" lex
+  | Dolmen.Std.Loc.Syntax_error (loc, msg) ->
+    let file = Dolmen_loop.State.input_file_loc st in
+    mk_error ~loc: { file; loc; } st "%t@." msg
+
 
   (* Typing errors *)
-  | Typer.T.Typing_error (err, _, t) ->
-    let loc = get_loc st t.Dolmen.Term.loc in
-    State.error st
-      "@[<hv>While typing:@ @[<hov>%a@]@]@.%a:@\n@[<hv>%a@]"
-      Dolmen.Term.print t
-      Dolmen.ParseLocation.fmt loc
-      Typer.report_error err
+  | Dolmen_loop.Typer.T.Typing_error (
+      Dolmen_loop.Typer.T.Error (env, fragment, _err) as error) ->
+    let loc = Dolmen_loop.Typer.T.fragment_loc env fragment in
+    if st.context then
+      Format.eprintf "@[<hv 2>While typing:@ @[<hov>%a@]@]@."
+        Typer.print_fragment (env, fragment);
+    mk_error ~loc st "%a"
+      Typer.report_error error
 
   (* State errors *)
-  | Dolmen_loop.State.File_not_found (None, dir, f) ->
-    State.error st "File not found: '%s' in directory '%s'" f dir
-  | Dolmen_loop.State.File_not_found (Some loc, dir, f) ->
-    State.error st "@[<v>%a:@ File not found: '%s' in directory '%s'@]"
-      Dolmen.ParseLocation.fmt loc f dir
-  | Dolmen_loop.State.Missing_smtlib_logic ->
-    State.error st "Missing smtlib set-logic statement"
+  | Dolmen_loop.State.File_not_found (loc, dir, f) ->
+    if dir = "." then
+      mk_error ~loc st "File not found: '%s'" f
+    else
+      mk_error ~loc st "File not found: '%s' in directory '%s'" f dir
   | Dolmen_loop.State.Input_lang_changed (l, l') ->
-    State.error st "Input language changed from %s to %s (probably because of an include statement)"
-      (Dolmen_loop.Parser.string_of_language l)
-      (Dolmen_loop.Parser.string_of_language l')
+    mk_error st "Input language changed from %s to %s (probably because of an include statement)"
+      (Dolmen_loop.Logic.string_of_language l)
+      (Dolmen_loop.Logic.string_of_language l')
 
   (* Internal Dolmen Expr errors *)
-  | Dolmen.Expr.Bad_ty_arity (c, l) ->
+  | Dolmen.Std.Expr.Bad_ty_arity (c, l) ->
     let pp_sep fmt () = Format.fprintf fmt ";@ " in
-    State.error st "@[<hv>Bad arity for type constant '%a', which was provided arguments:@ [@[<hv>%a@]]@]"
-      Dolmen.Expr.Print.ty_const c (Format.pp_print_list ~pp_sep Dolmen.Expr.Ty.print) l
-  | Dolmen.Expr.Bad_term_arity (c, tys, ts) ->
+    mk_error st "@[<hv>Internal error: Bad arity for type constant '%a',@ which was provided arguments:@ [@[<hv>%a@]]@]"
+      Dolmen.Std.Expr.Print.ty_const c (Format.pp_print_list ~pp_sep Dolmen.Std.Expr.Ty.print) l
+  | Dolmen.Std.Expr.Bad_term_arity (c, tys, ts) ->
     let pp_sep fmt () = Format.fprintf fmt ";@ " in
-    State.error st "@[<hv>Bad arity for type constant '%a', which was provided arguments:@ [@[<hv>%a;@ %a@]]@]"
-      Dolmen.Expr.Print.term_const c
-      (Format.pp_print_list ~pp_sep Dolmen.Expr.Ty.print) tys
-      (Format.pp_print_list ~pp_sep Dolmen.Expr.Term.print) ts
-  | Dolmen.Expr.Type_already_defined c ->
-    State.error st "Type constant '%a' was already defined earlier, cannot re-define it."
-      Dolmen.Expr.Print.id c
-
-  | Dolmen.Expr.Term.Wrong_type (t, ty) ->
-    State.error st "@[<hv>A term of type@ %a@ was expected but instead got a term of type@ %a@]"
-      Dolmen.Expr.Ty.print ty Dolmen.Expr.Ty.print (Dolmen.Expr.Term.ty t)
+    mk_error st "@[<hv>Internal error: Bad arity for type constant '%a',@ which was provided arguments:@ [@[<hv>%a;@ %a@]]@]"
+      Dolmen.Std.Expr.Print.term_const c
+      (Format.pp_print_list ~pp_sep Dolmen.Std.Expr.Ty.print) tys
+      (Format.pp_print_list ~pp_sep Dolmen.Std.Expr.Term.print) ts
+  | Dolmen.Std.Expr.Type_already_defined c ->
+    mk_error st "@[<hv>Internal error: Type constant '%a' was already defined earlier,@ cannot re-define it.@]"
+      Dolmen.Std.Expr.Print.id c
+
+  | Dolmen.Std.Expr.Term.Wrong_type (t, ty) ->
+    mk_error st "@[<hv>Internal error: A term of type@ %a@ was expected but instead got a term of type@ %a@]"
+      Dolmen.Std.Expr.Ty.print ty Dolmen.Std.Expr.Ty.print (Dolmen.Std.Expr.Term.ty t)
 
   (* File format auto-detect *)
-  | Dolmen_loop.Parser.Extension_not_found ext ->
-    State.error st "@[<hv>The following extension was not recognized: '%s'.@ %s" ext
+  | Dolmen_loop.Logic.Extension_not_found ext ->
+    mk_error st "@[<hv>The following extension was not recognized: '%s'.@ %s" ext
       "Please use a recognised extension or specify an input language on the command line"
 
   (* Generic catch-all *)
-  | e -> State.error st "@[<hv>Unhandled exception:@ %s@]" (Printexc.to_string e)
+  | e -> mk_error st "@[<hv>Unhandled exception:@ %s@]" (Printexc.to_string e)
 end
 
 type env_pre = {
-  mutable state: Bin_state.t;
-  read: (Bin_state.t -> Dolmen.Statement.t option);
-  mutable expand_stack: Dolmen.Statement.t Gen.gen list;
+  mutable state: State.t;
+  read: (State.t -> Dolmen.Std.Statement.t option);
+  mutable expand_stack: Dolmen.Std.Statement.t Gen.gen list;
+  mutable next_statement: Typer.typechecked Typer.stmt option option;
 }
 
 type env =
-  | InitError of Ocaml_eclipse.eclipse
+  | InitError of string
   | Env of env_pre
 
 let create_env input_source =
+  Dolmen.Std.Loc.reset_files ();
   let input_source = match input_source with
     | "-" -> `Stdin
     | s -> `File s
   in
-  let st : Bin_state.t = {
+  let st : State.t = {
     time_limit = 300.; size_limit = 1_000_000_000.;
 
+    max_warn = max_int; cur_warn = 0;
+
     input_dir=""; input_lang = Some (Smtlib2 `V2_6);
     input_mode = Some `Full; input_source;
 
-    type_state = Typer.T.new_state ();
-    type_check = true; type_infer = None; type_shadow = None;
-    type_smtlib_logic = Some "ALL";
+    type_state = Dolmen_loop.Typer.new_state ();
+    type_check = true; type_strict = false;
 
-    solve_state = ();
+    header_check = true; header_licenses = []; header_lang_version = None;
+    header_state = Dolmen_loop.Headers.empty;
 
-    export_lang = None;
+    input_file_loc = Dolmen.Std.Loc.mk_file "";
+
+    solve_state = { warns = []; error = `No_error };
+
+    export_lang = [];
+    debug = false;
+    context = false;
   } in
     try
       let st, g =
-        Pipe.parse [] st
+        Parser.parse [] st
       in
-      Env { state = st; read = g; expand_stack = [] }
+      Env { state = st; read = g; expand_stack = []; next_statement = None }
     with exn ->
       InitError (Errors.exn st exn)
 
-let next env =
+let update_env env =
   let rec nextstmt () =
     match env.expand_stack with
     | [] -> begin match env.read env.state with
@@ -374,7 +390,7 @@ let next env =
         | Some stmt -> expand stmt
       end
   and expand stmt =
-    let st, gen = Pipe.expand (env.state,stmt) in
+    let st, gen = Parser.expand env.state stmt in
     env.state <- st;
     match gen with
     | `Ok -> Some stmt
@@ -384,13 +400,13 @@ let next env =
   in
   let rec nextexpr () =
     match nextstmt () with
-    | None -> None
+    | None -> env.next_statement <- Some None
     | Some stmt ->
-      begin match Pipe.typecheck (env.state,stmt) with
-        | `Continue (st,stmt) ->
+      begin match Typer.typecheck env.state stmt with
+        | st, `Continue stmt ->
           env.state <- st;
-          Some stmt
-        | `Done st ->
+          env.next_statement <- Some (Some stmt)
+        | st, `Done () ->
           env.state <- st;
           nextexpr ()
       end
@@ -400,19 +416,19 @@ let next env =
 let print_typed d =
     match d.contents with
     | `Type_def _ -> "Type_def"
-    | `Goal g -> Format.asprintf "Goal %a" Dolmen.Expr.Print.term g
-    | `Hyp g -> Format.asprintf "Hyp %a" Dolmen.Expr.Print.term g
+    | `Goal g -> Format.asprintf "Goal %a" Dolmen.Std.Expr.Print.term g
+    | `Hyp g -> Format.asprintf "Hyp %a" Dolmen.Std.Expr.Print.term g
     | `Clause l ->
-      String.concat ";" (List.map (Format.asprintf "Clause %a" Dolmen.Expr.Print.term) l)
-    | `Term_def (_,_,_,t) -> Format.asprintf "Term_def %a" Dolmen.Expr.Print.term t
+      String.concat ";" (List.map (Format.asprintf "Clause %a" Dolmen.Std.Expr.Print.term) l)
+    | `Term_def (_,_,_,t) -> Format.asprintf "Term_def %a" Dolmen.Std.Expr.Print.term t
     | `Solve [] -> Format.asprintf "Solve []"
     | `Solve _ -> Format.asprintf "Solve ..."
     | `Executed -> Format.asprintf "Executed (What is this?)"
     | `Decls l ->
       String.concat ";"
         (List.map (function
-             | `Type_decl ty -> Format.asprintf "type_decl %a" Dolmen.Expr.Print.ty_const ty
-             | `Term_decl t -> Format.asprintf "term_decl %a" Dolmen.Expr.Print.term_const t) l
+             | `Type_decl ty -> Format.asprintf "type_decl %a" Dolmen.Std.Expr.Print.ty_const ty
+             | `Term_decl t -> Format.asprintf "term_decl %a" Dolmen.Std.Expr.Print.term_const t) l
         )
 
 module To_Eclipse = struct
@@ -423,15 +439,17 @@ module To_Eclipse = struct
   let int32 i = Ocaml_eclipse.Int32 i
   let int i = Ocaml_eclipse.Int32 (Int32.of_int i)
   let bool b = if b then Ocaml_eclipse.Int32 1l else Ocaml_eclipse.Int32 0l
-  let index (i:Dolmen.Expr.index) = int (i:>int)
+  let index (i:Dolmen.Std.Expr.index) = int (i:>int)
   let list conv l = Ocaml_eclipse.List (Array.of_list (List.map conv l))
+  let array conv l = Ocaml_eclipse.List (Array.map conv l)
 
-  let rec builtin (x:Dolmen.Expr.builtin) =
-    let open Dolmen.Expr in
+  let rec builtin (x:Dolmen.Std.Expr.builtin) =
+    let open Dolmen.Std.Expr in
     match x with
     | Base -> atom "base"
     | Wildcard -> atom "wildcard"
     | Prop -> atom "prop"
+    | Unit -> atom "unit"
     | Univ -> atom "univ"
     | Coercion -> atom "coercion"
     | True -> atom "true"
@@ -447,9 +465,10 @@ module To_Eclipse = struct
     | Imply -> atom "imply"
     | Equiv -> atom "equiv"
     | Ite -> atom "ite"
-    | Constructor (ty_const,i1) -> mk "constructor" [| id ty_const; int i1 |]
-    | Destructor (ty_const,term_const,i1,i2) ->
-      mk "destructor" [| id ty_const; id term_const; int i1; int i2 |]
+    | Tester {cstr} -> mk "tester" [| id cstr |]
+    | Constructor {adt;case} -> mk "constructor" [| id adt; int case |]
+    | Destructor {adt;cstr;case;field} ->
+      mk "destructor" [| id adt; id cstr; int case; int field |]
     | Int -> atom "int"
     | Integer s -> mk "integer" [| string s |]
     | Rat -> atom "rat"
@@ -468,7 +487,7 @@ module To_Eclipse = struct
     | Div_e -> atom "div_e"
     | Div_t -> atom "div_t"
     | Div_f -> atom "div_f"
-    | Modulo -> atom "modulo"
+    | Modulo_e -> atom "modulo_e"
     | Modulo_t -> atom "modulo_t"
     | Modulo_f -> atom "modulo_f"
     | Abs -> atom "abs"
@@ -482,7 +501,6 @@ module To_Eclipse = struct
     | Array -> atom "array"
     | Store -> atom "store"
     | Select -> atom "select"
-    | Const -> atom "const"
     | Bitv i -> mk "bitv" [| int i |]
     | Bitvec s -> mk "bitvec" [| string s |]
     | Bitv_concat -> atom "bitv_concat"
@@ -565,50 +583,91 @@ module To_Eclipse = struct
     | To_ubv (e,s,bv) -> mk "to_ubv" [| int e; int s; int bv |]
     | To_sbv (e,s,bv) -> mk "to_sbv" [| int e; int s; int bv |]
     | To_real (e,s) -> mk "to_real" [| int e; int s |]
+    | String -> atom "String"
+    | Str s -> mk "str" [| string s |]
+    | Str_length -> atom "Str_length"
+    | Str_at -> atom "Str_at"
+    | Str_to_code -> atom "Str_to_code"
+    | Str_of_code -> atom "Str_of_code"
+    | Str_is_digit -> atom "Str_is_digit"
+    | Str_to_int -> atom "Str_to_int"
+    | Str_of_int -> atom "Str_of_int"
+    | Str_concat -> atom "Str_concat"
+    | Str_sub -> atom "Str_sub"
+    | Str_index_of -> atom "Str_index_of"
+    | Str_replace -> atom "Str_replace"
+    | Str_replace_all -> atom "Str_replace_all"
+    | Str_replace_re -> atom "Str_replace_re"
+    | Str_replace_re_all -> atom "Str_replace_re_all"
+    | Str_is_prefix -> atom "Str_is_prefix"
+    | Str_is_suffix -> atom "Str_is_suffix"
+    | Str_contains -> atom "Str_contains"
+    | Str_lexicographic_strict -> atom "Str_lexicographic_strict"
+    | Str_lexicographic_large -> atom "Str_lexicographic_large"
+    | Str_in_re -> atom "Str_in_re"
+    | String_RegLan -> atom "String_RegLan"
+    | Re_empty -> atom "Re_empty"
+    | Re_all -> atom "Re_all"
+    | Re_allchar -> atom "Re_allchar"
+    | Re_of_string -> atom "Re_of_string"
+    | Re_range -> atom "Re_range"
+    | Re_concat -> atom "Re_concat"
+    | Re_union -> atom "Re_union"
+    | Re_inter -> atom "Re_inter"
+    | Re_star -> atom "Re_star"
+    | Re_cross -> atom "Re_cross"
+    | Re_complement -> atom "Re_complement"
+    | Re_diff -> atom "Re_diff"
+    | Re_option -> atom "Re_option"
+    | Re_power i -> mk "Re_power" [| int i |]
+    | Re_loop (i,j) -> mk "Re_loop" [| int i; int j |]
     | Colibri_Builtins.Colibri_builtin (s,inst) ->
       mk "colibri_builtin" [| string s ; List (Array.map int inst) |]
     | _ -> atom "unknown_should_not_append"
 
-  and id : type a. a Dolmen.Expr.id -> Ocaml_eclipse.eclipse = fun id ->
+  and id : type a. a Dolmen.Std.Expr.id -> Ocaml_eclipse.eclipse = fun id ->
     mk "id" [| string id.name; index id.index; builtin id.builtin |]
 
-  let rec ty (t:Dolmen.Expr.ty) =
+  let rec ty (t:Dolmen.Std.Expr.ty) =
     match t.descr with
     | Var i -> mk "Var" [| id i |]
     | App (i, l) -> mk "App" [| id i; list ty l |]
 
-  let number_of_args (ft:(unit, Dolmen.Expr.ttype) Dolmen.Expr.function_type) : Ocaml_eclipse.eclipse =
-    int (List.length ft.Dolmen.Expr.fun_args)
+  let number_of_args (ft:(unit, Dolmen.Std.Expr.ttype) Dolmen.Std.Expr.function_type) : Ocaml_eclipse.eclipse =
+    int (List.length ft.Dolmen.Std.Expr.fun_args)
 
-  let function_type (ft:(Dolmen.Expr.ttype, Dolmen.Expr.ty) Dolmen.Expr.function_type) : Ocaml_eclipse.eclipse =
-    mk "fun" [| list id ft.Dolmen.Expr.fun_vars ;
-                list ty ft.Dolmen.Expr.fun_args ;
-                ty ft.Dolmen.Expr.fun_ret |]
+  let function_type (ft:(Dolmen.Std.Expr.ttype, Dolmen.Std.Expr.ty) Dolmen.Std.Expr.function_type) : Ocaml_eclipse.eclipse =
+    mk "fun" [| list id ft.Dolmen.Std.Expr.fun_vars ;
+                list ty ft.Dolmen.Std.Expr.fun_args ;
+                ty ft.Dolmen.Std.Expr.fun_ret |]
 
-  let formal (v:Dolmen.Expr.ty Dolmen.Expr.id) =
+  let formal (v:Dolmen.Std.Expr.ty Dolmen.Std.Expr.id) =
     mk "formal" [| id v; ty v.ty |]
 
-  let rec term (t:Dolmen.Expr.term) =
+  let rec term (t:Dolmen.Std.Expr.term) =
     let descr = match t.descr with
       | Var i -> mk "Var" [| id i|]
       | App (i,tyl, args) ->
         mk "App" [| id i; list ty tyl; list term args |]
       | Binder (b,t) ->
         mk "Binder" [| binder b; term t  |]
+      | Match (t,patterns) ->
+        mk "Match" [| term t;
+                      list (fun (pat,body) -> mk "Pat" [| term pat; term body |]) patterns |]
     in
     mk "term" [| ty t.ty; descr |]
 
   and binder = function
-    | Dolmen.Expr.Exists (ty_vars,term_vars) ->
+    | Dolmen.Std.Expr.Exists (ty_vars,term_vars) ->
       mk "exists" [| list id ty_vars; list formal term_vars |]
-    | Dolmen.Expr.Forall (ty_vars,term_vars) ->
+    | Dolmen.Std.Expr.Forall (ty_vars,term_vars) ->
       mk "forall" [| list id ty_vars; list formal term_vars |]
     | Letin l ->
       mk "letin" [| list (fun (v, t) -> List [| id v; term t|]) l |]
 
-  let rec ast (t: Dolmen.Term.t) =
+  let rec ast (t: Dolmen.Std.Term.t) =
     match t.term with
-    | Symbol id -> mk "symbol" [| string id.Dolmen.Id.name |]
+    | Symbol id -> mk "symbol" [| string id.Dolmen.Std.Id.name |]
     | Builtin Wildcard -> atom "wildcard"
     | Builtin Ttype -> atom "ttype"
     | Builtin Unit -> atom "unit"
@@ -669,17 +728,33 @@ module To_Eclipse = struct
 
   let stmt = function
     | None -> mk "end" [||]
-    | Some (d:Pipe.typechecked Pipe.stmt) ->
-      match d.Pipe.contents with
-      | `Type_def (_,_,t) -> mk "Type_def" [| ty t |]
+    | Some (d:Typer.typechecked Typer.stmt) ->
+      match d.Typer.contents with
+      | `Defs l ->
+        mk "Def" [| list (function
+            | `Type_def (_,_,t) -> mk "Type_def" [| ty t |]
+            | `Term_def (_,fn, ty_vars,vars,t) -> mk "Term_def" [| id fn;  function_type fn.ty; list id ty_vars; list formal vars; list id ty_vars; term t |]
+          ) l |]
       | `Goal g -> mk "Goal" [| term g |]
       | `Hyp g -> mk "Hyp" [| term g |]
       | `Clause l -> mk "Clause" [| list term l |]
-      | `Term_def (fn,ty_vars,vars,t) -> mk "Term_def" [| id fn;  function_type fn.ty; list id ty_vars; list formal vars; list id ty_vars; term t |]
       | `Solve l -> mk "Solve" [| list term l |]
       | `Decls l ->
         mk "Decl" [| list (function
-            | `Type_decl t -> mk "type_decl" [| id t; number_of_args t.ty |]
+            | `Type_decl t -> begin
+              match Dolmen.Std.Expr.Ty.definition t with
+              | None | Some Abstract ->
+                mk "type_decl" [| id t; number_of_args t.ty |]
+              | Some (Adt {ty=_;record=_;cases}) ->
+                let conv_dstr = function
+                  | None -> atom "nodestructor"
+                  | Some dstr -> mk "destructor" [| id dstr |]
+                in
+                let conv_cases {Dolmen.Std.Expr.Ty.cstr; tester; dstrs} =
+                  mk "case" [| id cstr; id tester; array conv_dstr dstrs |]
+                in
+                mk "adt_def" [| id t; number_of_args t.ty; array conv_cases cases |]
+            end
             | `Term_decl t -> mk "term_decl" [| id t;  function_type t.ty |]) l|]
       | `Reset -> mk "reset" [| |]
       | `Get_unsat_core -> mk "get_unsat_core" [| |]
@@ -706,12 +781,29 @@ end
 
 let next = function
   | InitError eclipse ->
-    To_Eclipse.mk "InitError" [| eclipse |]
+    To_Eclipse.mk "InitError" [| To_Eclipse.string eclipse |]
   | Env env ->
-    try
-      To_Eclipse.stmt (next env)
-    with exn ->
-      Errors.exn env.state exn
+    let rec aux () =
+      match env.state.solve_state.warns, env.state.solve_state.error, env.next_statement with
+      | [], `No_error, None -> begin
+        try
+          update_env env;
+          aux ()
+        with exn ->
+          let s = Errors.exn env.state exn in
+          env.state <- { env.state with solve_state = { env.state.solve_state with error = `Error s } };
+          aux ()
+      end
+      | [], `Error s, _ ->
+        To_Eclipse.mk "Error" [| To_Eclipse.string s |]
+      | [], `No_error, Some stmt ->
+        env.next_statement <- None;
+        To_Eclipse.stmt stmt
+      | w::l, _, _ ->
+        env.state <- { env.state with solve_state = { env.state.solve_state with warns = l } };
+        To_Eclipse.mk "Warn" [| To_Eclipse.string w |]
+    in
+    aux ()
 
 exception Add_builtins_wrong_parameter of string
 
@@ -766,7 +858,7 @@ let add_builtin (c:Ocaml_eclipse.eclipse) =
     let type_args = Hashtbl.create 5 in
     let convert_type_arg = function
       | Constr (s,[| |]) ->
-        let v = (Dolmen.Expr.Ty.Var.mk s) in
+        let v = (Dolmen.Std.Expr.Ty.Var.mk s) in
         Hashtbl.add type_args s v; v
       | c -> wrong_param "convert type arg" c
     in
diff --git a/Src/COLIBRI/smt_import.pl b/Src/COLIBRI/smt_import.pl
index 5082929b7cbc46c326af763bc33121c5a542dfc7..1cb895d8967c7f418f076749a584e22cd9c44743 100644
--- a/Src/COLIBRI/smt_import.pl
+++ b/Src/COLIBRI/smt_import.pl
@@ -44,6 +44,7 @@ read_dolmen_terms(PEnv,Terms) :-
         ;   Terms = [Term|ETerms]),
         read_dolmen_terms(PEnv,ETerms)).
 
+
 dolmen_to_colibri_term(set_logic(SLog),Term) ?- !,
     Term = 'set-logic'(SLog).
 dolmen_to_colibri_term(exit,Term) ?- !,
@@ -54,18 +55,18 @@ dolmen_to_colibri_term(solve(Terms),Term) ?- !,
     ;   % A DEFINIR SI BESOIN
         (foreach(DTerm,Terms),
          foreach(CTerm,CTerms) do
-            term_from_dolmen_term(DTerm,CTerm)),
+            term_from_dolmen_term(DTerm,[],CTerm)),
         Term = 'check-sat-assuming'(CTerms)).
 dolmen_to_colibri_term(get_value(Terms),Term) ?- !,
     (foreach(DTerm,Terms),
      foreach(CTerm,CTerms) do
-        term_from_dolmen_term(DTerm,CTerm)),
+        term_from_dolmen_term(DTerm,[],CTerm)),
     Term = 'get-value'(CTerms).
 dolmen_to_colibri_term(get_assignment,Term) ?- !,
     Term = 'get-assignment'.
 dolmen_to_colibri_term(get_model,Term) ?- !,
     Term = 'get-model'.
-dolmen_to_colibri_term(initError(error(String)),_) ?- !,
+dolmen_to_colibri_term(initError(String),_) ?- !,
     concat_string(["(error \"",String,"\")"],Error),
     writeln(Error),
     exit_block(abort).
@@ -75,52 +76,71 @@ dolmen_to_colibri_term(error(String),_) ?- !,
     concat_string(["(error \"",NString,"\")"],Error),
     writeln(Error),
     exit_block(syntax).
-dolmen_to_colibri_term(set_info(colon(symbol(SFlagInfo),
-                                        symbol(SInfo))),Term) ?- !,
+dolmen_to_colibri_term(warn(String),Term) ?- !,
+    split_string(String,"\"","",LNString),
+    join_string(LNString,"'",NString),
+    concat_string(["(warning \"",NString,"\")"],Error),
+    writeln(Error),
+    Term = 'set-info'("Info","").
+dolmen_to_colibri_term(set_info(app(symbol(SFlagInfo),
+                                        [symbol(SInfo)])),Term) ?- !,
     atom_string(FlagInfo,SFlagInfo),
     atom_string(Info,SInfo),
     Term = 'set-info'(FlagInfo,Info).
-dolmen_to_colibri_term(set_option(colon(symbol(SFlagOption),
-                                        symbol(SOption))),Term) ?- !,
+dolmen_to_colibri_term(set_option(app(symbol(SFlagOption),
+                                        [symbol(SOption)])),Term) ?- !,
     atom_string(FlagOption,SFlagOption),
     atom_string(Option,SOption),
     Term = 'set-option'(FlagOption,Option).
-dolmen_to_colibri_term(decl([term_decl(id(Id,_,_),fun(_,InSorts,
+dolmen_to_colibri_term(decl([term_decl(id(Id,_,_),fun(Poly,InSorts,
                                                    OutSort))]),Term) ?-
     !,
     fun_id_from_dolmen_id(Id,FId),
+    make_poly_vars(Poly,PolyVars),
     (foreach(InSort,InSorts),
-     foreach(Sort,ISorts) do
-        sort_from_dolmen_sort(InSort,Sort)),
-    sort_from_dolmen_sort(OutSort,OSort),
-    Term = 'declare-fun'(FId,ISorts,OSort),
+     foreach(Sort,ISorts),
+     param(PolyVars) do
+        sort_or_polyvar_from_dolmen_sort(InSort,PolyVars,Sort)),
+    sort_or_polyvar_from_dolmen_sort(OutSort,PolyVars,OSort),
+    (Poly == [] ->
+        Term = 'declare-fun'(FId,ISorts,OSort)
+    ;   Term = 'declare-poly-fun'(FId,ISorts,OSort)),
     add_declared_fun(FId,ISorts,OSort).
 dolmen_to_colibri_term(decl([type_decl(id(SIdSort, _, base), Ar)]),
                        Term) ?-
     !,
     atom_string(IdSort,SIdSort),
     Term = 'declare-sort'(IdSort,Ar).
-dolmen_to_colibri_term(term_def(id(Id,_,_),
-                                fun(_,DInSorts,DOutSort),
-                                _,
+dolmen_to_colibri_term(def([term_def(id(Id,_,_),
+                                % _Poly pas == a Poly !!!
+                                fun(_Poly,DInSorts,DOutSort),
+                                Poly,
                                 DFormals,
-                                _,
-                                DTerm),
+                                Poly,
+                                DTerm)]),
                        Term) ?- !,
     fun_id_from_dolmen_id(Id,FId),
-    formals_from_dolmen_formals(DFormals,Formals),
-    sort_from_dolmen_sort(DOutSort,OutSort),
-    term_from_dolmen_term(DTerm,Def),
+    make_poly_vars(Poly,PolyVars),
+    formals_from_dolmen_formals(DFormals,PolyVars,Formals),
+    sort_or_polyvar_from_dolmen_sort(DOutSort,PolyVars,OutSort),
+    term_from_dolmen_term(DTerm,PolyVars,Def),
     Term = 'define-fun'(FId,Formals,OutSort,Def).
 dolmen_to_colibri_term(hyp(DTerm),Term) ?- !,
-    term_from_dolmen_term(DTerm,Hyp),
+    term_from_dolmen_term(DTerm,[],Hyp),
     remove_upper_as(Hyp,NHyp,_),
     flatten_and_assert(NHyp,Term).
-%    Term = assert(Hyp).
-dolmen_to_colibri_term(type_def(_),Term) ?- !,
+dolmen_to_colibri_term(def([type_def(_)]),Term) ?- !,
     % deja substitue, on peut l'ignorer normalement !
     Term = assert(true).
 
+make_poly_vars(Poly,PolyVars) :-
+    (foreach(Sort,Poly),
+     fromto([],IPV,OPV,PolyVars) do
+        (Sort = id(IdPoly,_,_) ->
+            OPV = [(IdPoly,VPoly)|IPV]
+        ;   OPV = IPV)).
+    
+
 flatten_and_assert(and(LHyp),LAssert) ?- !,
     (foreach(Hyp,LHyp),
      foreach(Assert,LAssert0) do
@@ -155,6 +175,17 @@ check_overloaded(colibri_ln_real,colibri_ln) :- !.
 check_overloaded(colibri_ln_fp,colibri_ln) :- !.
 check_overloaded(Fun,Fun).
 
+sort_or_polyvar_from_dolmen_sort(InSort,[],Sort) ?- !,
+    sort_from_dolmen_sort(InSort,Sort).
+sort_or_polyvar_from_dolmen_sort(InSort,PolyVars,Sort) :-
+    findall((VarId,P),cgiveInstanceAndPath(var(_),InSort,VarId,P),VarIdPaths),
+    (foreach((var(id(Id,_,_)),Path),VarIdPaths),
+     fromto(InSort,IIS,OIS,NInSort),
+     param(PolyVars) do
+        once member((Id,VarId),PolyVars),
+        creplace_at_path_in_term(Path,IIS,poly(VarId),OIS)),
+    sort_from_dolmen_sort(NInSort,Sort).
+    
 sort_from_dolmen_sort(app(id(SSort, _, DSort), ArgSorts),Sort) ?- !,
     (DSort == base ->
         atom_string(Sort0,SSort)
@@ -165,50 +196,75 @@ sort_from_dolmen_sort(app(id(SSort, _, DSort), ArgSorts),Sort) ?- !,
          foreach(ASort,ASorts) do
             sort_from_dolmen_sort(ArgSort,ASort)),
         Sort =.. [Sort0|ASorts]).
+sort_from_dolmen_sort(Var,Var).
 
-formals_from_dolmen_formals([],[]).
+formals_from_dolmen_formals([],_,[]).
 formals_from_dolmen_formals([formal(id(Id,_,_),DSort)|DFormals],
-                            Formals) ?-
+                            PolyVars,Formals) ?-
     fun_id_from_dolmen_id(Id,FId),
-    sort_from_dolmen_sort(DSort,Sort),
+    sort_or_polyvar_from_dolmen_sort(DSort,PolyVars,Sort),
     Formals = [(FId,Sort)|EFormals],
-    formals_from_dolmen_formals(DFormals,EFormals).
+    formals_from_dolmen_formals(DFormals,PolyVars,EFormals).
 
 
 % une variable definie par un declare-fun
-term_from_dolmen_term(var(id(Id,_,_)),Term) ?- !,
+term_from_dolmen_term(var(id(Id,_,_)),_,Term) ?- !,
     fun_id_from_dolmen_id(Id,Term).
 % les constantes
-term_from_dolmen_term(app(id(SId,_,TId), [], []),Term) ?- !,
+term_from_dolmen_term(app(id(SId,_,TId), [], []),_PolyVars,Term) ?- !,
     (TId \== base ->
         term_from_dolmen_const(TId,Term)
     ;   fun_id_from_dolmen_id(SId,Term)).
 % les applications de fonctions
-term_from_dolmen_term(app(id(Id, _, TId), _Poly, DTerms),Term) ?- !,
+term_from_dolmen_term(app(id(Id,_,TId),Poly,DTerms),OldPolyVars,Term) ?- !,
     fun_id_from_dolmen_id(Id,CId),
+    (OldPolyVars == [] ->
+        make_poly_vars(Poly,PolyVars)
+    ;   PolyVars = OldPolyVars),
     (foreach(DTerm,DTerms),
-     foreach(CTerm,CTerms) do
-        term_from_dolmen_term(DTerm,CTerm)),
+     foreach(CTerm,CTerms),
+     param(PolyVars) do
+        term_from_dolmen_term(DTerm,PolyVars,CTerm)),
     build_cterm(CId,TId,CTerms,Term).
 % les autres
-term_from_dolmen_term(binder(Binder,DTerm),Term) ?- !,
+term_from_dolmen_term(binder(Binder,DTerm),OldPolyVars,Term) ?- !,
     functor(Binder,FBinder,_),
     (FBinder == letin ->
+        % A revoir pour les PolyVars !!!
         arg(1,Binder,DPairs),
         FTerm = let,
         (foreach([id(SId,_,_),SIdDef],DPairs),
-         foreach((Id,IdDef),CPairs) do
+         foreach((Id,IdDef),CPairs),
+         param(PolyVars) do
             atom_string(Id,SId),
-            term_from_dolmen_term(SIdDef,IdDef)),
-        term_from_dolmen_term(DTerm,CTerm),
+            term_from_dolmen_term(SIdDef,OldPolyVars,IdDef)),
+        term_from_dolmen_term(DTerm,OldPolyVars,CTerm),
         Term =.. [FTerm,CPairs,CTerm]
-    ;   arg(2,Binder,DFormals),
-        formals_from_dolmen_formals(DFormals,Formals),
-        term_from_dolmen_term(DTerm,CTerm),
-        Term =.. [FBinder,Formals,CTerm]).
-term_from_dolmen_term(term(DSort,DTerm),Term) ?- !,
-    sort_from_dolmen_sort(DSort,Sort),
-    term_from_dolmen_term(DTerm,CTerm),
+    ;   % forall ou exists
+        arg(1,Binder,Poly),
+        make_poly_vars(Poly,PolyVars0),
+        % Les nouvelles PolyVars0 masquent les anciennes
+        % de meme Id
+        (foreach((Id,IdVar),OldPolyVars),
+         fromto(PolyVars0,IPV,OPV,PolyVars),
+         param(PolyVars0) do
+            (member((Id,_),PolyVars0) ->
+                OPV = IPV
+            ;   OPV = [(Id,IdVar)|IPV])),
+        arg(2,Binder,DFormals),
+        ((FTerm == forall,
+          Poly \== [],
+          DFormals == [])
+        ->
+            Formals = []
+        ;   formals_from_dolmen_formals(DFormals,PolyVars,Formals)),
+        term_from_dolmen_term(DTerm,PolyVars,CTerm),
+        (Formals == [] ->
+            Term = CTerm
+        ;   Term =.. [FBinder,Formals,CTerm])).
+term_from_dolmen_term(term(DSort,DTerm),PolyVars,Term) ?- !,
+    sort_or_polyvar_from_dolmen_sort(DSort,PolyVars,Sort),
+    term_from_dolmen_term(DTerm,PolyVars,CTerm),
     (Sort == 'Int' ->
         Term = as(CTerm,Sort)
     ;   ((Sort == 'Real',
@@ -219,9 +275,17 @@ term_from_dolmen_term(term(DSort,DTerm),Term) ?- !,
         ->
             % Melange Int et Real
             Term = ITerm
-        ;   Term = as(CTerm,Sort))).
-term_from_dolmen_term(term(DSort,_Poly,DTerm),Term) ?- !,
-    term_from_dolmen_term(term(DSorts,DTerm),Term).
+        ;   ((nonvar(Sort),
+              Sort = poly(NSort))
+            ->
+                true
+            ;   NSort = Sort),
+            Term = as(CTerm,NSort))).
+term_from_dolmen_term(term(DSort,Poly,DTerm),OldPolyVars,Term) ?- !,
+    (OldPolyVars == [] ->
+        make_poly_vars(Poly,PolyVars)
+    ;   PolyVars = OldPolyVars),
+    term_from_dolmen_term(term(DSorts,DTerm),PolyVars,Term).
 % COLIBRI builtins ????
 
 term_from_dolmen_const(true,Term) ?- !,
@@ -305,8 +369,7 @@ get_col_id('GreaterOrEqual',_,>=) :- !.
 get_col_id('Divisible',_,divisible) :- !.
 
 get_col_id(_,bitv_concat,concat) :- !.
-% vicieux, I et J inverses
-get_col_id(_,bitv_extract(J,I),[extract,I,J]) :- !.
+get_col_id(_,bitv_extract(I,J),[extract,I,J]) :- !.
 get_col_id(SR,bitv_repeat,[repeat,N]) :- !,
     atom_string(SR,SSR),
     once append_strings("bitv_repeat_",SN,SSR),
@@ -381,11 +444,11 @@ get_col_id('to_fp',ieee_format_to_fp(EB,SB),[ieee_to_fp,EB,SB]) :- !.
 % Specialiser les autres to_fp ?
 get_col_id('to_fp',fp_to_fp(E,S,EB,SB),[to_fp,EB,SB]) :- !.
 get_col_id('to_fp',real_to_fp(EB,SB),[to_fp,EB,SB]) :- !.
-get_col_id('to_fp',sbv_to_fp(Size,EB,SB),[to_fp,EB,SB]) :- !.
-get_col_id('to_fp',ubv_to_fp(Size,EB,SB),[to_fp_unsigned,EB,SB]) :- !.
-
-get_col_id('fp.to_ubv',to_ubv(EB,SB,Size),['fp.to_ubv',Size]) :- !.
-get_col_id('fp.to_sbv',to_sbv(EB,SB,Size),['fp.to_sbv',Size]) :- !.
+% c'est pas toujours bien rangé !!!!
+get_col_id('to_fp',sbv_to_fp(_,EB,SB),[to_fp,EB,SB]) :- !.
+get_col_id('to_fp',ubv_to_fp(_,EB,SB),[to_fp_unsigned,EB,SB]) :- !.
+get_col_id('fp.to_ubv',to_ubv(Size,_,_),['fp.to_ubv',Size]) :- !.
+get_col_id('fp.to_sbv',to_sbv(Size,_,_),['fp.to_sbv',Size]) :- !.    
 get_col_id('fp.to_real',_,'fp.to_real') :- !.
 
 get_col_id('Select',_,select) :- !.
@@ -417,7 +480,7 @@ get_real_int_type_from_logic(Type) :-
     ((Type0 == int,
       getval(real_for_int,1)@eclipse)
     ->
-        Type = real
+        Type = real_int
     ;   Type = Type0).
 get_real_int_type_from_logic(_).
 
@@ -463,7 +526,7 @@ check_sat0 :-
             suspensions(LSusp),
             (foreach(Susp,LSusp) do
                 get_suspension_data(Susp,goal,Goal),
-                (Goal = uninterp(_,_,_) ->
+                (Goal = uninterp(_,_,_,_) ->
                     % on garde les uninterp pour check_sat_vars
                     true
                 ;   kill_suspension(Susp)),
@@ -660,8 +723,11 @@ get_model :-
     ->
         hash_list(HNV,Ks,Vs),
         (foreach(K,Ks),
-         foreach((Type,V),Vs),
+         foreach((Type0,V),Vs),
          foreach((K,V),Vars) do
+            (real_type(Type0,Type) ->
+                true
+            ;   Type = Type0),
             ((Type \= sort(_),
               Type \== rnd,
               Type \= array(_,_),
@@ -722,7 +788,10 @@ get_value(LExpr) :-
     ->
         hash_list(KVs,Ks,Vs),
         (foreach(K,Ks),
-         foreach((Type,V),Vs) do
+         foreach((Type0,V),Vs) do
+            (real_type(Type0,Type) ->
+                true
+            ;   Type = Type0),
             ((Type \= sort(_),
               Type \== rnd,
               Type \= array(_,_),
@@ -743,28 +812,35 @@ get_value(LExpr) :-
                 ->
                     inst_type(Type,V)
                 ;   true))),
-        (foreach((OExpr,Type,Expr),LExpr),
+        (foreach((OExpr,Type0,Expr),LExpr),
          foreach(Var,Vars),
          foreach((OType,Res),Values) do
+            (real_type(Type0,Type) ->
+                true
+            ;   Type = Type0),
             (OExpr = as(NExpr,OType) ->
                 true
             ;   NExpr = Expr,
                 OType = Type),
             remove_all_as(NExpr,NExpr1),
-            build_sexpr(NExpr1,Var),
+            build_sexpr(NExpr1,Var0),
+            (var(OType) ->
+                true
+            ;   build_sexpr(OType,SOType),
+                concat_string(["(as ",Var0," ",SOType,")"],Var)),
             functor(Type,FType,_),
             (occurs(FType,(bool,int,uint,sort,rnd,array)) ->
                 IType = int,
                 int_vars(Type,Res),
                 as(Expr,Type) #= Res
             ;   IType = Type,
-                (Type == float_double ->
+                (IType == float_double ->
                     NType = double
-                ;   (Type == float_simple ->
+                ;   (IType == float_simple ->
                         NType = float
-                    ;   Type == real,
-                        NType = Type)),
-                real_vars(NType,Res),
+                    ;   IType == real,
+                        NType = IType)),
+                real_vars(Type,Res),
                 as(Expr,Type) $= Res),
             ((nonvar(Res);
               %FType == sort;
@@ -820,17 +896,16 @@ dump_smt_binding(Vars,Values) :-
     writeln(output,")").
 
 
-%dump_type_val(bool,Val0,Val) ?- !,
 dump_type_val('Bool',Val0,Val) ?- !,
     (Val0 == 1 ->
-        Val = true
-    ;   Val = false).
+        Val = "true"
+    ;   Val = "false").
 dump_type_val('Int',Val0,Val) ?- !,
     (float(Val0) ->
         % simulation real/int
-        integer(Val0,Val)
-    ;   Val = Val0).
-%dump_type_val(real,Val0,Val) ?- !,
+        integer(Val0,Val1),
+        number_string(Val1,Val)
+    ;   number_string(Val0,Val)).
 dump_type_val('Real',Val0,Val) ?- !,
     (var(Val0) ->
         (known_real_box(Val0,SNum,SDen) ->
@@ -857,26 +932,39 @@ dump_type_val('Real',Val0,Val) ?- !,
         (Den == 1 ->
             concat_string([Num,".0"],Val)
         ;   concat_string(["(/ ",Num,".0 ",Den,".0)"],Val))).
-%dump_type_val(float_simple,Val0,Val) ?- !,
 dump_type_val('_'('FloatingPoint',8,24),Val0,Val) ?- !,
     (Val0 == nan ->
         concat_string(["(_ NaN ",8," ",24,")"],Val)
     ;   get_raw_uint_from_float(float_simple,Val0,I),
         concat_string(["((_ to_fp ",8," ",24,") (_ bv",I," ",32,"))"],Val)).
-%dump_type_val(float_double,Val0,Val) ?- !,
 dump_type_val('_'('FloatingPoint',11,53),Val0,Val) ?- !,
     (Val0 == nan ->
         concat_string(["(_ NaN ",11," ",53,")"],Val)
     ;   get_raw_uint_from_float(float_double,Val0,I),
         concat_string(["((_ to_fp ",11," ",53,") (_ bv",I," ",64,"))"],Val)).
-%dump_type_val(uint(Size),Val0,Val) ?- !,
 dump_type_val('_'('BitVec',Size),Val0,Val) ?- !,
     concat_string(["(_ bv",Val0," ",Size,")"],Val).
-%dump_type_val(array(TI,TE),Val,SVal) ?- !,
 dump_type_val('Array'(TI,TE),Val,SVal) ?- !,
     dump_array(TI,TE,Val,SVal).
-% int ou sort
-dump_type_val(Type,Val,Val).
+% sorte composée ou non
+dump_type_val(OType,Val,SVal) :-
+    atom_string(Val,STVal),
+    term_string(TVal,STVal),
+    TVal =.. [':',Type,Cpt],
+    build_end_val_from_old_type(OType,SEndVal),
+    concat_string(["|val",Cpt,":",SEndVal,"|"],SVal).
+
+build_end_val_from_old_type([],[]) :- !.
+build_end_val_from_old_type([OType|OTypes],[NType|NTypes]) :- !,
+    build_end_val_from_old_type(OType,NType),
+    build_end_val_from_old_type(OTypes,NTypes).
+build_end_val_from_old_type(OType,NType) :-
+    (atom(OType) ->
+        atom_string(OType,NType)
+    ;   OType =.. [F|OArgs],
+        build_end_val_from_old_type(OArgs,NArgs),
+        join_string(NArgs," ",SNargs),
+        concat_string(["(",F," ",SNargs,")"],NType)).
 
 dump_array(TI,TE,const_array(TII,TEE,Const),Str) ?- !,
     dump_const_array(TI,TE,Const,Str).
@@ -897,8 +985,9 @@ dump_array(TI,TE,V,SV) :-
     dump_const_array(TI,TE,_DefE,SV).
 
 dump_array_type('Array'(TI,TE),SAT) :- !,
+    dump_array_type(TI,STI),
     dump_array_type(TE,STE),
-    concat_string(["(Array ",TI," ",STE,")"],SAT).
+    concat_string(["(Array ",STI," ",STE,")"],SAT).
 dump_array_type('_'('BitVec',Size),SType) :- !,
     concat_string(["(_ BitVec ",Size,")"],SType).
 dump_array_type(Type,SType) :-
@@ -944,24 +1033,34 @@ array_const_elt('_'('FloatingPoint',EB,SB),S) :- !,
                   S).
 array_const_elt('Array'(SI,SE),S) ?- !,
     dump_const_array(SI,SE,_Def,S).
-array_const_elt(_,S) :-
-    get_variable_atom(V,S0),
-    concat_string(["|",S0,"|"],S).
+array_const_elt(Sort,S) :-
+    get_sort_vals(Sort,[Val|Vals]),
+    dump_type_val(Sort,Val,S).
 
 dump_smt_model(Vars) :-
     set_flag(print_depth,1000),
+    getval(sorts,HSorts),
     getval(declared_funs,DFs-[]),
     writeln(output,"(model"),
+    (HSorts == 0 ->
+        true
+    ;   hash_list(HSorts,Ks,Vs),
+        (foreach(Sort,Ks),
+         foreach((Ar,SortVals),Vs) do
+            concat_string([" (declare-sort ",Sort," ",Ar,")"],Ds),
+            writeln(output,Ds))),
     (foreach((VN,InSorts,OutSort),DFs),
      fromto([],IU,OU,Uninterps),
      fromto(Vars,InVars,OutVars,NVars) do
         (InSorts == [] ->
-            OU = IU,
-            once member_begin_end((VN,Val0),InVars,OutVars,End,End),
-            dump_type_val(OutSort,Val0,Val),
-            dump_smt_sort(OutSort,SOutSort),
-            concat_string([" (define-fun ",VN," () ",SOutSort," ",Val,")"],Str),
-            writeln(output,Str)
+            (member_begin_end((VN,Val0),InVars,OutVars,End,End) ->
+                OU = IU,
+                dump_type_val(OutSort,Val0,Val),
+                dump_smt_sort(OutSort,SOutSort),
+                concat_string([" (define-fun ",VN," () ",SOutSort," ",Val,")"],Str),
+                writeln(output,Str)
+            ;   OutVars = InVars,
+                OU = [(VN,InSorts,OutSort)|IU])
         ;   OutVars = InVars,
             OU = [(VN,InSorts,OutSort)|IU])),
     factorize_and_dump_uninterps(Uninterps),
@@ -979,53 +1078,88 @@ dump_smt_sort(Sort,NSort) :-
 
 factorize_and_dump_uninterps([]).
 factorize_and_dump_uninterps([(VN,InSorts,OutSort)|Uninterps]) :-
-    attached_suspensions(VN,LSusp),
-    (LSusp \== [] ->
-        findall((Ins,Out),
-                (member(Susp,LSusp),
-                 get_suspension_data(Susp,goal,uninterp(VN,Ins,Out)),
-                 kill_suspension(Susp)),
-                Profiles),
-        (foreach(Is,InSorts),
-         foreach((SIV,SIs),NInSorts),
-         foreach(InSorted,InSorteds) do
-            dump_smt_sort(Is,SIs),
-            set_var_name(IV,"ColVar"),
-            get_var_name(IV,SIV),
-            concat_string(["(",SIV," ",SIs,")"],InSorted)),
-        join_string(InSorteds," ",InProf0),
-        concat_string(["(",InProf0,")"],InProf),
-        dump_smt_sort(OutSort,NOutSort),
-        array_const_elt(OutSort,Default),
-        dump_smt_uninterps(Profiles,NInSorts,OutSort,Default,Def),
-        concat_string([" (define-fun ",VN," ",InProf," ",NOutSort," ",Def,")"],DF),
-        writeln(output,DF),
-        factorize_and_dump_uninterps(Uninterps)
-    ;   true).
-
-dump_smt_uninterps([],_,_,Default,Default).
-dump_smt_uninterps([(Ins,Out)|Profiles],InSorts,OutSort,Default,SUninterp) :-
-    (foreach(In,Ins),
-     foreach((SV,IS),InSorts),
-     foreach(Eq,Eqs) do
-        dump_type_val(IS,In,SIn),
-        concat_string(["(= ",SV," ",SIn,")"],Eq)),
-    join_string(Eqs," ",SAE0),
-    (Ins = [_,_|_] ->
-        concat_string(["(and ",SAE0,")"],SAE)
-    ;   SAE = SAE0),
+    (ground((InSorts,OutSort)) ->
+        (foreach(Sort,[OutSort|InSorts]),
+         foreach(ISort,[IOut|IIns]) do
+            get_type_from_sort(Sort,ISort,_)),
+        uninterp_trigger(VN,IIns,IOut,Trigger),
+        attached_suspensions(Trigger,LSusp),
+        (LSusp \== [] ->
+            findall((Ins,Out),
+                    (member(Susp,LSusp),
+                     get_suspension_data(Susp,goal,uninterp(VN,Trigger,Ins,Out)),
+                     kill_suspension(Susp)),
+                    Profiles),
+            (foreach(Is,InSorts),
+             foreach((SIV,SIs),NInSorts),
+             foreach(InSorted,InSorteds) do
+                dump_smt_sort(Is,SIs),
+                set_var_name(IV,"ColVar"),
+                get_var_name(IV,SIV),
+                concat_string(["(",SIV," ",SIs,")"],InSorted)),
+            join_string(InSorteds," ",InProf0),
+            concat_string(["(",InProf0,")"],InProf),
+            dump_smt_sort(OutSort,NOutSort),
+            dump_smt_uninterps(Profiles,NInSorts,OutSort,Def),
+            concat_string([" (define-fun ",VN," ",InProf," ",NOutSort," ",Def,")"],DF),
+            writeln(output,DF)
+        ;   true)
+    ;   concat_string([";; Warning: instanciations of polymorphic"
+                       " function ",VN," are ignored."],Warn),
+        writeln(output,Warn)),
+    factorize_and_dump_uninterps(Uninterps).
+
+% Constante
+dump_smt_uninterps([],_,OutSort,Default) :-
+    ((get_type_from_sort(OutSort,Type,_),
+      Type = sort(_))
+    ->
+        get_sort_vals(OutSort,[Val|_]),
+        dump_type_val(OutSort,Val,Default)
+    ;   array_const_elt(OutSort,Default)).
+dump_smt_uninterps([(Ins,Out)|Profiles],InSorts,OutSort,SUninterp) :-
+    % Variable possible ici et dans les Ins !!!
+    ((var(Out),
+      get_type_from_sort(OutSort,OutType0,_),
+      (OutType0 == real_int ->
+          OutType = real
+      ;   OutType = OutType0))
+    ->
+        inst_type(OutType,Out)
+    ;   true),
     dump_type_val(OutSort,Out,SOut),
-    dump_smt_uninterps(Profiles,InSorts,OutSort,Default,NSUninterp),
-    (string(SOut) ->
-        NSOut = SOut
-    ;   (atomic(SOut) ->
-            (number(SOut) ->
-                number_string(SOut,NSOut)
-            ;   atom_string(SOut,NSOut))
-        ;   NSOut = SOut)),
-    (NSUninterp == NSOut ->
-        SUninterp = NSOut
-    ;   concat_string(["(ite ",SAE," ",SOut," ",NSUninterp,")"],SUninterp)).
+    (Profiles = [] ->
+        % On a fini, on prend SOut sans ite
+        SUninterp = SOut
+    ;   (foreach(In,Ins),
+         foreach((SV,IS),InSorts),
+         foreach(Eq,Eqs) do
+            (var(In) ->
+                ((functor(IS,FIS,Ar),
+                  known_sort(FIS,Ar,_))
+                ->
+                    NIS = sort(IS)
+                ;   NIS = IS),
+                inst_type(NIS,In)
+            ;   true),
+            dump_type_val(IS,In,SIn),
+            concat_string(["(= ",SV," ",SIn,")"],Eq)),
+        join_string(Eqs," ",SAE0),
+        (Ins = [_,_|_] ->
+            concat_string(["(and ",SAE0,")"],SAE)
+        ;   SAE = SAE0),
+        (var(Out) ->
+            ((functor(OutSort,FO,Ar),
+              known_sort(FO,Ar,_))
+            ->
+                NOutSort = sort(OutSort)
+            ;   NOutSort = OutSort),
+            inst_type(NOutSort,Out)
+        ;   true),
+        dump_smt_uninterps(Profiles,InSorts,OutSort,NSUninterp),
+        (NSUninterp == SOut ->
+            SUninterp = SOut
+        ;   concat_string(["(ite ",SAE," ",SOut," ",NSUninterp,")"],SUninterp))).
 
 
 known_real_box(Box,SNum,SDen) :-
@@ -1141,23 +1275,15 @@ init_binding :-
     setval(quantifier,0),
     setval(declared_funs,E-E).
 
-define_smt_func(F,Args,Type,Expr) :-
-    length(Args,Ar),
+define_smt_func(F,TypedArgs,Type,Expr) :-
+    length(TypedArgs,Ar),
     getval(defined_funcs,Hfuncs),
-    (hash_contains(Hfuncs,F/Ar) ->
-        concat_string(["(error \"Already defined function:",F,/,Ar,"\")"],Err),
-        writeln(error,Err),
-        exit_block(syntax)
-    ;   hash_set(Hfuncs,F/Ar,(Args,Type,Expr))).
+    hash_set(Hfuncs,F/Ar,(TypedArgs,Type,Expr)).
 
-define_smt_uifunc(F,Types,Type,RI) :-
+define_smt_uifunc(F,Ar,RI) :-
     length(Types,Ar),
     getval(defined_funcs,Hfuncs),
-    (hash_contains(Hfuncs,F/Ar) ->
-        concat_string(["(error \"Already defined function:",F,/,Ar,"\")"],Err),
-        writeln(error,Err),
-        exit_block(syntax)
-    ;   hash_set(Hfuncs,F/Ar,(Types,Type:RI))).
+    hash_set(Hfuncs,F/Ar,RI).
     
 
 defined_smt_func(F/Ar,IArgs,Type,IExpr) :-
@@ -1168,55 +1294,51 @@ defined_smt_func(F/Ar,IArgs,Type,IExpr) :-
         writeln(error,Err),
         exit_block(syntax)),
     (Profile = (FArgs,FType,FIExpr) ->
-        (FType = Type ->
-            true
-        ;   concat_string(["(error \"Type mismatch in call to ",F,/,Ar,"\")"],Err),
-            writeln(error,Err),
-            exit_block(syntax)),
-        % on verifie les types en liant les parametres actuels/formels
+        % on lie les parametres actuels/formels
         (foreach((IArg,IArgType),IArgs),
-         foreach((FIArg,FArgType),FArgs),
-         fromto(FIExpr,IE,OE,IExpr),
-         param(F,Ar) do
-            (IArgType = FArgType ->
-                % On doit remplacer toutes les occurences de FIArg
-                % par IArg
-                findall(P,
-                        cgiveVarInstancePath(FIArg,IE,[],P),
-                        Paths),
-                (foreach(P,Paths),
-                 fromto(IE,IIE,OOE,OE),
-                 param(IArg) do
-                    creplace_at_path_in_term(P,IIE,IArg,OOE))
-            ;   concat_string(["(error \"Argument type mismatch in call to ",F,/,Ar,"\")"],Err),
-                writeln(error,Err),
-                exit_block(syntax)))
-    ;   Profile = (FTypes,FType:RI),
-        (FType = Type ->
-            true
-        ;   concat_string(["(error \"Type mismatch in call to ",F,/,Ar,"\")"],Err),
-            writeln(error,Err),
-            exit_block(syntax)),
-        % Symbole non-interprete
-        % on verifie les types
+         foreach((FIArg,FIArgType),FArgs),
+         fromto(FIExpr,IE,OE,IExpr0) do
+            % On doit remplacer toutes les occurences de FIArg par IArg
+            % sans faire une unification (pour les autres appels)
+            % Comme defined_funcs est une ref, on garde bien les
+            % variables globalles de FIExpr
+            findall(ATP,
+                    cgiveVarInstancePath(FIArgType,IE,[],ATP),
+                    ATPaths),
+            (foreach(ATP,ATPaths),
+             fromto(IE,IE0,OE0,OE1),
+             param(IArgType) do
+                creplace_at_path_in_term(ATP,IE0,IArgType,OE0)),
+            findall(P,
+                    cgiveVarInstancePath(FIArg,OE1,[],P),
+                    Paths),
+            (foreach(P,Paths),
+             fromto(OE1,IIE,OOE,OE),
+             param(IArg) do
+                creplace_at_path_in_term(P,IIE,IArg,OOE))),
+        findall(PT,
+                cgiveVarInstancePath(FType,IExpr0,[],PT),
+                TPaths),
+        (foreach(PT,TPaths),
+         fromto(IExpr0,NIIE,NOOE,IExpr),
+         param(Type) do
+            creplace_at_path_in_term(PT,NIIE,Type,NOOE))
+    ;   % Symbole non-interprete
         (foreach((IArg,IArgType),IArgs),
-         foreach(as(IArg,IArgType),NIArgs),
-         foreach(AFType,FTypes),
-         param(F,Ar) do
-            (IArgType = AFType ->
-                true
-            ;   concat_string(["(error \"Argument type mismatch in call to ",F,/,Ar,"\")"],Err),
-                writeln(error,Err),
-                exit_block(syntax))),
+         foreach(NIArg,NIArgs) do
+            ((nonvar(IArg),
+              IArg = as(_,_))
+            ->
+                NIArg = IArg
+            ;   NIArg = as(IArg,IArgType))),
         Term =.. [F|NIArgs],
-        (RI == real_int ->
+        (Profile == real_int ->
             % simulation des entiers non bornes
-            IExpr = as(setIntegral(uninterp(Term)),Type)
+%            IExpr = as(setIntegral(uninterp(Term)),Type)
+            IExpr = as(setIntegral(as(uninterp(Term),real_int)),real_int)
         ;   IExpr = as(uninterp(Term),Type))).
 
 
-
-
 add_seen_expr(let(_,_),_,_) ?- !.
 add_seen_expr(Expr,IExpr,Type) :-
     getval(in_let,0),
@@ -1252,33 +1374,64 @@ check_seen_expr(Expr,IExpr,Type) :-
 known_sort(F,Ar,Sorts) :-
     getval(sorts,HSorts),
     HSorts \== 0,
-    hash_get(HSorts,F,(Ar,Sorts,_)).
+    hash_get(HSorts,F,(Ar,SortVals)),
+    (member((Sorts,_,_),SortVals) ->
+        true
+    ;   length(Sorts,Ar)).
 add_sort(F,Ar,Sorts) :-
     getval(sorts,HSorts0),
     (HSorts0 == 0 ->
         hash_create(HSorts),
         setval(sorts,HSorts)
     ;   HSorts = HSorts0),
-    hash_set(HSorts,F,(Ar,Sorts,0,[])).
-new_sort_val(F,Ar) :-
+    hash_set(HSorts,F,(Ar,[])).
+new_sort_val(Sort) :-
     getval(sorts,HSorts),
-    hash_get(HSorts,F,(Ar,Sorts,Cpt,Vals)),
-    concat_atom([F,'_',Cpt],Val),
+    functor(Sort,F,Ar),
+    hash_get(HSorts,F,(Ar,SortVals)),
+    Sort =.. [_|Sorts0],
+    remove_sort_func(Sorts0,Sorts),
+    ((member_begin_end((CSorts,Cpt,Vals),SortVals,NSortVals,PEnd,End),
+      CSorts == Sorts)
+    ->
+        PEnd = [(Sorts,NCpt,[Val|Vals])|End]
+    ;   Cpt = 0,
+        NSortVals = [(Sorts,NCpt,[Val])|SortVals]),
+    SortTerm =.. [F|Sorts],
+    term_string(SortTerm:Cpt,SVal),
+    atom_string(Val,SVal),
     NCpt is Cpt + 1,
-    hash_set(HSorts,F,(Ar,Sorts,NCpt,[Val|Vals])).
-
-new_index_elem_val(sort(F),Var) ?- !,
+    hash_set(HSorts,F,(Ar,NSortVals)).
+
+
+remove_sort_func([],[]) :- !.
+remove_sort_func([Sort|Sorts],[NSort|NSorts]) :- !,
+    remove_sort_func(Sort,NSort),
+    remove_sort_func(Sorts,NSorts).
+remove_sort_func(Sort,NSort) :-
+    Sort =.. [F|Sorts],
+    (F == sort ->
+        Sorts = [Sort0],
+        remove_sort_func(Sort0,NSort)
+    ;   remove_sort_func(Sorts,NSorts),
+        NSort =.. [F|NSorts]).
+
+new_index_elem_val(sort(Sort),Var) ?- !,
     ((atomic(Var),get_binding(Var,_,_);
       nonvar(Var),Var = select(_,_))
     ->
         true
-    ;   new_sort_val(F,0)).
+    ;   new_sort_val(Sort)).
 new_index_elem_val(_,_).
 
-
-get_sort_vals(F,Ar,Vals) :-
+get_sort_vals(Sort,Vals) :-
     getval(sorts,HSorts),
-    hash_get(HSorts,F,(Ar,Sorts,_,Vals)).
+    functor(Sort,F,Ar),
+    Sort =.. [_|Sorts0],
+    remove_sort_func(Sorts0,Sorts),
+    hash_get(HSorts,F,(Ar,SortVals)),
+    once (member((CSorts,_,Vals),SortVals),
+          CSorts == Sorts).
 
 add_binding(Var,Type,Val) :-
     getval(binding,HBinding),
@@ -1525,7 +1678,8 @@ smt_interp0('declare-sort'(F,Ar),true,bool) :- !,
         (known_sort(F,Ar,_) ->
             concat_string(["Already declared/defined sort ",F,"/",Ar],Mess),
             unsupported_error(Mess)
-        ;   add_sort(F,Ar,[]))
+        ;   length(Sorts,Ar),
+            add_sort(F,Ar,Sorts))
     ;   concat_string(["Wrong arity for sort ",F],Mess),
         writeln(output,Mess),
         exit_block(syntax)).
@@ -1549,14 +1703,14 @@ smt_interp0('define-sort'(F,Sorts,Def),true,bool) :- !,
             Val = Type
         ;   unsupported_error("define-sort"))).
 
+smt_interp0('define-poly-fun'(F,TypedVars,Sort,Expr),Decl,bool) :- !,
+    % A mettre en declare-poly-fun si pbs !!!!
+    smt_interp0('define-fun'(F,TypedVars,Sort,Expr),Decl,bool).
 smt_interp0('define-fun'(F,TypedVars,Sort,Expr),Decl,bool) :- !,
-
     ((TypedVars == [],
       (Sort = 'Array'(_,_);
        getval(inline_def,0)))
     ->
-
-%    (TypedVars == [] ->
         % On cree une fonction constante
         smt_interp('define-const'(F,Sort,Expr),Decl0,bool),
         (Decl0 == true ->
@@ -1579,11 +1733,9 @@ smt_interp0('define-fun'(F,TypedVars,Sort,Expr),Decl,bool) :- !,
         ->
             (match_isFinite(Expr,Arg) ->
                 smt_interp(Arg,IArg,VType),
-                %add_as(VType,IArg0,IArg),
                 IExpr = isFinite(IArg)
             ;   (match_isObvious(Expr,Arg) ->
                     smt_interp(Arg,IArg,VType),
-                    %add_as(VType,IArg0,IArg),
                     IExpr = isFinite(IArg) and neg(isSubnormal(IArg))
                 ;   smt_interp(Expr,IExpr,Type)))
         ;   smt_interp(Expr,IExpr,Type)),
@@ -1592,6 +1744,7 @@ smt_interp0('define-fun'(F,TypedVars,Sort,Expr),Decl,bool) :- !,
         Decl = true,
         check_eval(Type,IExpr,Res),
         ((TypedArgs == [],
+          ground(Type),
           ground(Res))
         ->
             add_binding(F,Type,Res)
@@ -1617,15 +1770,22 @@ smt_interp0('define-const'(F,Sort,Expr),Decl,bool) :- !,
 smt_interp0('declare-const'(Id,Sort),Decl,bool) :- !,
     smt_interp0('declare-var'(Id,Sort),Decl,bool).
 
+smt_interp0('declare-poly-fun'(Id,Sorts,Sort),Decl,bool) :- !,
+    % smt_interp0('declare-fun'(Id,Sorts,Sort),Decl,bool).
+    get_type_from_sort(Sort,_Type,RI),
+    (foreach(SId,Sorts),
+     foreach(VType,Types) do
+        get_type_from_sort(SId,VType,_)),
+    Decl = true,
+    length(Sorts,Ar),
+    define_smt_uifunc(Id,Ar,RI).
+
 smt_interp0('declare-fun'(Id,Sorts,Sort),Decl,bool) :- !,
-    % On cree une variable
     (Sorts \== [] ->
-        get_type_from_sort(Sort,Type,RI),
-        (foreach(SId,Sorts),
-         foreach(VType,Types) do
-            get_type_from_sort(SId,VType,_)),
+        get_type_from_sort(Sort,_Type,RI),
         Decl = true,
-        define_smt_uifunc(Id,Types,Type,RI)
+        length(Sorts,Ar),
+        define_smt_uifunc(Id,Ar,RI)
     ;   % On cree une variable
         smt_interp0('declare-var'(Id,Sort),Decl,bool)).
 smt_interp0('declare-fun-rec'(Id,Sorts,Sort),Decl,bool) :- !,
@@ -1638,7 +1798,7 @@ smt_interp0('declare-var'(Id,Sort),Decl,bool) :- !,
     get_decl_type_from_sort(Sort,NVar,Decl,Type),
     add_binding(Id,Type,NVar),
     (known_sort(Sort,0,_) ->
-        new_sort_val(Sort,0)
+        new_sort_val(Sort)
     ;   true).
 smt_interp0('!'(Expr,':named',F),Var,Type) :- !,
     smt_interp(Expr,Val,Type),
@@ -1705,18 +1865,28 @@ smt_interp0(A,IA,Type) :-
     number(A),
     !,
     (nonvar(Type) ->
-        (Type == real ->
+        (occurs(Type,(real,real_int)) ->
             (integer(A) ->
                 rational(A,RA),
                 term_string(RA,SRA),
-                IA = realString(SRA)
+%                IA = realString(SRA)
+                IA = as(realString(SRA),real_int)
             ;   float(A), %??
                 IA = as(A,real))
         ;   Type == int,
             integer(A),
             IA = A)
-    ;   % le type sera resolu plus tard
-        IA = A).
+    ;   (integer(A) ->
+            (getval(real_for_int,1)@eclipse ->
+                Type = real_int,
+                rational(A,RA),
+                term_string(RA,SRA),
+%                IA = realString(SRA)
+                IA = as(realString(SRA),real_int)
+            ;   Type = int,
+                IA = A)
+        ;   % le type sera resolu plus tard
+            IA = A)).
 smt_interp0('_'(FCst,EB,SB),as(Val,Type),Type) :- !,
     fp_cst(FCst,EB,SB,Val,Type).
 smt_interp0(true,as(1,bool),bool) :- !.
@@ -1768,6 +1938,7 @@ smt_interp0(A xor B,IA xor IB,bool) :- !,
 smt_interp0(A => B,IA => IB,bool) :- !,
     smt_interp(A,IA,bool),
     smt_interp(B,IB,bool).
+% comparaisons
 smt_interp0(A < B,Comp,bool) :- !,
     smt_interp(A,IA0,Type),
     smt_interp(B,IB,Type),
@@ -1787,23 +1958,9 @@ smt_interp0(A <= B,Comp,bool) :- !,
         Comp = (IA #=< IB)
     ;   Comp = (IA $=< IB)).
 smt_interp0(A > B,Comp,bool) :- !,
-    smt_interp(A,IA0,Type),
-    smt_interp(B,IB,Type),
-    get_real_int_type_from_logic(Type),
-    add_as(Type,IA0,IA),
-    functor(Type,FType,_),
-    (occurs(FType,(bool,int,uint)) ->
-        Comp = (IA #> IB)
-    ;   Comp = (IA $> IB)).
+    smt_interp0(B < A,Comp,bool).
 smt_interp0(A >= B,Comp,bool) :- !,
-    smt_interp(A,IA0,Type),
-    smt_interp(B,IB,Type),
-    get_real_int_type_from_logic(Type),
-    add_as(Type,IA0,IA),
-    functor(Type,FType,_),
-    (occurs(FType,(bool,int,uint)) ->
-        Comp = (IA #>= IB)
-    ;   Comp = (IA $>= IB)).
+    smt_interp0(B <= A,Comp,bool).
 
 
 smt_interp0(ite(A,B,C),R,Type) :- !,
@@ -1825,9 +1982,11 @@ smt_interp0(ite(A,B,C),R,Type) :- !,
 smt_interp0(A = B,Eq,bool) :- !,
     smt_interp(A,IA0,Type),
     smt_interp(B,IB,Type),
+/*
     (var(Type) ->
         Type = int
     ;   true),
+*/
     add_as(Type,IA0,IA),
     ((A == B, VA = VB;
       ((number(IA0),VA = IA0;
@@ -1839,39 +1998,47 @@ smt_interp0(A = B,Eq,bool) :- !,
             Eq = as(1,bool)
         ;   Eq = as(0,bool))
     ;   ((real_type(Type,_);
-          Type = sort(S);
-          Type = array(TI,TE))
+          nonvar(Type),
+          (Type = sort(S);
+           Type = array(TI,TE)))
         ->
             (Type = array(_,_) ->
                 setval(keep_deltas_if_arrays,1)@eclipse
             ;   true),
-            ((nonvar(S),
-              not atomic(A))
-            ->
-                new_sort_val(S,0)
+            (nonvar(S) ->
+                % on peut avoir besoin de deux valeurs
+                (atomic(A) ->
+                    true
+                ;   new_sort_val(S)),
+                (atomic(B) ->
+                    true
+                ;   new_sort_val(S))
             ;   % on peut avoir besoin de 1 index et deux valeurs
                 (nonvar(TI) ->
                     ((TI = sort(SI),
                       not atomic(A))
                     ->
-                        new_sort_val(SI,0)
+                        new_sort_val(SI)
                     ;   true),
                     ((TE = sort(SE),
                       not atomic(B))
                     ->
-                        new_sort_val(SE,0),
-                        new_sort_val(SE,0)
+                        new_sort_val(SE),
+                        new_sort_val(SE)
                     ;   true)
                 ;   true)),
             Eq = neg(alldiff(Type,[IA,IB]))
-        ;   Eq = (IA #= IB))).
+        ;   (var(Type) ->
+                Eq = neg(alldiff(Type,[IA,IB]))
+            ;   Eq = (IA #= IB)))).
 smt_interp0(distinct(L),Diff,bool) :- !,
     (foreach(A,L),
      foreach(IA,NL),
      param(Type) do
         smt_interp(A,IA,Type)),
     (var(Type) ->
-        Type = int
+        % constantes décimales !
+        fail
     ;   (Type = array(_,_) ->
             setval(keep_deltas_if_arrays,1)@eclipse
         ;   true)),
@@ -1880,37 +2047,28 @@ smt_interp0(distinct(L),Diff,bool) :- !,
       Type = sort(S);
       Type = array(TI,TE))
     ->
-        (fail,nonvar(S) ->
-            length(NL,Len),
-            % Len distinct donc (Len*Len-1)/2
-            NbVals is (Len*Len-1)//2,
-            (for(I,1,NbVals),
+        % pour chaque diff on peut avoir besoin
+        % de 1 index et deux valeurs
+        ((nonvar(TI),
+          TI = sort(SI))
+        ->
+            new_sort_val(SI)
+        ;   true),
+        ((nonvar(TE),
+          TE = sort(SE))
+        ->
+            new_sort_val(SE),
+            new_sort_val(SE)
+        ;   true),
+        (nonvar(S) ->
+            (foreach(Elem,NL),
              param(S) do
-                new_sort_val(S,0))
-        ;   % pour chaque diff on peut avoir besoin
-            % de 1 index et deux valeurs
-            ((nonvar(TI),
-              TI = sort(SI))
-            ->
-                new_sort_val(SI,0)
-            ;   true),
-            ((nonvar(TE),
-              TE = sort(SE))
-            ->
-                new_sort_val(SE,0),
-                new_sort_val(SE,0)
-            ;   true)),
+                (atomic(Elem) ->
+                    true
+                ;   new_sort_val(S)))
+        ;   true),
         Diff = alldiff(Type,NL)
     ;   NL = [IA0,IB],
-        (Type = array(TI,TE) ->
-            (TI = sort(SI) ->
-                new_sort_val(SI,0)
-            ;   true),
-            (TE = sort(SE) ->
-                new_sort_val(SE,0),
-                new_sort_val(SE,0)
-            ;   true)
-        ;   true),
         add_as(Type,IA0,IA),
         Diff = (IA #\= IB)).
 smt_interp0(divisible(N0,A),Eq,bool) ?-
@@ -1918,10 +2076,14 @@ smt_interp0(divisible(N0,A),Eq,bool) ?-
     integer(N),
     smt_interp(A,IA0,Type),
     add_as(Type,IA0,IA),
+    (var(Type) ->
+        (getval(real_for_int,1) ->
+            Type = real_int
+        ;   Type = int)
+    ;   true),
     (Type == int ->
         Eq = (IA rem N #= 0)
-    ;   Type == real,
-        Eq = (irmod(IA,real_from_int(N)) $= 0.0)).
+    ;   Eq = (irmod(IA,real_from_int(N)) $= 0.0)).
 
 
 smt_interp0(-A,Iop,Type) ?-
@@ -1932,7 +2094,7 @@ smt_interp0(-A,Iop,Type) ?-
     ;   NA = A),
     !,
     smt_interp(NA,IA0,Type),
-    ((Type == real,
+    ((occurs(Type,(real,real_int)),
       check_rat_expr(-,0,IA0,Rat))
     ->
         term_string(Rat,SRat),
@@ -1941,7 +2103,7 @@ smt_interp0(-A,Iop,Type) ?-
         Iop = -IA).
 smt_interp0(abs(A),Iabs,Type) :- !,
     smt_interp(A,IA0,Type),
-    ((Type == real,
+    ((occurs(Type,(real,real_int)),
       check_rat_arg(IA0,Rat))
     ->
         abs(Rat,AbsRat),
@@ -1952,7 +2114,7 @@ smt_interp0(abs(A),Iabs,Type) :- !,
 smt_interp0(A + B,Iadd,Type) :- !,
     smt_interp(A,IA0,Type),
     smt_interp(B,IB,Type),
-    ((Type == real,
+    ((occurs(Type,(real,real_int)),
       check_rat_expr(+,IA0,IB,Rat))
     ->
         term_string(Rat,SRat),
@@ -1962,7 +2124,7 @@ smt_interp0(A + B,Iadd,Type) :- !,
 smt_interp0(A - B,Iminus,Type) :- !,
     smt_interp(A,IA0,Type),
     smt_interp(B,IB,Type),
-    ((Type == real,
+    ((occurs(Type,(real,real_int)),
       check_rat_expr(-,IA0,IB,Rat))
     ->
         term_string(Rat,SRat),
@@ -1972,7 +2134,7 @@ smt_interp0(A - B,Iminus,Type) :- !,
 smt_interp0(A * B,Imul,Type) :- !,
     smt_interp(A,IA0,Type),
     smt_interp(B,IB,Type),
-    ((Type == real,
+    ((occurs(Type,(real,real_int)),
       check_rat_expr(*,IA0,IB,Rat))
     ->
         term_string(Rat,SRat),
@@ -1983,17 +2145,19 @@ smt_interp0(A div B,Idiv,Type) :- !,
     smt_interp(A,IA0,Type),
     add_as(Type,IA0,IA),
     smt_interp(B,IB,Type),
+    get_real_int_type_from_logic(Type),
     (Type == int ->
         Idiv = (IA div IB)
-    ;   Type = real,
+    ;   %Type = real,
         Idiv = irdiv(IA,IB)).
 smt_interp0(A mod B,Imod,Type) :- !,
     smt_interp(A,IA0,Type),
     add_as(Type,IA0,IA),
     smt_interp(B,IB,Type),
+    get_real_int_type_from_logic(Type),
     (Type == int ->
         Imod = (IA mod IB)
-    ;   Type == real,
+    ;   %Type = real,
         Imod = irmod(IA,IB)).
 smt_interp0(A / B,Idiv,real) :- !,
     smt_interp(A,IA0,real),
@@ -2012,14 +2176,15 @@ smt_interp0(to_int(A),IIA,Type) :- !,
     smt_interp(A,IA0,real),
     add_as(real,IA0,IA),
     (getval(real_for_int,1)@eclipse ->
-       Type = real,
+%       Type = real,
+       Type = real_int,
        IIA = floor(IA)
     ;  Type = int,
        IIA = int_from_real(floor(IA))).
 smt_interp0(to_real(A),RIA,real) :- !,
     (getval(real_for_int,1)@eclipse ->
-        smt_interp(A,IA0,real),
-        add_as(real,IA0,RIA)
+        smt_interp(A,IA0,real_int),
+        add_as(real_int,IA0,RIA)
     ;   RIA = real_from_int(IA),
         smt_interp(A,IA0,int),
         add_as(int,IA0,IA)).
@@ -2054,7 +2219,8 @@ smt_interp0(colibri_round(A),round(IA),real) :- !,
     add_as(real,IA0,IA).
 smt_interp0(colibri_abs_int(A),AIA,Type) :- !,
     (getval(real_for_int,1)@eclipse ->
-        Type = real
+%        Type = real
+        Type = real_int
     ;   Type = int),
     smt_interp(A,IA0,Type),
     add_as(Type,IA0,IA),
@@ -2073,10 +2239,11 @@ smt_interp0(colibri_pow_real_int(A,B),IA ^ IB,real) :- !,
     ;   smt_interp(B,IB,int)).
 smt_interp0(colibri_pow_int_int(A,B),IA ^ IB,Type) :- !,
     (getval(real_for_int,1)@eclipse ->
-        Type = real,
-        smt_interp(A,IA0,real),
-        add_as(real,IA0,IA),
-        % on veut un int
+%        Type = real,
+        Type = real_int,
+        smt_interp(A,IA0,Type),
+        add_as(Type,IA0,IA),
+        % on veut un int pout B
         setval(real_for_int,0)@eclipse,
         smt_interp(B,IB,int),
         setval(real_for_int,1)@eclipse
@@ -2136,11 +2303,11 @@ smt_interp0('nat2bv'(Size,Int),Res,Type) :- !,
     integer(Size),
     Size > 0,
     (getval(real_for_int,1)@eclipse ->
-        IType = real
+        IType = real_int
     ;   IType = int),
     smt_interp(Int,IInt,IType),
     Type = uint(Size),
-    (IType == real ->
+    (IType == real_int ->
         Res = uintN_from_int(Size,int_from_real(IInt))
     ;   Res = uintN_from_int(Size,IInt)).
 
@@ -2596,7 +2763,12 @@ add_as0(array(_,_),I,AsI) ?- !,
 add_as0(Type,I,AsI) :-
     nonvar(Type),
     (var(I);
-     atomic(I)),
+     atomic(I);
+     functor(I,uninterp,_)),
+    !,
+    AsI = as(I,Type).
+add_as0(Type,I,AsI) :-
+    var(Type),
     !,
     AsI = as(I,Type).
 add_as0(_,I,I).
@@ -2664,7 +2836,7 @@ get_decl_type_from_sort('Bool',NVar,Decl,bool) :- !,
     Decl = int_vars(bool,NVar).
 get_decl_type_from_sort('Int',NVar,Decl,Type) :- !,
     get_type_from_sort('Int',Type,_),
-    (Type == real ->
+    (Type == real_int ->
         % simulation entiers non bornes
         Decl = real_vars(real_int,NVar)
     ;   Decl = int_vars(int,NVar)).
@@ -2688,6 +2860,21 @@ get_decl_type_from_sort('Float32',NVar,Decl,float_simple) :- !,
     Decl = real_vars(float,NVar).
 get_decl_type_from_sort('Float64',NVar,Decl,float_double) :- !,
     Decl = real_vars(double,NVar).
+get_decl_type_from_sort(Term,NVar,Decl,Type) :-
+    compound(Term),
+    !,
+    functor(Term,F,Ar),
+    Term =.. [F|Sorts],
+    (known_sort(F,Ar,FSorts) ->
+        (foreach(Sort,Sorts),
+         foreach(NSort,NSorts) do
+            get_type_from_sort(Sort,NSort,_)),
+        NTerm =.. [F|NSorts],
+        Type = sort(NTerm),
+        Decl = sort_vars(Type,NVar)
+    ;   term_string(Term,ST),
+        concat_string([" sort ",ST],Str),
+        unsupported_error(Str)).         
 get_decl_type_from_sort(Atom,NVar,Decl,Type) :- !,
     atomic(Atom),
     % alias de type
@@ -2700,7 +2887,7 @@ get_decl_type_from_sort(Atom,NVar,Decl,Type) :- !,
         ;   concat_string([" sort ",Atom],Str),
             unsupported_error(Str))),
     ((atomic(Type),
-      occurs(Type,(real,float_simple,float_double)))
+      occurs(Type,(real,real_int,float_simple,float_double)))
     ->
         Decl = real_vars(IType,NVar)
     ;   (Type = sort(_) ->
@@ -2709,10 +2896,22 @@ get_decl_type_from_sort(Atom,NVar,Decl,Type) :- !,
 
 
 
+get_type_from_sort(Var,ColType,Type) :- 
+    var(Var),
+    !,
+    % poly déjà traité
+    ColType = Var,
+    Type = Var.
+get_type_from_sort(poly(Var),ColType,Type) :- !,
+    (var(Var) ->
+        ColType = Var,
+        Type = Var
+    ;   get_type_from_sort(Var,ColType,Type)).
 get_type_from_sort('Bool',bool,bool) :- !.
 get_type_from_sort('Int',IType,Type) :-
     (getval(real_for_int,1)@eclipse ->
-        IType = real,
+%        IType = real,
+        IType = real_int,
         Type = real_int
     ;   Type = IType,
         IType = int),
@@ -2743,6 +2942,8 @@ get_type_from_sort('Array'(SI,SE),array(TI,TE),array(TI,TE)) :- !,
     get_type_from_sort(SI,TI,_),
     get_type_from_sort(SE,TE,_).
 get_type_from_sort(Atom,Type,Type) :-
+    atom(Atom),
+    !,
     % alias de type ?
     (get_binding(Atom,Type,Type) ->
         true
@@ -2752,6 +2953,21 @@ get_type_from_sort(Atom,Type,Type) :-
             concat_string(["Undefined/undeclared sort ",S],Mess),
             writeln(output,Mess),
             exit_block(syntax))).
+get_type_from_sort(Term,CType,Type) :-
+    compound(Term),
+    !,
+    functor(Term,F,Ar),
+    Term =.. [F|Sorts],
+    (known_sort(F,Ar,FSorts) ->
+        (foreach(Sort,Sorts),
+         foreach(NSort,NSorts) do
+            get_type_from_sort(Sort,NSort,_)),
+        NTerm =.. [F|NSorts],
+        CType = Type,
+        Type = sort(NTerm)
+    ;   term_string(Term,ST),
+        concat_string([" sort ",ST],Str),
+        unsupported_error(Str)).         
 
 
 get_sort_from_type(sort(SId),Sort) ?- !,
@@ -3096,6 +3312,39 @@ cgiveInstancePath(N,ArEnd,ST,T,Forbiden,LC) :-
 	N1 is N+1,
 	cgiveInstancePath(N1,ArEnd,ST,T,Forbiden,LC).
 
+% cherche un chemin P et une instance de ST dans T
+cgiveInstanceAndPath(ST,T,Inst,P) :-
+    cgiveInstanceAndPath(ST,T,[],Inst,P).
+% 	whith a list of function forbiden under which ST is
+%	not searched.
+cgiveInstanceAndPath(ST,T,_,T,[]) :-
+    instance(T,ST).
+cgiveInstanceAndPath(ST,T,Forbiden,Inst,P) :-
+    compound(T),
+    functor(T,Name,Arite),
+    (\+ occurs(Name,Forbiden)),
+    Arite1 is Arite + 1,
+    cgiveInstanceAndPath(1,Arite1,ST,T,Forbiden,Inst,P).
+
+%subfunction of giveInstancePath/4 with index of path actualy reached
+% 	and the limit. The searched is in large (parcours en largeur).
+cgiveInstanceAndPath(ArEnd,ArEnd,_,_,_,_,_) :- !,fail.
+cgiveInstanceAndPath(N,_ArEnd,ST,T,Forbiden,Inst,[N|LI]) :-
+    arg(N,T,S),
+    ( (instance(S,ST),
+       Inst = S,
+       LI = [])
+    ; (compound(S),
+       functor(S,Name,N_A),
+       (\+ occurs(Name,Forbiden)),
+       NArEnd is N_A + 1,
+       cgiveInstanceAndPath(1,NArEnd,ST,S,Forbiden,Inst,LI))).
+cgiveInstanceAndPath(N,ArEnd,ST,T,Forbiden,Inst,LC) :-
+    N1 is N+1,
+    cgiveInstanceAndPath(N1,ArEnd,ST,T,Forbiden,Inst,LC).
+
+
+
 %% replace_at_path_in_term(Path,T,ST) :
 %% remplace, en place dans T, le sous terme au bout du chemin Path par ST
 creplace_at_path_in_term([I|Path],T,ST) :-
@@ -3104,6 +3353,7 @@ creplace_at_path_in_term([I|Path],T,ST) :-
     ;	arg(I,T,TI),
         creplace_at_path_in_term(Path,TI,ST)).
 %% Idem mais copie
+creplace_at_path_in_term([],T,ST,ST).
 creplace_at_path_in_term([I|Path],T,ST,NT) :-
     arg(I,T,TI),
     T =.. [FT|Args],
diff --git a/Src/COLIBRI/solve.pl b/Src/COLIBRI/solve.pl
index e88f11b95fab74d92765d21ae3f28631fbbd2bf1..d032e51f110966eee1e616fb1dec9e15dd5df1bb 100644
--- a/Src/COLIBRI/solve.pl
+++ b/Src/COLIBRI/solve.pl
@@ -301,8 +301,6 @@ bvsge(N,EA, EB) :-
 bvsgt(N,EA, EB) :-
     unfold_int_expr_block(bvsgt(N,EA, EB),0,C,bool,1),
     call(C).
-uninterp(Term,EB) :-
-    unfold_int_expr_block(uninterp(Term,EB),0,C,bool,1).
 
 
 set_default_int_bounds(Low,High) :-
@@ -327,7 +325,7 @@ bv_label(L) :- labeling_bv(L).
 sort_vars(Type,T) :-
     term_variables(T,Vars),
     Type = sort(SId),
-    get_sort_vals(SId,0,ValIds),
+    get_sort_vals(SId,ValIds),
     (foreach(X,Vars),
      param(Type,ValIds) do
         mfd:set_intervals(X,ValIds),
@@ -2131,23 +2129,23 @@ unfold_int_expr(EA #\= EB,D,Cstr,Type0,R) ?-
 unfold_int_expr(alldiff(Type,L),D,Cstr,Bool,R) :-
     ND is D + 1,
     Bool = bool,
-    (real_type(Type,NType) ->
+    (real_type(Type,IType) ->
         Real = 1
-    ;   NType = Type),
+    ;   true),
     (foreach(E,L),
      foreach(RE,NL),
      fromto(true,I,O,CL),
-     param(NType,Real,ND,R) do
+     param(Type,Real,ND,R) do
         (var(Real) ->
-            unfold_int_expr(E,ND,CE,NType,RE)
-        ;   unfold_real_expr(E,ND,CE,NType,RE)),
+            unfold_int_expr(E,ND,CE,Type,RE)
+        ;   unfold_real_expr(E,ND,CE,Type,RE)),
         insert_dep_inst(dep(RE,ND,[R])),
         make_conj(I,CE,O)),
     !,
     int_vars(bool,R),
     insert_dep_inst(dep(R,D,NL)),
-    (nonvar(Real) ->
-        IType = NType
+    (nonvar(IType) ->
+        true
     ;   ((Type = sort(_);
           Type == rnd;
           Type = array(_,_))
@@ -2344,9 +2342,10 @@ unfold_int_expr(EA #>= EB,D,Cstr,Type,R) ?-
 unfold_int_expr(EA $= EB,D,Cstr,Type0,R) ?-
     Type0 = bool,
     ND is D + 1,
-    unfold_real_expr(EA,ND,CA,Type,A),
-    unfold_real_expr(EB,ND,CB,Type,B),
-    nonvar(Type),
+    unfold_real_expr(EA,ND,CA,RType,A),
+    unfold_real_expr(EB,ND,CB,RType,B),
+    nonvar(RType),
+    real_type(RType,Type),
     !,
     int_vars(bool,R),
     insert_dep_inst(dep(R,D,[A,B])),
@@ -2420,27 +2419,34 @@ unfold_int_expr(fp_eq(EA,EB),D,Cstr,Type0,R) ?-
     unfold_real_expr(EA,ND,CA,Type,A),
     unfold_real_expr(EB,ND,CB,Type,B),
     !,
-    unfold_int_expr(chk_nan(isNaN(as(A,Type)),
-                            as(1,bool),
-                            isNaN(as(B,Type))),D,
-                    Cond,bool,BCond),
     int_vars(bool,R),
-    int_vars(bool,BCond),
-    insert_dep_inst(dep(R,D,[A,B,BCond])),
-    %insert_dep_inst(dep(A,D,[BCond,R])),
-    %insert_dep_inst(dep(B,D,[BCond,R])),
-    %insert_dep_inst(dep(BCond,D,[R])),
-    make_conj(CA,CB,CAB),
-    make_conj(CAB,Cond,CABCond),
-    make_conj(CABCond,fp_eq_reif(BCond,Type,A,B,R),Cstr).
+    ((A == nan,
+      CAB = CA;
+      B == nan,
+      CAB = CB)
+    ->
+        make_conj(CAB,protected_unify(R,0),Cstr)
+    ;   unfold_int_expr(chk_nan(isNaN(as(A,Type)),
+                                as(1,bool),
+                                isNaN(as(B,Type))),D,
+                        Cond,bool,BCond),
+        int_vars(bool,BCond),
+        insert_dep_inst(dep(R,D,[A,B,BCond])),
+        %insert_dep_inst(dep(A,D,[BCond,R])),
+        %insert_dep_inst(dep(B,D,[BCond,R])),
+        %insert_dep_inst(dep(BCond,D,[R])),
+        make_conj(CA,CB,CAB),
+        make_conj(CAB,Cond,CABCond),
+        make_conj(CABCond,fp_eq_reif(BCond,Type,A,B,R),Cstr)).
 
 % pas le distinct de la smtlib ! (voir alldiff)
 unfold_int_expr(EA $\= EB,D,Cstr,Type0,R) ?- !,
     Type0 = bool,
     ND is D + 1,
-    unfold_real_expr(EA,ND,CA,Type,A),
-    unfold_real_expr(EB,ND,CB,Type,B),
-    nonvar(Type),
+    unfold_real_expr(EA,ND,CA,RType,A),
+    unfold_real_expr(EB,ND,CB,RType,B),
+    nonvar(RType),
+    real_type(RType,Type),
     !,
     int_vars(bool,R),
     insert_dep_inst(dep(R,D,[A,B])),
@@ -2491,9 +2497,10 @@ unfold_int_expr(EA $< EB,D,Cstr,Type0,R) ?-
     (R == 1 ->
         ensure_not_NaN((A,B))
     ;   true),
-    unfold_real_expr(EA,ND,CA,Type,A),
-    unfold_real_expr(EB,ND,CB,Type,B),
-    nonvar(Type),
+    unfold_real_expr(EA,ND,CA,RType,A),
+    unfold_real_expr(EB,ND,CB,RType,B),
+    nonvar(RType),
+    real_type(RType,Type),
     !,
     make_conj(CA,CB,CAB),
     int_vars(bool,R),
@@ -2546,24 +2553,30 @@ unfold_int_expr(fp_lt(EA,EB),D,Cstr,Type0,R) ?-
         ;   unfold_real_expr(EA,ND,CA,Type,A),
             unfold_real_expr(EB,ND,CB,Type,B)),
         !,
-        make_conj(CA,CB,CAB),
-        ((check_not_NaN(A),
-          check_not_NaN(B))
+        int_vars(bool,R),
+        ((A == nan,
+          CAB = CA;
+          B == nan,
+          CAB = CB)
         ->
-            unfold_int_expr(as(A,Type) $< as(B,Type),D,Cstr1,bool,R),
-            make_conj(CAB,Cstr1,Cstr)
-        ;   unfold_int_expr(chk_nan(isNaN(as(A,Type)),
-                                    as(1,bool),
-                                    isNaN(as(B,Type))),D,
-                            Cond,bool,BCond),
-            int_vars(bool,R),
-            int_vars(bool,BCond),
-            insert_dep_inst(dep(R,D,[A,B,BCond])),
-            insert_dep_inst(dep(A,D,[BCond,R])),
-            insert_dep_inst(dep(B,D,[BCond,R])),
-            insert_dep_inst(dep(BCond,D,[R])),
-            make_conj(CAB,Cond,CABCond),
-            make_conj(CABCond,fp_gt_reif(BCond,Type,B,A,R),Cstr))).
+            make_conj(CAB,protected_unify(R,0),Cstr)
+        ;   make_conj(CA,CB,CAB),
+            ((check_not_NaN(A),
+              check_not_NaN(B))
+            ->
+                unfold_int_expr(as(A,Type) $< as(B,Type),D,Cstr1,bool,R),
+                make_conj(CAB,Cstr1,Cstr)
+            ;   unfold_int_expr(chk_nan(isNaN(as(A,Type)),
+                                        as(1,bool),
+                                        isNaN(as(B,Type))),D,
+                                Cond,bool,BCond),
+                int_vars(bool,BCond),
+                insert_dep_inst(dep(R,D,[A,B,BCond])),
+                insert_dep_inst(dep(A,D,[BCond,R])),
+                insert_dep_inst(dep(B,D,[BCond,R])),
+                insert_dep_inst(dep(BCond,D,[R])),
+                make_conj(CAB,Cond,CABCond),
+                make_conj(CABCond,fp_gt_reif(BCond,Type,B,A,R),Cstr)))).
 
 unfold_int_expr(EA $=< EB,D,Cstr,Type0,R) ?-
     Type0 = bool,
@@ -2571,8 +2584,10 @@ unfold_int_expr(EA $=< EB,D,Cstr,Type0,R) ?-
     (R == 1 ->
         ensure_not_NaN((A,B))
     ;   true),
-    unfold_real_expr(EA,ND,CA,Type,A),
-    unfold_real_expr(EB,ND,CB,Type,B),
+    unfold_real_expr(EA,ND,CA,RType,A),
+    unfold_real_expr(EB,ND,CB,RType,B),
+    nonvar(RType),
+    real_type(RType,Type),
     !,
     make_conj(CA,CB,CAB),
     int_vars(bool,R),
@@ -2632,24 +2647,30 @@ unfold_int_expr(fp_leq(EA,EB),D,Cstr,Type0,R) ?-
         ;   unfold_real_expr(EA,ND,CA,Type,A),
             unfold_real_expr(EB,ND,CB,Type,B)),
         !,
-        make_conj(CA,CB,CAB),
-        ((check_not_NaN(A),
-          check_not_NaN(B))
+        int_vars(bool,R),
+        ((A == nan,
+          CAB = CA;
+          B == nan,
+          CAB = CB)
         ->
-            unfold_int_expr(as(A,Type) $=< as(B,Type),D,Cstr1,bool,R),
-            make_conj(CAB,Cstr1,Cstr)
-        ;   unfold_int_expr(chk_nan(isNaN(as(A,Type)),
-                                    as(1,bool),
-                                    isNaN(as(B,Type))),D,
-                            Cond,bool,BCond),
-            int_vars(bool,R),
-            int_vars(bool,BCond),
-            insert_dep_inst(dep(R,D,[A,B,BCond])),
-            insert_dep_inst(dep(A,D,[BCond,R])),
-            insert_dep_inst(dep(B,D,[BCond,R])),
-            insert_dep_inst(dep(BCond,D,[R])),
-            make_conj(CAB,Cond,CABCond),
-            make_conj(CABCond,fp_geq_reif(BCond,Type,B,A,R),Cstr))).
+            make_conj(CAB,protected_unify(R,0),Cstr)
+        ;   make_conj(CA,CB,CAB),
+            ((check_not_NaN(A),
+              check_not_NaN(B))
+            ->
+                unfold_int_expr(as(A,Type) $=< as(B,Type),D,Cstr1,bool,R),
+                make_conj(CAB,Cstr1,Cstr)
+            ;   unfold_int_expr(chk_nan(isNaN(as(A,Type)),
+                                        as(1,bool),
+                                        isNaN(as(B,Type))),D,
+                                Cond,bool,BCond),
+                int_vars(bool,BCond),
+                insert_dep_inst(dep(R,D,[A,B,BCond])),
+                insert_dep_inst(dep(A,D,[BCond,R])),
+                insert_dep_inst(dep(B,D,[BCond,R])),
+                insert_dep_inst(dep(BCond,D,[R])),
+                make_conj(CAB,Cond,CABCond),
+                make_conj(CABCond,fp_geq_reif(BCond,Type,B,A,R),Cstr)))).
 
 unfold_int_expr(EA $> EB,D,Cstr,Type,R) ?-
     !,
@@ -3203,18 +3224,21 @@ unfold_int_expr(uninterp(Term),D,Cstr,Type,R) ?- !,
     nonvar(Term),
     Term =.. [F|ArgsTypes],
     (foreach(as(Arg,TypeArg),ArgsTypes),
+     foreach(TypeArg,Types),
      foreach(AR,IArgs),
      fromto(true,IC,OC,ACstrs),
      param(D) do
         functor(TypeArg,T,_),
         (occurs(T,(bool,int,uint,sort,rnd)) ->
-            unfold_int_expr(Arg,D,AC,TypeArg,AR)
-        ;   unfold_real_expr(Arg,D,AC,TypeArg,AR)),
-        make_conj(IC,AC,OC)),
+            unfold_int_expr(Arg,D,AC,TypeArg,AR),
+            SetType = int_vars(TypeArg,AR)
+        ;   unfold_real_expr(Arg,D,AC,TypeArg,AR),
+            SetType = real_vars(TypeArg,AR)),
+        make_conj(IC,(SetType,AC),OC)),
     !,
     %int_vars(Type,R),
     insert_dep_inst(dep(R,D,IArgs)),
-    make_conj(ACstrs,uninterp(F,IArgs,R),Cstr).
+    make_conj(ACstrs,(int_vars(Type,R),uninterp_trigger(F,Types,Type,Trigger),uninterp(F,Trigger,IArgs,R)),Cstr).
     
 unfold_int_expr(Val,D,Cstr,Type,R) :-
     atomic(Val),
@@ -3224,7 +3248,7 @@ unfold_int_expr(Val,D,Cstr,Type,R) :-
         occurs(Val,(rne,rna,rtz,rtn,rtp))
     ;   Type = sort(SId),
         !,
-        get_sort_vals(SId,0,Vals),
+        get_sort_vals(SId,Vals),
         occurs(Val,Vals)),
     Cstr = true,
     blocked_unify(R,Val).
@@ -3345,7 +3369,8 @@ not_expr(bvsgt(A,B),E) ?- !,
 not_expr(alldiff(Type,[A,B]),E) ?-
     (Type == int ->
         E = (as(A,Type) #= as(B,Type))
-    ;   Type == real,
+    ;   atomic(Type),
+        occurs(Type,(real,real_int)),
         E = (as(A,Type) $= as(B,Type))),
     !.
 
@@ -6180,7 +6205,8 @@ unfold_real_expr(X,_,Cstr,Type,FX) :-
         % on differe l'interpretation de la constante
         Cstr = to_real(Type,X,FX)
     ;   Cstr =  true,
-        to_real(Type,X,FX0),
+        real_type(Type,RType),
+        to_real(RType,X,FX0),
         blocked_unify(FX0,FX)).
 unfold_real_expr(nan,_,Cstr,Type,R) ?-
     once (Type == float_double;
@@ -6190,10 +6216,13 @@ unfold_real_expr(nan,_,Cstr,Type,R) ?-
     blocked_unify(R,nan).
     
 unfold_real_expr(as(EA,Type0),D,Cstr,Type,R) ?- !,
-    (real_type(Type0,Type) ->
-        true
-    ;   Type = Type0),
-    unfold_real_expr(EA,D,Cstr,Type,R).
+    ((var(Type);
+      Type == Type0)
+    ->
+        Type = Type0
+    ;   atomic(Type),
+        occurs(Type,(real,real_int))),
+    unfold_real_expr(EA,D,Cstr,Type0,R).
 
     
 unfold_real_expr(minNormFloat,_,Cstr,Type,R) ?- !,
@@ -6225,14 +6254,20 @@ unfold_real_expr(doubleLast,_,Cstr,Type,R) ?- !,
 unfold_real_expr(IX,_,Cstr,Type,X) :-
     % parsing ambigu dans smt_import.pl ?
     integer(IX),!,
-    Type = real,
+    (var(Type) ->
+        Type = real
+    ;   atomic(Type),
+        occurs(Type,(real,real_int))),
     Cstr = true,
     RX is rational(IX),
     real_from_rat(RX,X0),
     blocked_unify(X,X0).
 unfold_real_expr(realString(Str),D,Cstr,Type,R) ?-
     string(Str),
-    Type = real,
+    (var(Type) ->
+        Type = real
+    ;   atomic(Type),
+        occurs(Type,(real,real_int))),
     Cstr = true,
     term_string(T,Str),
     (rational(T) ->
@@ -6271,7 +6306,8 @@ unfold_real_expr(- EA,D,Cstr,Type,R) ?-
     unfold_real_expr(EA,ND,CA,Type,A),
     !,
     insert_dep_inst(dep(R,D,[A])),
-    make_conj(CA,(ensure_not_NaN((A,R)),op_real(Type,A,R)),Cstr).
+    real_type(Type,RType),
+    make_conj(CA,(ensure_not_NaN((A,R)),op_real(RType,A,R)),Cstr).
 unfold_real_expr(fp_neg(EA),D,Cstr,Type,R) ?-
     (check_not_NaN(R) ->
         !,
@@ -6298,7 +6334,9 @@ unfold_real_expr(round(Rnd0,EA),D,Cstr,Type,R) :-
     ND is D + 1,
     unfold_int_expr(Rnd0,ND,CRnd,rnd,Rnd),
     unfold_real_expr(EA,ND,CA,Type,A),
-    unfold_int_expr(isNaN(as(A,Type)),
+    nonvar(Type),
+    real_type(Type,RType),
+    unfold_int_expr(isNaN(as(A,RType)),
                     D,Cond,bool,BCond),
     !,
     rnd_vars(Rnd),
@@ -6309,18 +6347,22 @@ unfold_real_expr(round(Rnd0,EA),D,Cstr,Type,R) :-
     insert_dep_inst(dep(R,D,[Rnd,A,BCond])),
     make_conj(CRnd,CA,CRndA),
     make_conj(CRndA,Cond,CACond),
-    make_conj(CACond,fp_round(BCond,Rnd,Type,A,R),Cstr).
+    make_conj(CACond,fp_round(BCond,Rnd,RType,A,R),Cstr).
 
 unfold_real_expr(truncate(EA),D,Cstr,Type,R) :-
     ND is D + 1,
     (check_not_NaN(R) ->
         ensure_not_NaN(A),
         unfold_real_expr(EA,ND,CA,Type,A),
+        nonvar(Type),
         !,
+        real_type(Type,RType),
         insert_dep_inst(dep(R,D,[A])),
-        make_conj(CA,truncate(Type,A,R),Cstr)
+        make_conj(CA,truncate(RType,A,R),Cstr)
     ;   unfold_real_expr(EA,ND,CA,Type,A),
-        unfold_int_expr(isNaN(as(A,Type)),
+        nonvar(Type),
+        real_type(Type,RType),
+        unfold_int_expr(isNaN(as(A,RType)),
                         D,Cond,bool,BCond),
         !,
         int_vars(bool,BCond),
@@ -6329,18 +6371,22 @@ unfold_real_expr(truncate(EA),D,Cstr,Type,R) :-
         insert_dep_inst(dep(A,D,[BCond])),
         insert_dep_inst(dep(R,D,[A,BCond])),
         make_conj(CA,Cond,CACond),
-        make_conj(CACond,fp_truncate(BCond,Type,A,R),Cstr)).
+        make_conj(CACond,fp_truncate(BCond,RType,A,R),Cstr)).
 
 unfold_real_expr(floor(EA),D,Cstr,Type,R) :-
     ND is D + 1,
     (check_not_NaN(R) ->
         ensure_not_NaN(A),
         unfold_real_expr(EA,ND,CA,Type,A),
+        nonvar(Type),
         !,
+        real_type(Type,RType),
         insert_dep_inst(dep(R,D,[A])),
-        make_conj(CA,floor(Type,A,R),Cstr)
+        make_conj(CA,floor(RType,A,R),Cstr)
     ;   unfold_real_expr(EA,ND,CA,Type,A),
-        unfold_int_expr(isNaN(as(A,Type)),
+        nonvar(Type),
+        real_type(Type,RType),
+        unfold_int_expr(isNaN(as(A,RType)),
                         D,Cond,bool,BCond),
         !,
         int_vars(bool,BCond),
@@ -6349,18 +6395,22 @@ unfold_real_expr(floor(EA),D,Cstr,Type,R) :-
         insert_dep_inst(dep(A,D,[BCond])),
         insert_dep_inst(dep(R,D,[A,BCond])),
         make_conj(CA,Cond,CACond),
-        make_conj(CACond,fp_floor(BCond,Type,A,R),Cstr)).
+        make_conj(CACond,fp_floor(BCond,RType,A,R),Cstr)).
 
 unfold_real_expr(ceiling(EA),D,Cstr,Type,R) :-
     ND is D + 1,
     (check_not_NaN(R) ->
         ensure_not_NaN(A),
         unfold_real_expr(EA,ND,CA,Type,A),
+        nonvar(Type),
         !,
+        real_type(Type,RType),
         insert_dep_inst(dep(R,D,[A])),
-        make_conj(CA,ceiling(Type,A,R),Cstr)
+        make_conj(CA,ceiling(RType,A,R),Cstr)
     ;   unfold_real_expr(EA,ND,CA,Type,A),
-        unfold_int_expr(isNaN(as(A,Type)),
+        nonvar(Type),
+        real_type(Type,RType),
+        unfold_int_expr(isNaN(as(A,RType)),
                         D,Cond,bool,BCond),
         !,
         int_vars(bool,BCond),
@@ -6369,7 +6419,7 @@ unfold_real_expr(ceiling(EA),D,Cstr,Type,R) :-
         insert_dep_inst(dep(A,D,[BCond])),
         insert_dep_inst(dep(R,D,[A,BCond])),
         make_conj(CA,Cond,CACond),
-        make_conj(CACond,fp_ceiling(BCond,Type,A,R),Cstr)).
+        make_conj(CACond,fp_ceiling(BCond,RType,A,R),Cstr)).
 
 % Conversions depuis int
 unfold_real_expr(real_from_int(EA),D,Cstr,real,R) :-
@@ -6578,7 +6628,8 @@ unfold_real_expr(abs(EA),D,Cstr,Type,R) ?-
     unfold_real_expr(NE,ND,CA,Type,A),
     !,
     insert_dep_inst(dep(R,D,[A])),
-    make_conj(CA,abs_val_real(Type,A,R),Cstr).
+    real_type(Type,RType),
+    make_conj(CA,abs_val_real(RType,A,R),Cstr).
 unfold_real_expr(fp_abs(EA),D,Cstr,Type,R) ?-
     ((nonvar(EA),
       (EA = fg_neg(NE);
@@ -6621,8 +6672,8 @@ unfold_real_expr(EA + EB,D,Cstr,Type,R) ?-
         !,
         insert_dep_inst(dep(R,D,[A,B])),
         make_conj(CA,CB,CAB),
-        (Type == real ->
-            make_conj(CAB,add_real(Type,A,B,R),Cstr)
+        (real_type(Type,real) ->
+            make_conj(CAB,add_real(real,A,B,R),Cstr)
         ;   make_conj(CAB,(ensure_not_NaN((A,B,R)),add_real(Type,A,B,R)),Cstr))).
 unfold_real_expr(fp_add(EA,EB),D,Cstr,Type,R) ?-
     !,
@@ -6689,8 +6740,8 @@ unfold_real_expr(EA - EB,D,Cstr,Type,R) ?-
         !,
         insert_dep_inst(dep(R,D,[A,B])),
         make_conj(CA,CB,CAB),
-        (Type == real ->
-            make_conj(CAB,minus_real(Type,A,B,R),Cstr)
+        (real_type(Type,real) ->
+            make_conj(CAB,minus_real(real,A,B,R),Cstr)
         ;   make_conj(CAB,(ensure_not_NaN((A,B,R)),minus_real(Type,A,B,R)),Cstr))).
 unfold_real_expr(fp_sub(EA,EB),D,Cstr,Type,R) ?-
     !,
@@ -6756,8 +6807,8 @@ unfold_real_expr(EA * EB,D,Cstr,Type,R) ?-
     !,
     insert_dep_inst(dep(R,D,[A,B])),
     make_conj(CA,CB,CAB),
-    (Type == real ->
-        make_conj(CAB,mult_real(Type,A,B,R),Cstr)
+    (real_type(Type,real) ->
+        make_conj(CAB,mult_real(real,A,B,R),Cstr)
     ;   make_conj(CAB,(ensure_not_NaN((A,B,R)),mult_real(Type,A,B,R)),Cstr)).
 unfold_real_expr(fp_mul(EA,EB),D,Cstr,Type,R) ?-
     unfold_real_expr(fp_mul(rne,EA,EB),D,Cstr,Type,R).
@@ -6816,7 +6867,7 @@ unfold_real_expr(fp_mul(Rnd0,EA,EB),D,Cstr,Type,R) ?-
         make_conj(CRnd,CAB,CRndAB),
         make_conj(CRndAB,Cond,CABCond),
         make_conj(CABCond,fp_mul(BCond,Rnd,Type,A,B,R),Cstr)).
-unfold_real_expr(EA / EB,D,Cstr,Type,R) ?-
+unfold_real_expr(EA / EB,D,Cstr,RType,R) ?-
     ((nonvar(EA),
       EA = - NEA,
       nonvar(EB),
@@ -6826,14 +6877,15 @@ unfold_real_expr(EA / EB,D,Cstr,Type,R) ?-
     ;   NEA = EA,
         NEB = EB),
     ND is D + 1,
+    unfold_real_expr(NEA,ND,CA,RType,A),
+    unfold_real_expr(NEB,ND,CB,RType,B),
+    nonvar(RType),
+    real_type(RType,Type),
     (Type == real ->
         ensure_not_NaN((A,B,R))
     ;   (check_not_NaN(R) ->
             ensure_not_NaN((A,B))
         ;   true)),
-    unfold_real_expr(NEA,ND,CA,Type,A),
-    unfold_real_expr(NEB,ND,CB,Type,B),
-    nonvar(Type),
     make_conj(CA,CB,CAB),
     (Type == real ->
         unfold_int_expr(as(0.0,real) $= as(B,real),ND,Cond,bool,Bool),
@@ -6850,7 +6902,7 @@ unfold_real_expr(EA / EB,D,Cstr,Type,R) ?-
     ;   !,
         insert_dep_inst(dep(R,D,[A,B])),
         make_conj(CAB,(ensure_not_NaN((A,B,R)),div_real(Type,A,B,R)),Cstr)).
-unfold_real_expr(irdiv(EA,EB),D,Cstr,Type,R) ?-
+unfold_real_expr(irdiv(EA,EB),D,Cstr,RType,R) ?-
     ((nonvar(EA),
       EA = - NEA,
       nonvar(EB),
@@ -6860,12 +6912,13 @@ unfold_real_expr(irdiv(EA,EB),D,Cstr,Type,R) ?-
     ;   NEA = EA,
         NEB = EB),
     ND is D + 1,
-    Type = real,
     ensure_not_NaN((A,B,R)),
-    unfold_real_expr(NEA,ND,CA,Type,A),
-    unfold_real_expr(NEB,ND,CB,Type,B),
+    unfold_real_expr(NEA,ND,CA,RType,A),
+    unfold_real_expr(NEB,ND,CB,RType,B),
+    nonvar(RType),
+    real_type(RType,_),
     make_conj(CA,CB,CAB),
-    unfold_int_expr(as(0.0,real) $= as(B,real),ND,Cond,bool,Bool),
+    unfold_int_expr(as(0.0,RType) $= as(B,RType),ND,Cond,bool,Bool),
     !,
     get_reif_var_depth_from_labchoice(DD),
     insert_dep_inst(inst_cstr(DD,Bool)),
@@ -6873,7 +6926,7 @@ unfold_real_expr(irdiv(EA,EB),D,Cstr,Type,R) ?-
     insert_dep_inst(dep(A,D,[Bool])),
     insert_dep_inst(dep(B,D,[Bool])),
     make_conj(Cond,CAB,CondAB),
-    Goal = chk_undef_idiv_real(Bool,A,B,R),
+    Goal = chk_undef_idiv_real(Bool,RType,A,B,R),
     make_conj(CondAB,Goal,Cstr).
 unfold_real_expr(fp_div(EA,EB),D,Cstr,Type,R) ?-
     !,
@@ -6925,7 +6978,7 @@ unfold_real_expr(fp_div(Rnd0,EA,EB),D,Cstr,Type,R) ?-
         make_conj(CAB,Cond,CABCond),
         make_conj(CABCond,fp_div(BCond,Rnd,Type,A,B,R),Cstr)).
 
-unfold_real_expr(irmod(EA,EB),D,Cstr,Type,R) ?-
+unfold_real_expr(irmod(EA,EB),D,Cstr,RType,R) ?-
     ((nonvar(EA),
       EA = - NEA,
       nonvar(EB),
@@ -6935,12 +6988,13 @@ unfold_real_expr(irmod(EA,EB),D,Cstr,Type,R) ?-
     ;   NEA = EA,
         NEB = EB),
     ND is D + 1,
-    Type = real,
     ensure_not_NaN((A,B,R)),
-    unfold_real_expr(NEA,ND,CA,Type,A),
-    unfold_real_expr(NEB,ND,CB,Type,B),
+    unfold_real_expr(NEA,ND,CA,RType,A),
+    unfold_real_expr(NEB,ND,CB,RType,B),
+    nonvar(RType),
+    real_type(RType,_),
     make_conj(CA,CB,CAB),
-    unfold_int_expr(as(0.0,real) $= as(B,real),ND,Cond,bool,Bool),
+    unfold_int_expr(as(0.0,RType) $= as(B,RType),ND,Cond,bool,Bool),
     !,
     get_reif_var_depth_from_labchoice(DD),
     insert_dep_inst(inst_cstr(DD,Bool)),
@@ -6948,15 +7002,16 @@ unfold_real_expr(irmod(EA,EB),D,Cstr,Type,R) ?-
     insert_dep_inst(dep(A,D,[Bool])),
     insert_dep_inst(dep(B,D,[Bool])),
     make_conj(Cond,CAB,CondAB),
-    Goal = chk_undef_imod_real(Bool,A,B,R),
+    Goal = chk_undef_imod_real(Bool,RType,A,B,R),
     make_conj(CondAB,Goal,Cstr).
 
 % pour la simulation des entiers non bornes
 % par des "real integral" (surtout pour les uninterp) 
-unfold_real_expr(setIntegral(ERF),D,Cstr,Type,R) ?-
+unfold_real_expr(setIntegral(ERF),D,Cstr,RType,R) ?-
     ND is D + 1,
-    Type = real,
-    unfold_real_expr(ERF,ND,Cstr0,real,RF),
+    unfold_real_expr(ERF,ND,Cstr0,RType,RF),
+    nonvar(RType),
+    real_type(RType,real),
     !,
     blocked_unify(RF,R),
     ensure_not_NaN(R),
@@ -7087,10 +7142,12 @@ unfold_real_expr(fp_fma(Rnd0,EA,EB,EC),D,Cstr,Type,R) ?-
         make_conj(CABC,Cond,CABCond),
         make_conj(CABCond,fp_fma(BCond,Rnd,Type,A,B,C,R),Cstr)).
 
-unfold_real_expr(EA ^ EN,D,Cstr,Type,R) ?-
+unfold_real_expr(EA ^ EN,D,Cstr,RType,R) ?-
     ND is D + 1,
-    unfold_real_expr(EA,ND,CA,Type,A),
+    unfold_real_expr(EA,ND,CA,RType,A),
     unfold_int_expr(EN,ND,CN,Type1,N),
+    nonvar(RType),
+    real_type(RType,Type),
     !,
     insert_dep_inst(dep(R,D,[A,N])),
     make_conj(CA,CN,CAB),
@@ -7144,17 +7201,21 @@ unfold_real_expr(fp_sqrt(Rnd0,EA),D,Cstr,Type,R) ?-
     make_conj(CRnd,CA,CRndA),
     make_conj(CRndA,CNaN,CANaN),
     make_conj(CANaN,fp_sqrt(NaN,Rnd,Type,A,R),Cstr).
-unfold_real_expr(sqrt(EA),D,Cstr,Type,R) ?-
+unfold_real_expr(sqrt(EA),D,Cstr,RType,R) ?-
     % Pas de NaN, A >= -0.0
     ND is D + 1,
-    unfold_real_expr(EA,ND,CA,Type,A),
+    unfold_real_expr(EA,ND,CA,RType,A),
+    nonvar(RType),
+    real_type(RType,Type),
     !,
     insert_dep_inst(dep(R,D,[A])),
     make_conj(CA,(ensure_not_NaN([A,R]),geq_real(Type,A,-0.0),sqrt_real(Type,A,R)),Cstr).
 
-unfold_real_expr(ln(EA),D,Cstr,Type,R) ?-
+unfold_real_expr(ln(EA),D,Cstr,RType,R) ?-
     ND is D + 1,
-    unfold_real_expr(EA,ND,CA,Type,A),
+    unfold_real_expr(EA,ND,CA,RType,A),
+    nonvar(RType),
+    real_type(RType,Type),
     !,
     insert_dep_inst(dep(R,D,[A])),
     make_conj(CA,logn(Type,A,R),Cstr).
@@ -7175,9 +7236,10 @@ unfold_real_expr(fp_ln(EA),D,Cstr,Type,R) ?-
         insert_dep_inst(dep(R,D,[A,NaN])),
         make_conj(CNaN,CA,CNA),
         make_conj(CNA,fp_ln(NaN,Type,A,R),Cstr)).
-unfold_real_expr(exp(EA),D,Cstr,Type,R) ?-
+unfold_real_expr(exp(EA),D,Cstr,RType,R) ?-
     ND is D + 1,
-    unfold_real_expr(EA,ND,CA,Type,A),
+    unfold_real_expr(EA,ND,CA,RType,A),
+    nonvar(RType,Type),
     !,
     insert_dep_inst(dep(R,D,[A])),
     make_conj(CA,exp(Type,A,R),Cstr).
@@ -7222,10 +7284,12 @@ unfold_real_expr(fp_min(EA,EB),D,Cstr,Type,R) ?- !,
         make_conj(CA,CB,CAB),
         make_conj(CAB,CNaN,CABNaN),
         make_conj(CABNaN,chk_min_real(NaN,Type,A,B,R),Cstr)).
-unfold_real_expr(min(EA,EB),D,Cstr,Type,R) ?- !,
+unfold_real_expr(min(EA,EB),D,Cstr,RType,R) ?- !,
     ND is D + 1,
-    unfold_real_expr(EA,ND,CA,Type,A),
-    unfold_real_expr(EB,ND,CB,Type,B),
+    unfold_real_expr(EA,ND,CA,RType,A),
+    unfold_real_expr(EB,ND,CB,RType,B),
+    nonvar(RType),
+    real_type(RType,Type),
     insert_dep_inst(dep(R,D,[A,B])),
     make_conj(CA,CB,CAB),
     make_conj(CAB,launch_min_real(Type,A,B,R),Cstr).
@@ -7253,18 +7317,22 @@ unfold_real_expr(fp_max(EA,EB),D,Cstr,Type,R) ?- !,
         make_conj(CA,CB,CAB),
         make_conj(CAB,CNaN,CABNaN),
         make_conj(CABNaN,chk_max_real(NaN,Type,A,B,R),Cstr)).
-unfold_real_expr(max(EA,EB),D,Cstr,Type,R) ?- !,
+unfold_real_expr(max(EA,EB),D,Cstr,RType,R) ?- !,
     ND is D + 1,
-    unfold_real_expr(EA,ND,CA,Type,A),
-    unfold_real_expr(EB,ND,CB,Type,B),
+    unfold_real_expr(EA,ND,CA,RType,A),
+    unfold_real_expr(EB,ND,CB,RType,B),
+    nonvar(RType),
+    real_type(RType,Type),
     insert_dep_inst(dep(R,D,[A,B])),
     make_conj(CA,CB,CAB),
     make_conj(CAB,launch_max_real(Type,A,B,R),Cstr).
-unfold_real_expr(ite(Cond,Then,Else),D,Cstr,Type,R) ?-
+unfold_real_expr(ite(Cond,Then,Else),D,Cstr,RType,R) ?-
     ND is D + 1,
     unfold_int_expr(Cond,ND,CC,bool,RCond),
-    unfold_real_expr(Then,ND,CT,Type,RT),
-    unfold_real_expr(Else,ND,CE,Type,RE),
+    unfold_real_expr(Then,ND,CT,RType,RT),
+    unfold_real_expr(Else,ND,CE,RType,RE),
+    nonvar(RType),
+    real_type(RType,Type),
     !,
     get_reif_var_depth_from_labchoice(DD),
     insert_dep_inst(inst_cstr(DD,RCond)),
@@ -7273,7 +7341,7 @@ unfold_real_expr(ite(Cond,Then,Else),D,Cstr,Type,R) ?-
     insert_dep_inst(dep(RE,D,[RCond])),
     (var(RCond) ->
         int_vars(bool,RCond),
-        set_real_type(Type,R),
+        set_real_type(RType,R),
         make_conj(CC,ite_reif(RCond,(RT,CT),(RE,CE),R),Cstr)
     ;   (RCond == 1 ->
             Cstr = CT,
@@ -7289,16 +7357,19 @@ unfold_real_expr(uninterp(Term),D,Cstr,Type,R) ?- !,
     Term =.. [F|ArgsTypes],
     (foreach(as(Arg,TypeArg),ArgsTypes),
      foreach(AR,IArgs),
+     foreach(TypeArg,Types),
      fromto(true,IC,OC,ACstrs),
      param(D) do
         functor(TypeArg,T,_),
         (occurs(T,(bool,int,uint,sort,rnd)) ->
-            unfold_int_expr(Arg,D,AC,TypeArg,AR)
-        ;   unfold_real_expr(Arg,D,AC,TypeArg,AR)),
-        make_conj(IC,AC,OC)),
+            unfold_int_expr(Arg,D,AC,TypeArg,AR),
+            SetType = int_vars(TypeArg,AR)
+        ;   unfold_real_expr(Arg,D,AC,TypeArg,AR),
+            SetType = real_vars(TypeArg,AR)),
+        make_conj(IC,(SetType,AC),OC)),
     !,
     insert_dep_inst(dep(R,D,IArgs)),
-    make_conj(ACstrs,(real_vars(Type,R),uninterp(F,IArgs,R)),Cstr).
+    make_conj(ACstrs,(real_vars(Type,R),uninterp_trigger(F,Types,Type,Trigger),uninterp(F,Trigger,IArgs,R)),Cstr).
     
 unfold_real_expr(Expr,_,_,_,_) :-
     spy_here,
@@ -9424,13 +9495,28 @@ get_raw_uint_from_float(SE,SM,BvS,F,I) ?- !,
     get_int_from_bv(bv("b",Str),I,_).
 
 %% Les uninterp
-uninterp(F,Args,R) :-
+uninterp_trigger(F,Types0,Type0,Trigger) :-
+    (Types0 = [] ->
+        STypes = ""
+    ;   remove_sort_func(Types0,Types)),
+    (atomic(Type0) ->
+        SType = Type0
+    ;   remove_sort_func(Type0,Type),
+        term_string(Type,SType)),
+    (STypes == "" ->
+        concat_string([F,":",SType],STrigger)
+    ;   FTerm =.. [F|Types],
+        term_string(FTerm,SFTerm),
+        concat_string([SFTerm,":",SType],STrigger)),
+    atom_string(Trigger,STrigger).
+
+uninterp(F,Trigger,Args,R) :-
     get_priority(P),
     set_priority(1),
     save_cstr_suspensions((Args,R)),
     get_saved_cstr_suspensions(LSusp0),
     % on a peut etre un uninterp clos contradictoire
-    attached_suspensions(F,LSusp1),
+    attached_suspensions(Trigger,LSusp1),
     append(LSusp0,LSusp1,LSusp),
     (foreach(PairOrSusp,LSusp),
      param(F,Args,R,TypeR) do
@@ -9440,7 +9526,7 @@ uninterp(F,Args,R) :-
             (get_suspension_data(Susp,goal,Goal) ->
                 true
             ;   Goal = dead)),
-        (Goal = uninterp(F,CArgs,CR) ->
+        (Goal = uninterp(F,Trigger,CArgs,CR) ->
             (Args == CArgs ->
                 % factorisation
                 kill_suspension(Susp),
@@ -9457,8 +9543,8 @@ uninterp(F,Args,R) :-
                 ;   true))
         ;   true)),
     (ground(Args) ->
-        my_suspend(uninterp(F,Args,R),0,trigger(F))
-    ;   my_suspend(uninterp(F,Args,R),0,(Args,R)->suspend:constrained)),
+        my_suspend(uninterp(F,Trigger,Args,R),0,trigger(Trigger))
+    ;   my_suspend(uninterp(F,Trigger,Args,R),0,(Args,R)->suspend:constrained)),
     set_priority(P),
     wake_if_other_scheduled(P).
 
@@ -9496,9 +9582,9 @@ chk_undef_div_real(Bool,A,B,R) :-
     wake_if_other_scheduled(P).
 
 undef_div_real(A,R) :-
-    uninterp(div_real,[A],R).
+    uninterp(div_real,div_real,[A],R).
 
-chk_undef_idiv_real(Bool,A,B,R) :-
+chk_undef_idiv_real(Bool,Type,A,B,R) :-
     get_priority(P),
     set_priority(1),
     (not_zero(B) ->
@@ -9509,31 +9595,32 @@ chk_undef_idiv_real(Bool,A,B,R) :-
             % B <> 0.0
             idiv_real(A,B,R)
         ;   protected_unify(B,0.0),
-            undef_idiv_real(A,R))
+            undef_idiv_real(Type,A,R))
     ;   save_cstr_suspensions((A,B)),
         get_saved_cstr_suspensions(LSusp),
-        ((member((_,chk_undef_idiv_real(BBool,AA,BB,RR)),LSusp),
+        ((member((_,chk_undef_idiv_real(BBool,Type,AA,BB,RR)),LSusp),
           A == AA, B == BB)
         ->
             protected_unify(Bool,BBool),
             protected_unify(R,RR)
-        ;   ((member((_,chk_undef_imod_real(BBool,AA,BB,RR)),LSusp),
+        ;   ((member((_,chk_undef_imod_real(BBool,Type,AA,BB,RR)),LSusp),
               A == AA, B == BB)
             ->
                 protected_unify(Bool,BBool)
             ;   true),
-            my_suspend(chk_undef_idiv_real(Bool,A,B,R),0,
+            my_suspend(chk_undef_idiv_real(Bool,Type,A,B,R),0,
                        (Bool,A,B)->suspend:constrained))),
     set_priority(P),
     wake_if_other_scheduled(P).
 
-undef_idiv_real(A,R) :-
-    real_vars(real,(A,R)),
+undef_idiv_real(Type,A,R) :-
+    real_vars(Type,(A,R)),
     launch_float_int_number(A),
     launch_float_int_number(R),
-    uninterp(idiv_real,[A],R).
+    uninterp_trigger(idiv_real,[Type],Type,Trigger),
+    uninterp(idiv_real,Trigger,[A],R).
 
-chk_undef_imod_real(Bool,A,B,R) :-
+chk_undef_imod_real(Bool,Type,A,B,R) :-
     get_priority(P),
     set_priority(1),
     (not_zero(B) ->
@@ -9544,29 +9631,30 @@ chk_undef_imod_real(Bool,A,B,R) :-
             % B <> 0.0
             imod_real(A,B,R)
         ;   protected_unify(B,0.0),
-            undef_imod_real(A,R))
+            undef_imod_real(Type,A,R))
     ;   save_cstr_suspensions((A,B)),
         get_saved_cstr_suspensions(LSusp),
-        ((member((_,chk_undef_imod_real(BBool,AA,BB,RR)),LSusp),
+        ((member((_,chk_undef_imod_real(BBool,Type,AA,BB,RR)),LSusp),
           A == AA, B == BB)
         ->
             protected_unify(Bool,BBool),
             protected_unify(R,RR)
-        ;   ((member((_,chk_undef_idiv_real(BBool,AA,BB,RR)),LSusp),
+        ;   ((member((_,chk_undef_idiv_real(BBool,Type,AA,BB,RR)),LSusp),
               A == AA, B == BB)
             ->
                 protected_unify(Bool,BBool)
             ;   true),
-            my_suspend(chk_undef_imod_real(Bool,A,B,R),0,
+            my_suspend(chk_undef_imod_real(Bool,Type,A,B,R),0,
                        (Bool,A,B)->suspend:constrained))),
     set_priority(P),
     wake_if_other_scheduled(P).
 
-undef_imod_real(A,R) :-
+undef_imod_real(Type,A,R) :-
     real_vars(real,(A,R)),
     launch_float_int_number(A),
     launch_float_int_number(R),
-    uninterp(imod_real,[A],R).
+    uninterp_trigger(imod_real,[Type],type,Trigger),
+    uninterp(imod_real,Type,[A],R).
 
 chk_undef_float_to_real(Bool,TypeF,A,R) :-
     set_lazy_domain(real,R),
@@ -9593,7 +9681,8 @@ chk_undef_float_to_real(Bool,TypeF,A,R) :-
                        (Bool,A)->suspend:constrained))).
 
 undef_float_to_real(Type,A,R) :-
-    uninterp(float_to_real,[Type,A],R).
+    uninterp_trigger(float_to_real,[Type],real,Trigger),
+    uninterp(float_to_real,Trigger,[Type,A],R).
 /*
 undef_float_to_real(Type,A,R) :-
     get_priority(Prio),
@@ -9635,7 +9724,8 @@ chk_undef_float_to_ubv(Bool,TypeF,Size,A,R) :-
         ;   my_suspend(chk_undef_float_to_ubv(Bool,TypeF,Size,A,R),0,
                        (Bool,A)->suspend:constrained))).
 undef_float_to_ubv(Type,Size,A,R) :-
-    uninterp(float_to_ubv,[Type,Size,A],R).
+    uninterp_trigger(float_to_ubv,[Type],uint(Size),Trigger),
+    uninterp(float_to_ubv,Trigger,[A],R).
 /*
 undef_float_to_ubv(Type,Size,A,R) :-
     get_priority(Prio),
@@ -9681,7 +9771,8 @@ chk_undef_float_to_sbv(Bool,TypeF,Size,A,R) :-
                        (Bool,A)->suspend:constrained))).
 
 undef_float_to_sbv(Type,Size,A,R) :-
-    uninterp(float_to_sbv,[Type,Size,A,R],R).
+    uninterp_trigger(float_to_sbv,[Type],uint(Size),Trigger),
+    uninterp(float_to_sbv,Trigger,[A],R).
 /*
 undef_float_to_sbv(Type,Size,A,R) :-
     get_priority(Prio),
@@ -9740,7 +9831,8 @@ chk_undef_ediv_mod(Bool,Type,A,B,Q,R) :-
                        (Bool,A,B)->suspend:constrained))).
 
 undef_ediv_mod(int,A,Q,R) :- !,
-    uninterp(smt_ediv_mod_int,[A],(Q,R)).
+    uninterp_trigger(smt_ediv_mod_int,[int],int,Trigger),
+    uninterp(smt_ediv_mod_int,Trigger,[A],(Q,R)).
 undef_ediv_mod(Type,A,Q,R) :-
     arg(1,Type,N),
     All1 is 2^N-1,
@@ -9911,7 +10003,8 @@ chk_undef_div_rem(Bool,Type,A,B,Q,R,UO) :-
         ;   my_suspend(chk_undef_div_rem(Bool,Type,A,B,Q,R,UO),0,
                        (Bool,A,B)->suspend:constrained))).
 undef_div_rem(int,A,Q,R,UO) :- !,
-    uninterp(div_rem_int,[A],(Q,R)).
+    uninterp_trigger(div_rem_int,[int],int,Trigger),
+    uninterp(div_rem_int,Trigger,[A],(Q,R)).
 /*
 undef_div_rem(int,A,Q,R,UO) :- !,
     get_priority(Prio),
diff --git a/Src/COLIBRI/test_parser.pl b/Src/COLIBRI/test_parser.pl
index 1dab77b36c623c3d27605d0b034ea859c5f4629c..92e8de312eac6f0946fcd75720f1e373ce6dd08d 100644
--- a/Src/COLIBRI/test_parser.pl
+++ b/Src/COLIBRI/test_parser.pl
@@ -7,12 +7,4 @@ test_read(ENV) :-
 %% :- p_simplex_ocaml_create_parser("test_smt3.smt2",ENV),
 %%    test_read(ENV).
 
-:- p_simplex_ocaml_add_builtins([builtin("colibri_floor",[],[],[],[],[real],real)]).
-:- p_simplex_ocaml_add_builtins([builtin("nat2bv",[],[bv],[],[],[int],bitv(bv))]).
-:- p_simplex_ocaml_add_builtins([builtin("foo_fp",[],[],[m,e],[],[fp(m,e)],fp(m,e))]).
-:- p_simplex_ocaml_add_builtins([builtin("foo_bv",[],[],[m,e],[],[fp(m,e)],bitv(plus(m,e)))]).
-:- p_simplex_ocaml_add_builtins([builtin("checks",[],[],[m,e,bv],[eq(plus(m,e),bv,"bv must be of the same size than the floating point")],[fp(m,e),bitv(bv)],bool)]).
-:- p_simplex_ocaml_add_builtins([builtin("sum_fp_array",[],[],[m,e],[],[int,int,array(int,fp(m,e))],fp(m,e))]).
-:- p_simplex_ocaml_add_builtins([builtin("compose_array",[a,b,c],[],[],[],[array(a,b),array(b,c)],array(a,c))]).
-
-:- block((p_simplex_ocaml_create_parser("test_smt3.smt2", _81), repeat, p_simplex_ocaml_parser_next(_81, _92), writeq(_92), nl, nl, _92 == end, !), _74, true).
+:- block((p_simplex_ocaml_create_parser("test_poly.smt2", _81), repeat, p_simplex_ocaml_parser_next(_81, _92), writeq(_92), nl, nl, _92 == end, !), _74, true).
diff --git a/Src/COLIBRI/test_poly.smt2 b/Src/COLIBRI/test_poly.smt2
new file mode 100644
index 0000000000000000000000000000000000000000..c4e7bd08f3cff48051645849dfa54a7a916ea7ca
--- /dev/null
+++ b/Src/COLIBRI/test_poly.smt2
@@ -0,0 +1,47 @@
+;; produced by colibri.drv ;;
+(set-logic ALL)
+(set-info :smt-lib-version 2.6)
+
+(define-fun plus ((a Int) (b Int)) Int (+ a b))
+(assert (distinct 2 (plus 1 2)))
+
+(declare-sort list 1)
+(declare-sort toto 0)
+(declare-fun foo () toto)
+(declare-fun bar (Int) toto)
+(assert (distinct foo (bar 2)))
+
+(declare-fun cons (par (a) (a (list a)) (list a)))
+(declare-fun nil (par (a) () (list a)))
+
+(define-fun singleton (par (a) ((x a)) (list a) (cons x nil)))
+
+;;(assert (par (a) (exists ((x a)) (not (= nil (singleton x))))))
+
+;;(assert (forall ((x Int)) (not (= nil (singleton x)))))
+
+;;(assert (par (a) (forall ((x a)) (not (= nil (singleton x))))))
+
+(assert (not (= nil (singleton foo))))
+(assert (not (= nil (singleton 1))))
+
+(check-sat)
+(get-value ((as nil (list Int)) (singleton 1) (as nil (list toto)) (singleton foo)))
+(get-model)
+
+
+;; (declare-datatype list2 ( par (X) (
+;;   ( nil2 )
+;;   ( cons2 ( head2 X) ( tail2 ( list2 X ))))))
+
+;; (define-fun singleton2 (par (a) ((x a)) (list2 a) (cons2 x nil2)))
+
+;; (assert (forall ((x Int)) (not (= nil2 (singleton2 x)))))
+
+;; (assert (par (a) (forall ((x a)) (not (= nil2 (singleton2 x))))))
+
+;; (assert (not (= nil2 (singleton2 1))))
+
+;; (assert ((_ is cons2) (singleton2 1)))
+
+;; (assert (not (= (head2 (singleton2 1)) 1)))
diff --git a/neno b/neno
index 4a8ef5950fdaef0ef225f20eb8ae84b4a339af1a..d6219e1ca98ecfdea525aaf5f7916bd94ea50f99 100755
--- a/neno
+++ b/neno
@@ -63,6 +63,9 @@ B<man>
 
 =cut
 
+exitcode=$1
+shift
+
 _tmp=$(mktemp -d /tmp/no-error.XXXXX)
 true >$_tmp/stdout 2>$_tmp/stderr
 # Open the tmp-files for reading on file descriptor 21+22
@@ -74,11 +77,11 @@ exec 21<$_tmp/stdout 22<$_tmp/stderr
     eval "$@"
 ) >$_tmp/stdout 2>$_tmp/stderr 
 _error=$?
-if [ $_error == 0 ] ; then
+if [ $_error == $exitcode ] ; then
     # skip
     true
 else
     cat 0<&21
     cat 0<&22 >&2
+    exit 1
 fi
-exit $_error
diff --git a/test.sh b/test.sh
index 23f2e728d087cb3a9f20a7382c33594b3fcd4666..0efcd2cb24695b3f015c8b3a51dd643ff68e16bc 100755
--- a/test.sh
+++ b/test.sh
@@ -1,4 +1,5 @@
 #!/bin/sh
 
-find tests/sat -name "*.smt2" | parallel "$@" --timeout 11 "./neno echo {} \; bundle/colibri {} \; test \\\$? -eq 1"
-find tests/unsat -name "*.smt2" | parallel "$@" --timeout 11 "./neno echo {} \; bundle/colibri {} \; test \\\$? -eq 0"
+find tests/sat -name "*.smt2" | parallel "$@" --timeout 11 "./neno 1 echo {} \; bundle/colibri {}"
+find tests/unsat -name "*.smt2" | parallel "$@" --timeout 11 "./neno 0 echo {} \; bundle/colibri {}"
+find tests/unknown -name "*.smt2" | parallel "$@" --timeout 11 "./neno 2 echo {} \; bundle/colibri {}"
diff --git a/tests/sat/repr2.smt2 b/tests/sat/repr2.smt2
index 07e2b88b084259b2b9f9917ec3fe2c79ab9e6c8b..a6f9426bca9abe6380661704151d1a49269ee61b 100644
--- a/tests/sat/repr2.smt2
+++ b/tests/sat/repr2.smt2
@@ -1,5 +1,5 @@
 ;; produced by colibri.drv ;;
-(set-logic QF_NIRABVFP)
+(set-logic ALL)
 (set-info :smt-lib-version 2.6)
 ;;; generated by SMT-LIB2 driver
 ;;; SMT-LIB2 driver: bit-vectors, common part
diff --git a/tests/sat/test-Top-Floor_ceil_invalid.smt2 b/tests/sat/test-Top-Floor_ceil_invalid.smt2
index 316aa7bd69f0aef5c4c36835ed888c0f6cfabd29..6ae34cc737d7aed4ee378179ecc637ef6b5e7ad1 100644
--- a/tests/sat/test-Top-Floor_ceil_invalid.smt2
+++ b/tests/sat/test-Top-Floor_ceil_invalid.smt2
@@ -1,5 +1,5 @@
 ;; produced by colibri.drv ;;
-(set-logic QF_NIRABVFP)
+(set-logic ALL)
 (set-info :smt-lib-version 2.6)
 ;;; generated by SMT-LIB2 driver
 ;;; SMT-LIB2 driver: bit-vectors, common part
diff --git a/tests/sat/test-Top-G2_invalid.smt2 b/tests/sat/test-Top-G2_invalid.smt2
index e508f4f9117b7d21802be3087123fabb1ce5ef63..93c0c1170b2e678e026526804fe1e08ee0d18b2d 100644
--- a/tests/sat/test-Top-G2_invalid.smt2
+++ b/tests/sat/test-Top-G2_invalid.smt2
@@ -1,5 +1,5 @@
 ;; produced by colibri.drv ;;
-(set-logic QF_NIRABVFP)
+(set-logic ALL)
 (set-info :smt-lib-version 2.6)
 ;;; generated by SMT-LIB2 driver
 ;;; SMT-LIB2 driver: bit-vectors, common part
diff --git a/tests/sat/test-Top-Int_Pow1_invalid.smt2 b/tests/sat/test-Top-Int_Pow1_invalid.smt2
deleted file mode 100644
index f032f197c2f827792d7b8284022a140d1293c4ee..0000000000000000000000000000000000000000
--- a/tests/sat/test-Top-Int_Pow1_invalid.smt2
+++ /dev/null
@@ -1,27 +0,0 @@
-;; produced by colibri.drv ;;
-(set-logic QF_NIRABVFP)
-(set-info :smt-lib-version 2.6)
-;;; generated by SMT-LIB2 driver
-;;; SMT-LIB2 driver: bit-vectors, common part
-;;; SMT-LIB2: integer arithmetic
-(declare-sort string 0)
-
-(declare-fun index_bool (Bool) Int)
-
-;; index_bool_True
-  (assert (= (index_bool true) 0))
-
-;; index_bool_False
-  (assert (= (index_bool false) 1))
-
-(declare-sort tuple0 0)
-
-(declare-fun Tuple0 () tuple0)
-
-(declare-fun x () Int)
-
-(assert
-;; Int_Pow1_invalid
- ;; File "test.mlw", line 7, characters 5-21
-  (not (<= x (colibri_pow_int_int 2 1025))))
-(check-sat)
diff --git a/tests/sat/test-Top-Int_Pow_invalid.smt2 b/tests/unknown/test-Top-Int_Pow_invalid.smt2
similarity index 95%
rename from tests/sat/test-Top-Int_Pow_invalid.smt2
rename to tests/unknown/test-Top-Int_Pow_invalid.smt2
index 9a6961efe3785d1deb6f631e095203b408fe2dd7..f1a96363f91e53e4d3ccd830b4907d3c828825aa 100644
--- a/tests/sat/test-Top-Int_Pow_invalid.smt2
+++ b/tests/unknown/test-Top-Int_Pow_invalid.smt2
@@ -1,5 +1,5 @@
 ;; produced by colibri.drv ;;
-(set-logic QF_NIRABVFP)
+(set-logic ALL)
 (set-info :smt-lib-version 2.6)
 ;;; generated by SMT-LIB2 driver
 ;;; SMT-LIB2 driver: bit-vectors, common part
diff --git a/tests/unsat/O402-020_1.smt2 b/tests/unsat/O402-020_1.smt2
index ab6e40c6284c68fb05e97b81865ec760a407107a..b231168fcad062f5c85299adc2def6292c7009a7 100644
--- a/tests/unsat/O402-020_1.smt2
+++ b/tests/unsat/O402-020_1.smt2
@@ -1,6 +1,6 @@
 (set-info :smt-lib-version 2.6)
 ;;; Processed by pysmt to remove constant-real bitvector literals
-(set-logic QF_FP)
+(set-logic QF_UFFP)
 (set-info :source |SPARK inspired floating point problems by Florian Schanda|)
 (set-info :category "crafted")
 (set-info :status unsat)
diff --git a/tests/unsat/O402-020_2.smt2 b/tests/unsat/O402-020_2.smt2
index f2be4c686ae5f258597a96eb7451c394dd2bc316..9526b110c736bd5573c4e0873305a815f3231373 100644
--- a/tests/unsat/O402-020_2.smt2
+++ b/tests/unsat/O402-020_2.smt2
@@ -1,6 +1,6 @@
 (set-info :smt-lib-version 2.6)
 ;;; Processed by pysmt to remove constant-real bitvector literals
-(set-logic QF_FP)
+(set-logic QF_UFFP)
 (set-info :source |SPARK inspired floating point problems by Florian Schanda|)
 (set-info :category "crafted")
 (set-info :status unsat)
diff --git a/tests/unsat/bug11.smt2 b/tests/unsat/bug11.smt2
index 96c52c05c8348b7822bbbe4b06011d030f9c7337..cf4d4377b347d9661c513cf8c2241cc06862c13b 100644
--- a/tests/unsat/bug11.smt2
+++ b/tests/unsat/bug11.smt2
@@ -1,5 +1,5 @@
 ;; produced by colibri.drv ;;
-(set-logic QF_NIRABVFP)
+(set-logic ALL)
 (set-info :smt-lib-version 2.6)
 ;;; generated by SMT-LIB2 driver
 ;;; SMT-LIB2 driver: bit-vectors, common part
diff --git a/tests/unsat/test-Top-Double1_valid.smt2 b/tests/unsat/test-Top-Double1_valid.smt2
index dd8742789d2986e1f7baa4ba4516766e343bf9c8..01a38ee3a519a16d5aa82907577a6f5703bbcea1 100644
--- a/tests/unsat/test-Top-Double1_valid.smt2
+++ b/tests/unsat/test-Top-Double1_valid.smt2
@@ -1,5 +1,5 @@
 ;; produced by colibri.drv ;;
-(set-logic QF_NIRABVFP)
+(set-logic ALL)
 (set-info :smt-lib-version 2.6)
 ;;; generated by SMT-LIB2 driver
 ;;; SMT-LIB2 driver: bit-vectors, common part
diff --git a/tests/unsat/test-Top-Double2_valid.smt2 b/tests/unsat/test-Top-Double2_valid.smt2
index 988676ab7855615f606efa005bfa28b56735f5eb..7e2508e2ec38469ac689d2f15ed467ad9c061ac5 100644
--- a/tests/unsat/test-Top-Double2_valid.smt2
+++ b/tests/unsat/test-Top-Double2_valid.smt2
@@ -1,5 +1,5 @@
 ;; produced by colibri.drv ;;
-(set-logic QF_NIRABVFP)
+(set-logic ALL)
 (set-info :smt-lib-version 2.6)
 ;;; generated by SMT-LIB2 driver
 ;;; SMT-LIB2 driver: bit-vectors, common part
diff --git a/tests/unsat/test-Top-G0_valid.smt2 b/tests/unsat/test-Top-G0_valid.smt2
index ca17ef951c7e4ad231d2f0df9c1a1d80a182f9ee..ca119d47091ed52e008122da598bc314d124af50 100644
--- a/tests/unsat/test-Top-G0_valid.smt2
+++ b/tests/unsat/test-Top-G0_valid.smt2
@@ -1,5 +1,5 @@
 ;; produced by colibri.drv ;;
-(set-logic QF_NIRABVFP)
+(set-logic ALL)
 (set-info :smt-lib-version 2.6)
 ;;; generated by SMT-LIB2 driver
 ;;; SMT-LIB2 driver: bit-vectors, common part
diff --git a/tests/unsat/test-Top-G1_valid.smt2 b/tests/unsat/test-Top-G1_valid.smt2
index 2f11c9b103e1a17673af249d797a5c8699af64fa..1e7089c65b9a7f76a1916127914f8fdb942a2cfc 100644
--- a/tests/unsat/test-Top-G1_valid.smt2
+++ b/tests/unsat/test-Top-G1_valid.smt2
@@ -1,5 +1,5 @@
 ;; produced by colibri.drv ;;
-(set-logic QF_NIRABVFP)
+(set-logic ALL)
 (set-info :smt-lib-version 2.6)
 ;;; generated by SMT-LIB2 driver
 ;;; SMT-LIB2 driver: bit-vectors, common part
diff --git a/tests/unsat/test-Top-G3_valid.smt2 b/tests/unsat/test-Top-G3_valid.smt2
index fd2ad157bb439baee4f66f7def64963b9e519a1f..28a2de971431ac6d986d35c5fbc0b14cedbd55a9 100644
--- a/tests/unsat/test-Top-G3_valid.smt2
+++ b/tests/unsat/test-Top-G3_valid.smt2
@@ -1,5 +1,5 @@
 ;; produced by colibri.drv ;;
-(set-logic QF_NIRABVFP)
+(set-logic ALL)
 (set-info :smt-lib-version 2.6)
 ;;; generated by SMT-LIB2 driver
 ;;; SMT-LIB2 driver: bit-vectors, common part
diff --git a/tests/unsat/test-Top-G4_valid.smt2 b/tests/unsat/test-Top-G4_valid.smt2
index 07b0a8b20376d9872b1322b4c78d9ddd2b3d9fbc..26179cbc47383c4a0b0f1f0a97c1d7512454f27e 100644
--- a/tests/unsat/test-Top-G4_valid.smt2
+++ b/tests/unsat/test-Top-G4_valid.smt2
@@ -1,5 +1,5 @@
 ;; produced by colibri.drv ;;
-(set-logic QF_NIRABVFP)
+(set-logic ALL)
 (set-info :smt-lib-version 2.6)
 ;;; generated by SMT-LIB2 driver
 ;;; SMT-LIB2 driver: bit-vectors, common part
diff --git a/tests/unsat/test-Top-Square1_valid.smt2 b/tests/unsat/test-Top-Square1_valid.smt2
index 97a167f8cfcb6a109ba8aba69413f0d14fd13b8e..4c9dd699a0673edf177f967a6c1637acccfd6dd7 100644
--- a/tests/unsat/test-Top-Square1_valid.smt2
+++ b/tests/unsat/test-Top-Square1_valid.smt2
@@ -1,5 +1,5 @@
 ;; produced by colibri.drv ;;
-(set-logic QF_NIRABVFP)
+(set-logic ALL)
 (set-info :smt-lib-version 2.6)
 ;;; generated by SMT-LIB2 driver
 ;;; SMT-LIB2 driver: bit-vectors, common part
diff --git a/tests/unsat/test-Top-Square2_valid.smt2 b/tests/unsat/test-Top-Square2_valid.smt2
index c3ea3bb198bc737eb90206ec8e87faa7dcba92cf..2420cca1ab6a3b03a287b5cc5a2789a73dd5217c 100644
--- a/tests/unsat/test-Top-Square2_valid.smt2
+++ b/tests/unsat/test-Top-Square2_valid.smt2
@@ -1,5 +1,5 @@
 ;; produced by colibri.drv ;;
-(set-logic QF_NIRABVFP)
+(set-logic ALL)
 (set-info :smt-lib-version 2.6)
 ;;; generated by SMT-LIB2 driver
 ;;; SMT-LIB2 driver: bit-vectors, common part