diff --git a/HTab.cabal b/HTab.cabal
--- a/HTab.cabal
+++ b/HTab.cabal
@@ -1,5 +1,5 @@
 Name:                HTab
-Version:             1.6.0
+Version:             1.6.1
 Synopsis:            Tableau based theorem prover for hybrid logics
 Description:         Tableau based theorem prover for hybrid logics
 Homepage:            http://www.glyc.dc.uba.ar/intohylo/htab.php
@@ -15,7 +15,6 @@
 Data-files:  NEWS
              examples/*.sh
              examples/sat/*.frm
-             examples/sat_no_mod/*.frm
              examples/unsat/*.frm
 
 Extra-source-files:  tests/test-example-formulas.hs
@@ -32,6 +31,7 @@
                        HTab.DisjSet
                        HTab.DMap
                        HTab.Formula
+                       HTab.Literals
                        HTab.Main
                        HTab.ModelGen
                        HTab.Relations
@@ -41,11 +41,11 @@
                        HTab.Tableau
   Build-Depends:       base >= 4, base < 5,
                        mtl >= 2, mtl < 3,
-                       containers < 1,
-                       deepseq >= 1, deepseq <2,
+                       containers < 0.4.2,
+                       deepseq < 1.2,
                        strict < 1,
                        cmdargs >= 0.9, cmdargs < 1.0,
-                       hylolib >= 1.3.2, hylolib < 1.4
+                       hylolib == 1.4.*
   Extensions:          GADTs
                        DeriveDataTypeable
                        FlexibleContexts
diff --git a/examples/sat/d_sat1.frm b/examples/sat/d_sat1.frm
deleted file mode 100644
--- a/examples/sat/d_sat1.frm
+++ /dev/null
@@ -1,4 +0,0 @@
-signature { automatic } theory
-{
-A (D (P1))
-}
diff --git a/examples/sat/d_sat2.frm b/examples/sat/d_sat2.frm
deleted file mode 100644
--- a/examples/sat/d_sat2.frm
+++ /dev/null
@@ -1,4 +0,0 @@
-signature { automatic } theory
-{
-B N1
-}
diff --git a/examples/sat/d_sat3.frm b/examples/sat/d_sat3.frm
deleted file mode 100644
--- a/examples/sat/d_sat3.frm
+++ /dev/null
@@ -1,4 +0,0 @@
-signature { automatic } theory
-{
-A B N1
-}
diff --git a/examples/sat/d_sat4.frm b/examples/sat/d_sat4.frm
deleted file mode 100644
--- a/examples/sat/d_sat4.frm
+++ /dev/null
@@ -1,4 +0,0 @@
-signature { automatic } theory
-{
-B !N1
-}
diff --git a/examples/sat/d_sat5.frm b/examples/sat/d_sat5.frm
deleted file mode 100644
--- a/examples/sat/d_sat5.frm
+++ /dev/null
@@ -1,4 +0,0 @@
-signature { automatic } theory
-{
-n1 & B <>n1
-}
diff --git a/examples/sat/d_sat6.frm b/examples/sat/d_sat6.frm
deleted file mode 100644
--- a/examples/sat/d_sat6.frm
+++ /dev/null
@@ -1,5 +0,0 @@
-signature { automatic } theory
-{
-n1:!n2;
-n1 & B D!n1
-}
diff --git a/examples/sat/d_sat7.frm b/examples/sat/d_sat7.frm
deleted file mode 100644
--- a/examples/sat/d_sat7.frm
+++ /dev/null
@@ -1,12 +0,0 @@
-% SAT
-%  caused a loop when the saturation for the difference modality was not exhaustive,
-%  ie when we did not check if the "second different word" was already created
-
-signature { automatic } theory
-{
-!N1; !P3;
-D N1;
-P3 v ( E(N1 v N1:P2) & A(N1 v E P3));
-E(!P2 & B(!P3));
-N1 v A(P2 v D(P3 v <>(P3 & N1)))
-}
diff --git a/examples/sat/down01.frm b/examples/sat/down01.frm
--- a/examples/sat/down01.frm
+++ b/examples/sat/down01.frm
@@ -1,4 +1,3 @@
-signature { automatic } theory
-{
+begin
 N2 & <>( down N3 . ( N1:(N2 & !N3)))
-}
+end
diff --git a/examples/sat/spy.frm b/examples/sat/spy.frm
--- a/examples/sat/spy.frm
+++ b/examples/sat/spy.frm
@@ -1,6 +1,5 @@
-signature { automatic } theory
-{
+begin
 down (N1 []([]( down( N2 (N1:<>(N2))))));
 []<>true;
 [] (down (N1 (!<>N1)))
-}
+end
diff --git a/examples/sat/test01.frm b/examples/sat/test01.frm
--- a/examples/sat/test01.frm
+++ b/examples/sat/test01.frm
@@ -1,5 +1,3 @@
-signature { automatic } theory
-
-{
+begin
  !(P1 & P1)
-}
+end
diff --git a/examples/sat/test02.frm b/examples/sat/test02.frm
--- a/examples/sat/test02.frm
+++ b/examples/sat/test02.frm
@@ -1,6 +1,4 @@
-signature { automatic } theory
-
-{
+begin
  !(P1 & P1);
  P2 | P1
-}
+end
diff --git a/examples/sat/test03.frm b/examples/sat/test03.frm
--- a/examples/sat/test03.frm
+++ b/examples/sat/test03.frm
@@ -1,6 +1,4 @@
-signature { automatic } theory
-
-{
+begin
  !(P1 & P1) & (P3 -> P2);
  !(!P5 ->(P3 | !!P4))
-}
+end
diff --git a/examples/sat/test04.frm b/examples/sat/test04.frm
--- a/examples/sat/test04.frm
+++ b/examples/sat/test04.frm
@@ -1,7 +1,5 @@
-signature { automatic } theory
-
-{
+begin
  (P1 & P1 & P1 ) -> (P3 | P4);
  (P3 -> (!P2 | (P5 -> P6)));
  P6 | P7 | !P8
-}
+end
diff --git a/examples/sat/test05.frm b/examples/sat/test05.frm
--- a/examples/sat/test05.frm
+++ b/examples/sat/test05.frm
@@ -1,8 +1,6 @@
-signature { automatic } theory
-
-{
+begin
  !(P1 & P2) <--> P7 | P3;
  P5 & P3 -> (P8 | !(P10 -> P9));
  (P3 | P6) -> (P4 | !P16);
  (P7 | !P8)
-}
+end
diff --git a/examples/sat/test06.frm b/examples/sat/test06.frm
--- a/examples/sat/test06.frm
+++ b/examples/sat/test06.frm
@@ -1,5 +1,3 @@
-signature { automatic } theory
-
-{
+begin
  (N1:P1) & (N2:!P1)
-}
+end
diff --git a/examples/sat/test07.frm b/examples/sat/test07.frm
--- a/examples/sat/test07.frm
+++ b/examples/sat/test07.frm
@@ -1,7 +1,5 @@
-signature { automatic } theory
-
-{
+begin
  !(P1 & P1) & (P3 -> P2);
  N1 : !(!P5 ->(P3 | !!P4));
  N2 :  (N3 :  P3)
-}
+end
diff --git a/examples/sat/test08.frm b/examples/sat/test08.frm
--- a/examples/sat/test08.frm
+++ b/examples/sat/test08.frm
@@ -1,7 +1,5 @@
-signature { automatic } theory
-
-{
+begin
    (<>(<>(<>(P1 <--> P2))));
    ([]P3);
    ([](P3 -> (P5 | P2)))
-}
+end
diff --git a/examples/sat/test09.frm b/examples/sat/test09.frm
--- a/examples/sat/test09.frm
+++ b/examples/sat/test09.frm
@@ -1,4 +1,3 @@
-signature { automatic } theory
-{
+begin
 (P1 & (P1 & (P1 & P1))) & (P3 & (P2 & P1) & (P1 & (P2 & P3)))
-}
+end
diff --git a/examples/sat/test10.frm b/examples/sat/test10.frm
--- a/examples/sat/test10.frm
+++ b/examples/sat/test10.frm
@@ -1,5 +1,4 @@
-signature { automatic } theory
-{
+begin
  !(P1 & P1);
  !(P1 & P1);
  P2 | P1;
@@ -20,4 +19,4 @@
  ([]P3);
  ([](P3 --> (P5 | P2)));
  (P10 & (P10 & (P10 & P10))) & (P30 & (P20 & P10) & (P10 & (P20 & P30)))
-}
+end
diff --git a/examples/sat/test11.frm b/examples/sat/test11.frm
--- a/examples/sat/test11.frm
+++ b/examples/sat/test11.frm
@@ -1,5 +1,4 @@
-signature { automatic } theory
-{
+begin
 <>p1 & <><>!p1 & <><><>p1 & <><><><>!p1 & <><><><><>p1 & <><><><><><>!p1;
 [](p1 & [](!p1 & [](p1 & [](!p1 & [](p1 & []!p1)))))
-}                                                                                            
+end
diff --git a/examples/sat/test12.frm b/examples/sat/test12.frm
--- a/examples/sat/test12.frm
+++ b/examples/sat/test12.frm
@@ -1,7 +1,6 @@
-signature { automatic } theory
-{ 
+begin
 n1:[](n2 <--> n3 v n5);
 [](n1: (n2 <--> p1));
 [][]<>(p1 <--> []p3) <--> <><>p4;
 <><><>(p2 v n2:p3) <--> (<>[]p3 v <>[]p2)   
-}                                                                                             
+end
diff --git a/examples/sat/test13.frm b/examples/sat/test13.frm
--- a/examples/sat/test13.frm
+++ b/examples/sat/test13.frm
@@ -1,8 +1,5 @@
-signature { automatic }
-
-theory
-{
+begin
 [R1](<R3>p1 v p3) <--> [R3](p3 --> <R2>!p3);
 [R2](p1 --> <R2>(p1 <--> (p3 v p4 v !p5)));
 [R1][R2][R3](p1 v !p3 v !p5)
-}                                                                                             
+end
diff --git a/examples/sat/test14.frm b/examples/sat/test14.frm
--- a/examples/sat/test14.frm
+++ b/examples/sat/test14.frm
@@ -1,8 +1,7 @@
-signature { automatic } theory
-{
+begin
 <>p1 & <>(p1 & <>p1) & [](p1 & <>p1 & <>(<>!p1 & []p2));
 []!p2 & (p1 <--> p3) & [](p1 <--> p3);
 p11 v p12 v p13 v p14 v p15;
 !p11 v !p12 v !p13;
 [][][](p11 <--> p12)
-}                                                                                             
+end
diff --git a/examples/sat/test15.frm b/examples/sat/test15.frm
--- a/examples/sat/test15.frm
+++ b/examples/sat/test15.frm
@@ -1,7 +1,6 @@
-signature { automatic } theory
-{
+begin
 [](n1 <--> [](n2 <--> [](n3 <--> []n4)));
 <>[]<>(p1 <--> p2);
 [](p3 -> n1:!p1);
 (n1:n2)
-}                                                                                             
+end
diff --git a/examples/sat/test16.frm b/examples/sat/test16.frm
--- a/examples/sat/test16.frm
+++ b/examples/sat/test16.frm
@@ -1,5 +1,4 @@
-signature { automatic } theory
-{
+begin
 n1:(p1 --> p2);
 n2:(p2 --> p3);
 n3:(p3 --> p4);
@@ -9,4 +8,4 @@
 <><>(p1 v false --> p3);
 <><>(p2 --> false v [](p1 <--> n3));
 <>(<>p1 v []p3) <--> <>(<>p3 v <>p2)
-}                                                                                             
+end
diff --git a/examples/sat/test17.frm b/examples/sat/test17.frm
--- a/examples/sat/test17.frm
+++ b/examples/sat/test17.frm
@@ -1,6 +1,5 @@
-signature { automatic } theory
-{
+begin
 [R1](<R3>[R1]p3 --> n1 --> n2:n1 --> n3:n3:n4);
 n1 --> ([R1] p3 v <R3><R1>[R2] (p2 v [R1]p4));
 (n1:n3) v (n3:n1) <--> [R1](<R3>(n1 --> n3 ))
-}                                                                                             
+end
diff --git a/examples/sat/test18.frm b/examples/sat/test18.frm
--- a/examples/sat/test18.frm
+++ b/examples/sat/test18.frm
@@ -1,6 +1,5 @@
-signature { automatic } theory
-{
+begin
 ([R1] p1 )<--> ([R3]p1 <--> <R2>[R1]!p3);
 n1: [R2]<R1>p1 <--> p2 --> p3;
 false --> (false <--> n1:n3)
-}                                                                                                
+end
diff --git a/examples/sat/test19.frm b/examples/sat/test19.frm
--- a/examples/sat/test19.frm
+++ b/examples/sat/test19.frm
@@ -1,5 +1,4 @@
-signature { automatic } theory
-{
+begin
 p1 --> (false --> <R1>[R2]p3);
 [R2]<R1>(p1 <--> [R2](p1 v p2 v p3));
 [R1][R1][R2](p1 --> [R1](p2 <--> <R2>p1));
@@ -7,4 +6,4 @@
 <R1>!p1 v !p3;
 <R1><R2>(!p1 v !p3) <--> <R3>(!p1 v !p3);
 [R2][R1](n1:!p1 v !p3)
-}                                                                                             
+end
diff --git a/examples/sat/test20.frm b/examples/sat/test20.frm
--- a/examples/sat/test20.frm
+++ b/examples/sat/test20.frm
@@ -1,7 +1,6 @@
-signature { automatic } theory
-{
+begin
 (n1: p1 v n2) & (n2: p2 v n3) & (n3: p3 v n4);
 [][][](n1 <--> p3 & <>(n3 -> !p3));
 <>[](n1 <--> n4);
 (n4: (p3 <-->[]p3)) <--> (n3: (p4 <-->[]p4))
-}                                                                                             
+end
diff --git a/examples/sat/test21.frm b/examples/sat/test21.frm
--- a/examples/sat/test21.frm
+++ b/examples/sat/test21.frm
@@ -1,10 +1,8 @@
-signature { automatic } theory
-{
+begin
 n1:(n3:<R1>p3 v (n4 --> <R3> p3));
 [R1]<R3>(n3:<R3>[R3] (p1 v p2 v p3) <--> n4:n2);
 n1:n2 v n2:n1;
 [R2](<R1>p1 <--> <R3>p4);
 <R2>([R1] (p2 v !p4)) v [R3](p3 --> <R2>(<R2>!p2));
 (<R2>(P32 v P31) & <R2>(!P32 v !P31)) <--> p32
-}                                                                                             
-
+end
diff --git a/examples/sat/test22.frm b/examples/sat/test22.frm
--- a/examples/sat/test22.frm
+++ b/examples/sat/test22.frm
@@ -1,8 +1,7 @@
-signature { automatic } theory
-{
+begin
 <>[](p1 v p2) & []<>(p2 v p1) & <><>p1 & <><>p2;
 [](!p1 v !p2) & [](p3 <-->p4);
 [](p1 <--> p5 & [](p2 <--> p5));
 n1: (p1 <--> p5) & n2: (p1 <--> p5);
 n1: !n2
-}                                                                                             
+end
diff --git a/examples/sat/test23.frm b/examples/sat/test23.frm
--- a/examples/sat/test23.frm
+++ b/examples/sat/test23.frm
@@ -1,6 +1,5 @@
-signature { automatic } theory
-{
+begin
 <>(n1 & <>(n2 & <>(n3 & <>(n4 & <>(n5 & <>(n6))))));
 (n1:!n2 & n2:!n3 & n3:!n4 & n4:!n5 & n5:!n6 & n6:!n1);
 [](p1 -> [](p2 -> [](p3 -> [](p4 -> [](p5 -> [](p6)))))) 
-}                                                                                             
+end
diff --git a/examples/sat/test24.frm b/examples/sat/test24.frm
--- a/examples/sat/test24.frm
+++ b/examples/sat/test24.frm
@@ -1,9 +1,8 @@
-signature { automatic } theory
-{
+begin
 (p1 <--> p2) & (p3 <--> p4) v (p5 <--> p6) v (p6<-->p7);
 [](!p1 & !p2 & !p3 & !p4 & !p5 & !p6 & !p7);
 <>(n1:p1) & <>(n2:p2) & <>(n3:p3) & <>(n4:p4) & <>(n5:p5) & <>(n6:p6) & <>(n7:p7);
 <><>(n1:p1) & <><>(n2:p2) & <><>(n3:p3) & <><>(n4:p4) & <><>(n5:p5) & <><>(n6:p6) &
 <><>(n7:p7);
 n1:n2 & n2:n3 & n3:n4 & n4:n5 & n5:n6 & n6:n7 
-}                                                                                             
+end
diff --git a/examples/sat/test25.frm b/examples/sat/test25.frm
--- a/examples/sat/test25.frm
+++ b/examples/sat/test25.frm
@@ -1,5 +1,4 @@
-signature { automatic } theory
-{
+begin
 n1:p1 v n2:p2 v n3:p3 v n4:p4;
 []!p1 & []!p2 & []!p3 & []!p4
-}                                                                                             
+end
diff --git a/examples/sat/test26.frm b/examples/sat/test26.frm
--- a/examples/sat/test26.frm
+++ b/examples/sat/test26.frm
@@ -1,5 +1,4 @@
-signature { automatic } theory
-{
+begin
 (n1: <>[]!p1) | (n1: []<>p2) | (n2: p3);
 (n1: <>n3) | (n2: p1)
-}
+end
diff --git a/examples/sat/test27.frm b/examples/sat/test27.frm
--- a/examples/sat/test27.frm
+++ b/examples/sat/test27.frm
@@ -1,4 +1,3 @@
-signature { automatic } theory
-{
+begin
 A (p1 ^ []!p1)
-}
+end
diff --git a/examples/sat/test28.frm b/examples/sat/test28.frm
--- a/examples/sat/test28.frm
+++ b/examples/sat/test28.frm
@@ -1,5 +1,4 @@
-signature { automatic } theory
-{
+begin
 A []p1;
 !p1
-}
+end
diff --git a/examples/sat/test29.frm b/examples/sat/test29.frm
--- a/examples/sat/test29.frm
+++ b/examples/sat/test29.frm
@@ -1,5 +1,4 @@
-signature { automatic } theory
-{
+begin
 A[](([]!p1) v (<>p1));
 n1:<><>p1
-}
+end
diff --git a/examples/sat/test30.frm b/examples/sat/test30.frm
--- a/examples/sat/test30.frm
+++ b/examples/sat/test30.frm
@@ -1,4 +1,3 @@
-signature { automatic } theory
-{
+begin
 A(!N0 v !N1)
-}
+end
diff --git a/examples/sat/test31.frm b/examples/sat/test31.frm
--- a/examples/sat/test31.frm
+++ b/examples/sat/test31.frm
@@ -1,4 +1,3 @@
-signature { automatic } theory
-{
+begin
 A(N0 : true)
-}
+end
diff --git a/examples/sat/test32.frm b/examples/sat/test32.frm
--- a/examples/sat/test32.frm
+++ b/examples/sat/test32.frm
@@ -1,4 +1,3 @@
-signature { automatic } theory
-{
+begin
 A(N0 & E true)
-}
+end
diff --git a/examples/sat/test33.frm b/examples/sat/test33.frm
--- a/examples/sat/test33.frm
+++ b/examples/sat/test33.frm
@@ -1,12 +1,5 @@
-% satisfiable 
-% found unsatisfiable if the branching dependencies are not copied
-% to the right structures when there is an equivalence class merge
-
-signature { automatic } theory
-
-{
-
+begin
 n1:[]false;
 n2:<>true;
 (<><>true ) v (n2 & n1)
-}
+end
diff --git a/examples/sat/test34.frm b/examples/sat/test34.frm
--- a/examples/sat/test34.frm
+++ b/examples/sat/test34.frm
@@ -1,10 +1,7 @@
-% caused a problem of in the interaction between backjumping and equivalence classes
-
-signature { automatic } theory
-{
+begin
 P1 v !N1:(!N1 v !P1);
 N1 v !N1:(!N1 v P1);
 P1 v N1:(!P1 v !N1);
 !P1 v ![R1](!N1 v P1);
 P1 v [R1](P1 v N1)
-}
+end
diff --git a/examples/sat/test35.frm b/examples/sat/test35.frm
--- a/examples/sat/test35.frm
+++ b/examples/sat/test35.frm
@@ -1,9 +1,7 @@
-% caused a problem of in the interaction between backjumping and equivalence classes
-signature { automatic } theory
-{
+begin
 !N1 v !A(!N1 v !P1);
 N1 v !N1:(!P1 v !N1);
 P1 v [R1](N1 v P1);
 !P1 v [R1](!P1 v !N1);
 !N1 v A(!P1 v !N1)
-}
+end
diff --git a/examples/sat/test36.frm b/examples/sat/test36.frm
--- a/examples/sat/test36.frm
+++ b/examples/sat/test36.frm
@@ -1,7 +1,6 @@
-signature { automatic } theory
-{
+begin
 N1;
 <>true;
 []<>true;
 []N1
-}
+end
diff --git a/examples/sat/test37.frm b/examples/sat/test37.frm
--- a/examples/sat/test37.frm
+++ b/examples/sat/test37.frm
@@ -1,13 +1,6 @@
-% sat
-% may be found unsatisfiable if the dependencies are not
-% correctly propagated when [] constraints and accessibility
-% formulas meet, after an equivalence class merge
-
-signature { automatic } theory
-
-{
+begin
 N1;
 <><>(N2 & P1);
 E false v [](N1 v E true);
 [](!P1 v N2:(N1 & !P1))
-}
+end
diff --git a/examples/sat/test38.frm b/examples/sat/test38.frm
--- a/examples/sat/test38.frm
+++ b/examples/sat/test38.frm
@@ -1,8 +1,4 @@
-% had bad model building at some point with chain blocking
-
-signature { automatic } theory
-
-{
+begin
 A<><>!N1;
 [](P1 v N1) & []!P1
-}
+end
diff --git a/examples/sat/test39.frm b/examples/sat/test39.frm
--- a/examples/sat/test39.frm
+++ b/examples/sat/test39.frm
@@ -1,7 +1,102 @@
-signature { automatic } theory
-{
-P1  v N2:N1;
-!N2 v (!N2 & B false);
-!P1 v <>false;
-N1  v []true
-}
+begin
+-N3 v -N5 v -N3:(-N4 v -[R1](P2 v -[R1](-N5 v N1 v -N3:(-N5 v P4 v -N4)) v N3:(-N4 v P2 v N2)) v -[R1](N1 v -N3:(-N2 v -P1 v -N5)));
+-P4 v [R1](-P5 v N3 v [R1](-P1 v N3 v N2:(N4 v P5 v N2:(-P1 v -P3 v P5)))) v -[R1](P1 v -N1:(P4 v P3 v N5:(N1 v -N3 v -N4)) v -N3:(-N4 v N5 v -N1));
+-N5 v P5 v [R1](-P1 v -N4:(N5 v N2 v -N2:(-N3 v -[R1](P4 v -N3 v -N4))) v N3:(N1 v -[R1](P3 v P2 v N3)));
+N3 v -[R1](N1 v [R1](N4 v -N4:(N3 v -N5:(N2 v -N1 v P3)) v N5:(-P3 v -P5 v -P1)) v -N4:(-N1 v N2:(-P2 v P3 v -P1))) v [R1](-N5 v -N2:(P2 v P4 v N4:(P1 v -N2 v N1)) v N5:(-N2 v -N3 v -N4));
+P5 v -P1 v [R1](-P2 v -P5 v -N5:(N4 v -N2:(N5 v -[R1](-P3 v P5 v -N1)) v -[R1](-N1 v N4 v -N2)));
+N2 v -N4 v [R1](-P4 v -N1 v -[R1](N4 v -N2:(-P4 v N5 v -N4:(-N1 v P1 v N3)) v N1:(-P2 v -P5 v -P4)));
+-P1 v -N2 v N4:(-N5 v [R1](P3 v N2 v [R1](-P1 v -N1 v N3:(-N4 v P3 v -N1))) v N2:(P1 v -[R1](P2 v -P4 v -N1)));
+N4 v N3:(P1 v N4 v N4:(-P2 v -N2 v -[R1](N2 v N3 v [R1](N2 v N5 v P5)))) v -[R1](-P1 v P3 v [R1](-P4 v -N3:(-P5 v -N2 v P3)));
+N2 v -P3 v [R1](-P3 v N4:(N5 v N3 v N2:(N4 v N3 v [R1](P3 v -P2 v -P5))) v -[R1](-P2 v N3:(-P5 v P2 v -N2)));
+P5 v N4:(-P2 v P3 v N5:(-P5 v [R1](N2 v -P2 v [R1](-P1 v -P2 v P5)) v [R1](N2 v P5 v -P4))) v N4:(P3 v N1 v [R1](N4 v N2 v [R1](P4 v -P2 v N5)));
+P3 v [R1](-P4 v -[R1](-N5 v -N4 v -N4:(-N2 v P5 v -N3:(-P5 v P2 v -N4))) v -N5:(-P5 v -N3 v -N1:(P3 v -P2 v P1))) v [R1](-N4 v N2 v -N1:(N4 v -N3 v -N5:(P4 v N4 v P3)));
+P1 v -N2 v [R1](-N4 v N1:(-N5 v [R1](P4 v N4:(-P3 v -N3 v N2)) v N1:(-P1 v -N4 v -N2)) v N2:(P5 v [R1](P2 v N4 v -P1)));
+P4 v -N3 v -[R1](-N1 v -N5:(P4 v -[R1](P5 v P1 v N3:(-N5 v -P4 v P3)) v N3:(P1 v -N1 v -P4)) v -[R1](-N5 v P5 v -N1:(P4 v P2 v N2)));
+-N3 v -N5:(-P1 v P2 v [R1](-P5 v -N3 v [R1](-N5 v N3:(-P2 v -N5 v -P1)))) v N5:(N2 v P3 v [R1](-P3 v P4 v -[R1](-N5 v -N3 v -N2)));
+N5 v N3 v -[R1](N5 v -N1 v -N2:(-P5 v N4 v N2:(N3 v [R1](N5 v P1 v -N2))));
+N2 v N3:(-N5 v -N3:(N2 v [R1](N2 v [R1](N1 v -N4 v P4)) v [R1](P2 v N1 v -P4)) v -[R1](P2 v -N1 v [R1](N4 v -N2 v P3))) v -[R1](N1 v [R1](-P1 v P4 v -N1:(-N2 v -N4 v -N3)) v -N3:(N4 v -N1 v P3));
+-N4 v -[R1](P3 v P2 v -N4:(P5 v -P1 v N3:(P3 v N1 v -[R1](N4 v N5 v -P3)))) v -N1:(N4 v N3:(N1 v -N4 v [R1](-N2 v -N1 v -P4)) v [R1](P3 v N1 v -N2));
+-N3 v [R1](N3 v N2 v -[R1](-P3 v -N2:(N4 v -N4:(-N3 v N1 v P3)) v -N1:(-N2 v P5 v -N3))) v -[R1](N5 v N2:(-P1 v -N4:(-N5 v N2 v -N3)) v N4:(-P3 v -N1 v -P1));
+-P4 v [R1](-N2 v -N5 v [R1](-P1 v -N1:(P1 v P2 v N5:(-P1 v -N4 v N1)) v N3:(-N4 v P1 v -N1))) v [R1](-P4 v -P3 v N2:(-P3 v -N4:(-N2 v N1 v -N3)));
+-N2 v -[R1](-P5 v -P1 v -[R1](-N4 v -N3:(-N5 v N3:(-P5 v -N2 v P4)) v -N3:(N5 v N2 v N4))) v [R1](-P5 v P3 v N5:(N3 v -N1:(-N3 v -P4 v -P3)));
+P3 v P4 v [R1](N3 v -[R1](-N1 v N2 v N4:(P2 v P1 v -N1:(N5 v -P5 v N2))) v -N1:(-P5 v N3 v N2:(N4 v -N3 v N5)));
+-P4 v P5 v [R1](N5 v N4 v [R1](-P1 v -N2:(P5 v N4:(P4 v -P5 v P2)) v -N2:(N5 v N3 v N1)));
+-N5 v -N1:(-P1 v N2:(-N5 v -[R1](N1 v [R1](P2 v N2 v -N3)) v [R1](P2 v -N2 v -P3)) v [R1](N5 v N4 v [R1](N3 v -N5 v -P1))) v -N2:(-P1 v [R1](-N1 v -[R1](N1 v N3 v P1)) v -[R1](N4 v P1 v P4));
+N3 v -N2 v -[R1](-P1 v P2 v -N2:(-N3 v N5:(-N4 v P2 v -[R1](-N3 v N4 v N2)) v [R1](-N1 v N4 v P5)));
+-P5 v N1 v -[R1](P3 v -N5 v [R1](N1 v -N1:(-N3 v P1 v -N4:(-N5 v -N2 v N1)) v N4:(N5 v P5 v -P3)));
+P3 v [R1](-P5 v N5 v -N3:(N1 v N2 v -N4:(-P3 v N2 v [R1](-N1 v P1 v P2)))) v -[R1](N4 v N1:(N3 v -N4:(N3 v -N5 v P2)) v N3:(-P3 v P5 v P4));
+-N5 v [R1](-N1 v -[R1](N2 v N1:(P4 v P1 v N4:(-P2 v -N5 v P3)) v -N5:(N1 v P1 v P5)) v -N4:(-N1 v N1:(-P1 v -N3 v P3))) v [R1](P4 v N5 v -N2:(-P3 v P5 v -N2:(-P5 v P3 v N4)));
+-P4 v -N2 v -[R1](-P2 v -[R1](N5 v -N2:(-P4 v N4:(P5 v -P1 v N5)) v -N4:(N1 v -N5 v -P3)) v N4:(-P4 v N3 v N3:(-P4 v P2 v P1)));
+P4 v N2:(-N4 v N1:(-P4 v N3 v -[R1](-N1 v -P5 v [R1](N4 v -N1 v -N3))) v -[R1](-N1 v -P4 v [R1](N1 v -N4 v P2))) v -N3:(P5 v -[R1](-P2 v -[R1](-P4 v -P3 v N1)) v [R1](-P3 v -N5 v -P5));
+N5 v N4 v -[R1](N5 v [R1](N1 v P5 v N2:(-P5 v N5 v -N2:(N3 v -P1 v N4))) v -N2:(N3 v N2:(P4 v -P1 v -P3)));
+-P5 v -N3 v [R1](P5 v -N1:(-P3 v -P4 v -N2:(-N3 v -[R1](P3 v -P4 v N4))) v [R1](P2 v -N3 v N2:(-P4 v -N5 v -N4)));
+P5 v -N5 v -N3:(-P4 v P5 v -[R1](P2 v -[R1](-P4 v -P5 v -N3:(P3 v N1 v -P4)) v N5:(P3 v N4 v -N1)));
+P3 v N2 v [R1](N3 v -N5 v [R1](P4 v N5 v -N5:(P4 v N3:(-N5 v -N4 v N1))));
+-P3 v P4 v -N2:(-N3 v P3 v -N1:(-N5 v -[R1](-N3 v -[R1](P2 v P1 v -N2)) v -[R1](P4 v -N4 v P5)));
+N3 v -N3:(-P4 v N5:(P4 v N4 v -[R1](P4 v -N1 v -[R1](P4 v -P1 v N2))) v -[R1](-P3 v [R1](P1 v N1 v P4))) v [R1](N5 v -P2 v [R1](-N5 v N3:(-N4 v -P2 v -P4)));
+-P5 v [R1](-N4 v -N3 v [R1](-P1 v N2:(-P4 v N4:(-P4 v -P1 v P2)) v -N2:(N4 v N3 v -N1))) v [R1](-P5 v P1 v -N4:(-N1 v -P3 v -N5:(P1 v -P4 v P3)));
+N3 v -N5:(-P3 v [R1](N5 v -N3 v -[R1](-N5 v -N2:(-N5 v P3 v -N1))) v [R1](-N4 v -N5 v N5:(N3 v N4 v -P2))) v N4:(P3 v [R1](-P3 v -[R1](-N3 v N2 v -N4)) v [R1](P2 v -N5 v N4));
+-P2 v -[R1](P1 v -N4 v [R1](-N1 v -N2:(N5 v N4 v N3:(P4 v N4 v -N2)) v -N5:(P3 v -P5 v -N2))) v -[R1](-N2 v -N4 v N2:(-P5 v -N3 v N2:(P2 v -N1 v -N3)));
+-P5 v N5:(-P1 v -P3 v N4:(P1 v -[R1](-N5 v -[R1](-P1 v -N2 v P4)) v [R1](-N5 v -N4 v -N1))) v -N5:(-P2 v P3 v -[R1](N4 v P2 v [R1](-P4 v P5 v -P3)));
+-P4 v -P3 v -N5:(P3 v -N1 v -[R1](-N5 v -P1 v N5:(-P2 v -N3 v [R1](P2 v -N3 v P5))));
+-P5 v -[R1](N2 v N1 v [R1](P1 v -N3 v -N2:(-P3 v N2:(-N1 v P2 v P1)))) v -[R1](-P3 v -P1 v -N5:(N3 v N4:(-N3 v -P2 v -N2)));
+N1 v -[R1](-P2 v N1 v [R1](N2 v P1 v -N3:(-N4 v N5 v -N5:(P1 v P2 v N1)))) v [R1](-N1 v N2:(P2 v -N2:(-P5 v -N1 v P3)) v N2:(P4 v -P2 v -N5));
+P2 v N4 v -[R1](N5 v P4 v -N3:(P5 v N1:(-P5 v -P3 v [R1](-P3 v -P5 v P2)) v -[R1](N4 v -P5 v -P1)));
+-P2 v [R1](N1 v -N4 v -[R1](P5 v -N2 v -N1:(N2 v N5 v N5:(-P3 v -P4 v P5)))) v -N4:(P4 v -N1:(N3 v P2 v [R1](N5 v -N2 v -N1)) v [R1](P1 v -P5 v -P4));
+-N2 v N3 v N4:(N3 v -[R1](-P1 v -N1 v [R1](N5 v N2:(-N5 v N4 v P1))) v -N1:(N4 v -[R1](N2 v N4 v -P5)));
+-N2 v N1:(P3 v [R1](-P1 v P5 v -[R1](-P1 v N1:(-N4 v N3 v N2))) v N5:(N4 v [R1](-P4 v -N5 v -P5))) v -N3:(-P5 v -[R1](N5 v -P4 v -[R1](-P1 v -P5 v -P3)) v [R1](P2 v -N5 v P3));
+P2 v N1:(N2 v [R1](-P4 v N3:(P5 v -[R1](P2 v N2 v N3)) v -[R1](P4 v -P3 v N4)) v -N2:(-N5 v -N3 v [R1](P1 v N2 v -P5))) v N1:(N4 v P4 v [R1](-P3 v -[R1](-N4 v -P1 v -P2)));
+N2 v -P4 v [R1](P5 v N3 v [R1](N2 v -N2:(P5 v N5:(P2 v P1 v N4)) v N1:(-N3 v -N5 v N2)));
+N3 v -N4:(-P2 v N3 v -N2:(P2 v N3 v [R1](N3 v -P4 v -[R1](-N4 v -P2 v -P1)))) v -[R1](-P2 v [R1](-N4 v -N3:(P4 v P5 v -P1)) v -N1:(N3 v P3 v -N2));
+P4 v [R1](N2 v -P1 v N3:(-P2 v -N4:(-N5 v N1 v [R1](-N2 v P4 v -N3)) v [R1](P1 v -P5 v N1))) v -N1:(-P4 v -N4:(-P2 v -[R1](-P4 v -N4 v N5)) v [R1](-P2 v -P5 v -P3));
+N4 v N1:(P4 v N4 v N4:(-N2 v P1 v [R1](P2 v N4 v -[R1](-P5 v -P1 v N1)))) v -[R1](-N2 v N2:(P3 v [R1](N1 v P4 v -P2)) v [R1](P2 v N2 v -N5));
+N5 v -P2 v -[R1](-P5 v [R1](P5 v -P2 v N1:(-P5 v -N3:(-P3 v -N4 v P1))) v -N5:(-N1 v N3:(N4 v -N5 v P3)));
+N1 v P2 v N5:(P4 v P2 v [R1](-P2 v -N4:(N3 v [R1](P2 v -N3 v P4)) v -[R1](-P4 v N4 v -P1)));
+P2 v -N2:(P5 v N3:(-N1 v -[R1](-N5 v -[R1](P1 v N3 v N4)) v -[R1](P3 v -N5 v -N4)) v [R1](P5 v P2 v [R1](-P5 v -P2 v P1))) v N1:(-P2 v -[R1](-P1 v -P4 v [R1](N3 v -N4 v -P1)) v [R1](-P4 v N4 v P1));
+-N1 v P4 v [R1](N4 v -P4 v -N5:(-P4 v -N3 v N2:(-P4 v -N3 v [R1](N2 v -P1 v -N5))));
+P2 v N5:(P2 v -[R1](N5 v N4:(-N5 v [R1](-P1 v P5 v -P2)) v [R1](P3 v P5 v -N2)) v -[R1](-P4 v -P1 v N2:(-N1 v -P2 v -P3))) v -[R1](N4 v N2:(-P5 v -N1 v -[R1](-N2 v -P3 v P2)) v -[R1](-P4 v -P1 v N3));
+-P1 v N1:(-N3 v N4:(-P4 v N1 v [R1](-P2 v P1 v -[R1](-N2 v -N5 v -P3))) v [R1](P1 v [R1](-P5 v -N5 v N3))) v [R1](P3 v -P1 v -[R1](-P3 v -N4:(P1 v N5 v P3)));
+N4 v -[R1](-N4 v N2 v -[R1](-N4 v P5 v N1:(N4 v -P1 v N4:(P3 v P4 v P2)))) v [R1](-P4 v -P1 v N3:(-P4 v P5 v -N2:(N4 v P3 v -N3)));
+N2 v P3 v N4:(-P5 v [R1](P1 v N3 v -[R1](-N4 v -N1:(-N2 v -N3 v -P5))) v -[R1](-N4 v N5:(P2 v -P4 v -N1)));
+N5 v -P3 v [R1](-N3 v -[R1](P4 v N5 v N2:(N5 v N1:(-N4 v -P5 v -P1))) v -N5:(N3 v -P5 v N1:(-N4 v P5 v P4)));
+N4 v N1:(N5 v -[R1](-N2 v [R1](-P3 v -N4 v N2:(P3 v -P5 v -N1)) v -N5:(N1 v P2 v N4)) v N4:(-N2 v -[R1](-P2 v P3 v P4))) v -N1:(P3 v -[R1](-N5 v [R1](P3 v N4 v -N5)) v -[R1](N3 v -N1 v -N4));
+-N4 v N3:(P1 v -N2:(P4 v [R1](N5 v -[R1](N3 v P5 v -P4)) v [R1](-N5 v P4 v -P2)) v -[R1](-N4 v -[R1](P1 v -N5 v -P5))) v N2:(P5 v [R1](-P4 v -[R1](-N5 v N1 v -N2)) v [R1](-N3 v N2 v N5));
+P5 v N1:(N3 v -[R1](-N5 v -N3 v -N5:(-P5 v -[R1](P3 v -N4 v -P5))) v -[R1](P5 v -N4 v -N1:(-N3 v -N4 v -N2))) v -N2:(N5 v -N3 v [R1](P5 v -N2 v [R1](N4 v -P2 v -P1)));
+-N4 v -P1 v [R1](P2 v N2 v -[R1](P3 v -N5:(N1 v P3 v -N5:(-P2 v N3 v -N1)) v N2:(P4 v -N3 v -P3)));
+-N1 v -N3:(N2 v N1 v N2:(N5 v P3 v -[R1](P4 v -[R1](N5 v P3 v -P4)))) v N4:(-N5 v -P3 v -[R1](-N3 v -[R1](-N3 v -N2 v P4)));
+P4 v [R1](-N5 v -N3 v N1:(-P4 v -N5 v [R1](P1 v -P3 v -N1:(N2 v -N3 v -P4)))) v N2:(-N1 v -N4:(-N5 v [R1](-P3 v -N2 v P2)) v [R1](N5 v -N2 v P5));
+-N5 v [R1](P4 v -N1:(N4 v -[R1](-P2 v N2:(-N5 v -N3 v -P5)) v -N4:(-P5 v -N3 v -N1)) v [R1](-N4 v -N2:(N3 v P2 v N4))) v -N5:(P1 v N2:(P3 v P5 v -[R1](N5 v -P2 v -P4)) v [R1](-N1 v -N5 v -P2));
+-N2 v N4:(N1 v [R1](N2 v -P2 v -[R1](-N3 v -N4 v N2:(-N5 v P3 v -N3))) v [R1](-P1 v -N2:(-N4 v -N3 v -P1))) v N3:(-N5 v P3 v [R1](-P2 v -P1 v [R1](N1 v -N3 v N4)));
+-N5 v [R1](P4 v -[R1](-N4 v -N3 v N3:(-P5 v N1 v N1:(N4 v -N2 v P1))) v N1:(-N2 v N5 v -N1:(N4 v N2 v -N3))) v N4:(N1 v -[R1](N2 v -N1:(-N4 v -N2 v N3)) v N1:(-P5 v -P1 v N5));
+P1 v P2 v -[R1](N3 v -N2:(P4 v N4 v -[R1](-P3 v P2 v -N4:(P1 v N2 v -P3))) v -N5:(P5 v N2 v [R1](-N1 v P4 v N4)));
+-P3 v P1 v [R1](-N2 v N5 v [R1](P3 v -N4 v -N1:(N5 v -N3 v -N2:(-P4 v N1 v P5))));
+-P1 v N4 v N2:(P2 v -N3:(-P2 v -P4 v -[R1](-N2 v [R1](-P1 v -P5 v P3))) v [R1](P1 v [R1](N3 v -N1 v N4)));
+N4 v -N5:(-P1 v -N5:(P2 v P5 v [R1](P2 v -P4 v [R1](P3 v -N2 v -N1))) v [R1](-P2 v -P3 v [R1](P3 v N4 v -P5))) v -[R1](P2 v N1:(N4 v -[R1](-P4 v -P5 v N5)) v -[R1](-N2 v -P3 v -P5));
+P4 v -N1 v N3:(-P4 v P2 v -[R1](P2 v -P3 v N2:(P4 v -P3 v -[R1](N3 v -N4 v N2))));
+-P1 v -P5 v -N5:(N2 v -N1 v [R1](-P3 v -P2 v [R1](N4 v N4:(P5 v P3 v P4))));
+-P1 v -[R1](-N3 v -N4:(-N1 v -N3:(P3 v -[R1](P4 v N4 v P3)) v -[R1](-P1 v N3 v -P5)) v -[R1](-N5 v N4 v -N5:(N3 v N2 v -N4))) v [R1](P3 v -N1:(-N5 v N4 v -N1:(P4 v N5 v -N2)) v -N4:(-P5 v P3 v N3));
+P2 v P5 v N4:(-P2 v P1 v -[R1](-P3 v -N2 v -N4:(P1 v N2 v -[R1](N2 v P5 v P1))));
+N4 v [R1](P4 v P1 v -N5:(P2 v -P5 v [R1](P4 v -P2 v N3:(-N5 v P3 v P4)))) v -N3:(P4 v N4:(N5 v -[R1](N1 v -P1 v -P3)) v [R1](-N2 v N5 v -P1));
+-P3 v -N4 v [R1](N5 v N3 v -[R1](-N1 v -P3 v -N4:(P1 v P4 v N5:(N2 v -P3 v -N3))));
+-N4 v [R1](N1 v -[R1](N4 v -N5 v -N3:(N4 v P2 v -N5:(-P5 v P4 v P2))) v -N3:(N2 v -N5:(-N2 v P1 v -P5))) v [R1](P4 v N5 v N5:(P3 v N4:(-N1 v N3 v -N2)));
+-P1 v N5 v N2:(N4 v P3 v N1:(-P3 v -N2 v [R1](-P2 v [R1](-N3 v N1 v P4))));
+P5 v N4 v -N5:(-P1 v N2 v -N3:(P4 v P3 v [R1](-N5 v -[R1](-N4 v -P4 v N1))));
+P2 v -N1:(-P5 v [R1](P2 v N3:(N4 v -N5 v -[R1](-N5 v P2 v -N4)) v [R1](N1 v N4 v -N5)) v N2:(-N5 v -[R1](P1 v -N4 v -P5))) v N2:(-P1 v -N1 v [R1](-P2 v -N4 v [R1](N3 v -N2 v -N4)));
+N2 v -P2 v -N2:(P5 v N2:(-N1 v P2 v -[R1](N4 v P5 v [R1](-N1 v -N4 v P5))) v [R1](-P5 v -[R1](-N2 v P4 v -N1)));
+-P4 v -[R1](-P5 v -[R1](-P4 v N2:(P2 v -N3 v -N5:(P5 v P3 v P4)) v N2:(P5 v N1 v -N5)) v -N4:(N3 v -N2 v -N2:(N1 v -N3 v P2))) v [R1](-P5 v P2 v N5:(-P2 v N5:(-P3 v P2 v P1)));
+N5 v -P3 v -[R1](-N2 v P2 v N3:(-N1 v N2:(P1 v N1 v -[R1](P2 v N5 v P1)) v [R1](P1 v P4 v -P5)));
+P3 v -N4 v [R1](P3 v -[R1](N2 v -P3 v -N1:(N3 v P3 v -N2:(-N5 v -N4 v N1))) v -N4:(P5 v N5 v -N4:(N2 v -N3 v N1)));
+-P5 v -P3 v -N4:(P4 v P3 v N2:(-N3 v -N1 v [R1](-P3 v -N5 v -[R1](P5 v -P1 v -P2))));
+N4 v -N5:(P4 v [R1](N2 v P3 v -N5:(-P4 v -P1 v [R1](N4 v -P4 v -P5))) v -[R1](-P4 v -N1 v N2:(-P1 v -N5 v N4))) v N3:(P5 v -[R1](-N2 v [R1](-P4 v P2 v P1)) v -[R1](-N4 v P2 v -P5));
+N5 v -N2:(N1 v N5 v [R1](P4 v P2 v [R1](P3 v -N1 v -N5:(P2 v P4 v N3)))) v -[R1](-N4 v N3 v -N3:(-N2 v [R1](N4 v P1 v N1)));
+P2 v N1 v N2:(P1 v P2 v -N2:(N5 v P3 v [R1](P4 v -[R1](-P1 v -N3 v -P2))));
+-P2 v -N2 v N4:(N5 v N4:(N5 v N3 v [R1](-N2 v P4 v -[R1](-N2 v -P1 v -P4))) v [R1](-N5 v -[R1](N2 v -P3 v -N4)));
+N1 v [R1](-P3 v -[R1](-P2 v N3:(N2 v P3 v -N2:(N5 v -P3 v -P1)) v N1:(N4 v -N2 v N5)) v N1:(-P1 v -N5 v N2:(N5 v -P2 v P1))) v -N4:(N1 v P5 v [R1](P5 v N4:(-P2 v -P3 v N2)));
+-N4 v -N3:(N4 v N1:(-N5 v N3 v [R1](N3 v P4 v -[R1](P5 v N4 v -P2))) v [R1](-P5 v -[R1](-P5 v -N4 v -N5))) v [R1](-P5 v N4:(N2 v -[R1](-P5 v N3 v -N1)) v [R1](P3 v N1 v P4));
+-P2 v -N1:(N2 v N1:(P5 v P2 v -[R1](N1 v -N3 v [R1](P2 v -N2 v P3))) v -[R1](N1 v -[R1](-N1 v -N4 v P1))) v -[R1](-N1 v -[R1](P4 v -N2:(P2 v -N5 v N1)) v -N4:(P2 v -P4 v N5));
+N1 v -N4 v N1:(-P1 v N5 v -N5:(N3 v N1 v -[R1](-P2 v [R1](N3 v N4 v -P1))));
+P1 v N1 v N2:(N5 v -[R1](-N5 v -P4 v -N4:(-P2 v [R1](N3 v -P5 v P4))) v -N2:(-N5 v -[R1](N3 v N1 v P4)));
+-N1 v N5 v -N3:(-P2 v [R1](N5 v -N4:(-P4 v -[R1](P1 v N4 v N5)) v -[R1](P5 v -P2 v N4)) v -N4:(N1 v -[R1](-N3 v -P4 v N2)));
+-N2 v -N3 v -[R1](P4 v -N3 v -[R1](N1 v N3:(N5 v -N3:(-N1 v -N2 v P4)) v N1:(P3 v -N2 v -N4)));
+N1 v -N1:(N5 v -N5:(-N2 v [R1](-P4 v -[R1](-P2 v -N5 v -N1)) v [R1](-P4 v -P1 v N1)) v [R1](-P2 v [R1](P4 v P2 v P3))) v -[R1](-N4 v -P4 v N4:(N1 v -[R1](N2 v -N3 v N4)))
+end
diff --git a/examples/sat/test41.frm b/examples/sat/test41.frm
new file mode 100644
--- /dev/null
+++ b/examples/sat/test41.frm
@@ -0,0 +1,52 @@
+begin
+N4 v [R1](N2 v N3 v [R1](-N4 v N1:(-N5 v -N4:(-P1 v -N5 v P3)) v N1:(-P5 v P4 v -P2))) v N2:(P1 v -P3 v -[R1](P5 v P3 v N2:(-P3 v P5 v P2)));
+-P1 v -N2:(N3 v -N2:(-N5 v -N3 v [R1](-P4 v [R1](P4 v -N4 v -P2))) v -[R1](N3 v -[R1](-P2 v -N1 v -P5))) v [R1](N3 v N1:(-N2 v N3 v -[R1](P1 v -P2 v -P5)) v -[R1](-N5 v -P4 v N3));
+-P2 v -N5:(N2 v [R1](-N5 v -N5:(-P4 v -P2 v -[R1](-N4 v -N2 v -N5)) v -[R1](N5 v N2 v -N4)) v -N3:(-N5 v P2 v [R1](-P1 v N3 v N2))) v -N1:(-N3 v [R1](P2 v -P5 v [R1](P2 v -N1 v P3)) v -[R1](-N3 v -P5 v -N2));
+-P1 v -[R1](-P3 v -N3 v [R1](-N3 v -P5 v -N5:(-N3 v N2:(-N1 v P2 v N4)))) v -[R1](N5 v P1 v -N5:(-N1 v N4:(P1 v -N2 v N5)));
+N4 v -N1 v [R1](-P4 v -P2 v -N4:(P4 v -N3 v N1:(-P5 v [R1](-P4 v -N2 v P5))));
+-N1 v -P5 v -[R1](-P2 v [R1](-N5 v N4 v -N3:(N1 v -P5 v N4:(-N5 v N2 v P4))) v -N1:(-P5 v -N4:(-P4 v P3 v N3)));
+P3 v P1 v [R1](P3 v -N3:(N5 v -[R1](-P1 v N5 v -N4:(-N1 v N3 v P5)) v -N4:(-P5 v P2 v -N1)) v -N5:(N1 v -P2 v [R1](P1 v -P2 v -P3)));
+-P5 v -N4 v -N3:(-N1 v -P1 v N1:(-N4 v -N5 v [R1](N2 v [R1](P2 v P5 v -P1))));
+-N2 v P1 v -[R1](-P5 v N2 v -N5:(N3 v -[R1](P4 v -N2:(-P4 v -P1 v N3)) v -N3:(-P3 v N5 v N1)));
+N2 v -N2:(N4 v [R1](-N2 v [R1](P4 v -N4 v -N1:(P3 v -P4 v P1)) v -N3:(N1 v P1 v -P3)) v [R1](-P5 v -N5 v -N5:(N3 v -N1 v -N4))) v -N2:(N5 v -[R1](N5 v -[R1](P1 v N1 v P2)) v [R1](-N2 v -N5 v P5));
+N5 v N3 v -[R1](-N2 v [R1](-N4 v -N2 v -N2:(P2 v -P1 v N5:(P3 v P5 v P2))) v -N3:(N2 v N3:(-N4 v -N1 v N2)));
+-N2 v -[R1](N5 v -P3 v N3:(P1 v [R1](-N1 v N5:(-P4 v -P2 v P5)) v -N2:(-P3 v N1 v P2))) v -[R1](N5 v N4:(-P2 v -P4 v -N2:(-P2 v -P3 v -N3)) v -N1:(-N2 v P3 v -N5));
+-N1 v N5 v [R1](P4 v -[R1](P3 v -N4:(-N2 v N4:(N2 v -P3 v -N5)) v -N4:(-N2 v P3 v P2)) v N4:(-N5 v -N4:(-P2 v -N2 v N5)));
+-P4 v -N1 v N1:(-N3 v -N4 v -[R1](-N5 v N1 v -N2:(-P4 v [R1](-P2 v -N3 v -N2))));
+P4 v -[R1](N2 v -[R1](N1 v -N3 v -N2:(N1 v -N2:(-N3 v N5 v -N1))) v N5:(N1 v -N3:(-N2 v -P4 v -N5))) v N4:(N1 v -P5 v -N1:(P5 v N4 v -[R1](N5 v -N3 v P5)));
+P3 v -N1 v -N5:(P4 v N3 v -[R1](-N5 v N4:(-N1 v -[R1](-N3 v -N4 v -N1)) v -[R1](-P1 v N1 v N2)));
+P2 v -[R1](P1 v N2:(P4 v [R1](-N1 v P2 v -N1:(-P3 v N3 v P2)) v N2:(-N5 v P2 v P3)) v -N1:(-N3 v -P1 v [R1](N2 v -N3 v -N5))) v -[R1](-P1 v N3 v -N4:(-N5 v N3 v N1:(P1 v N5 v -P4)));
+P4 v -N3 v -N1:(N5 v -[R1](-N5 v N4 v N5:(-N4 v N3 v -[R1](P5 v -N5 v P3))) v N1:(-P3 v [R1](-P5 v N1 v -N4)));
+N4 v [R1](N3 v [R1](N2 v N4 v N2:(-N5 v -N2:(N4 v N5 v -P5))) v -N2:(N3 v -N5:(-P3 v N4 v N2))) v -N5:(-N3 v -P2 v N2:(P4 v -[R1](N4 v N2 v -P4)));
+N4 v N2 v -N1:(-N3 v N2 v N2:(N3 v [R1](-N5 v N2 v [R1](-N1 v P2 v P1)) v -[R1](P3 v -P4 v -P2)));
+-N5 v [R1](N3 v P2 v -[R1](-N1 v N3:(P2 v -P4 v N1:(-N3 v P1 v -N2)) v -N2:(N5 v P4 v -N1))) v -[R1](N5 v -N5:(-P5 v N3 v N5:(N2 v -P3 v N1)) v N1:(-N5 v N2 v -N3));
+P3 v [R1](N4 v [R1](P2 v N1:(-P3 v N3:(P5 v -N2 v -P3)) v -N2:(-N1 v -N3 v P1)) v N3:(N2 v -N4:(-P4 v -N3 v -P5))) v N1:(P4 v [R1](P4 v -N1:(-P5 v N3 v -P1)) v N5:(N1 v N4 v N3));
+-N2 v -P1 v N4:(-P3 v -N3 v -N4:(P3 v -N5 v -[R1](N5 v [R1](-P1 v N1 v P3))));
+-P5 v N3:(-N1 v P1 v N3:(N1 v -[R1](N5 v -[R1](-P4 v -N4 v -P1)) v -[R1](N4 v P3 v -P5))) v -[R1](-N3 v -P3 v [R1](P2 v N2:(-P2 v P1 v P4)));
+-N2 v -N3 v [R1](-P1 v -N1:(N5 v P2 v -N5:(N1 v N2 v [R1](-P5 v P3 v N2))) v -[R1](P3 v -N4:(-N5 v -P2 v -P4)));
+-N3 v P1 v -[R1](N1 v -[R1](-P3 v N3:(P1 v -N5 v N1:(N5 v N3 v -P5)) v -N3:(P3 v -P5 v N2)) v N4:(P1 v P2 v N4:(P1 v -P2 v N2)));
+N1 v -[R1](-N5 v -N4 v -[R1](P1 v N4:(-P4 v -P2 v -N2:(-N1 v N4 v -P4)) v N5:(P2 v -P3 v P5))) v [R1](P2 v N3 v N1:(-N3 v -N5:(-N2 v P3 v -P5)));
+P1 v -P4 v -N5:(N2 v -P3 v N1:(-N4 v P5 v -[R1](-N3 v -N5 v -[R1](P3 v -N1 v -P1))));
+P3 v -[R1](N1 v N3:(-N4 v N2:(-P5 v P1 v -[R1](-N1 v N4 v -P5)) v [R1](P4 v N5 v -N2)) v [R1](N1 v N3:(-P3 v -P2 v P1))) v -[R1](-N1 v N3:(-P4 v N3:(-N2 v N4 v -P4)) v -N4:(N2 v -N3 v N5));
+-P1 v -N5:(-P2 v -P5 v -[R1](N4 v [R1](-N4 v -N3 v -N1:(-P2 v -P4 v -N5)) v -N2:(-N5 v -P3 v -N1))) v -N4:(N1 v -N3 v [R1](P1 v -[R1](-P5 v -N1 v P2)));
+-P3 v N2 v [R1](-N2 v -[R1](N2 v P4 v -N4:(P5 v P4 v N5:(-N4 v -P5 v P1))) v N2:(-N5 v -N4:(N1 v P3 v -N5)));
+P1 v N1 v N2:(N5 v P2 v -[R1](-N4 v N1:(-N3 v N5 v -[R1](P5 v -N5 v -P3)) v [R1](N5 v N4 v -N2)));
+-P2 v -P3 v N1:(-N2 v -N3 v [R1](P1 v -N2:(-N5 v -[R1](P1 v P3 v -P4)) v [R1](P5 v -N4 v -N3)));
+-P2 v -N4 v -N2:(-N5 v -N1 v [R1](-P1 v P5 v -N2:(-P2 v -[R1](-P1 v N1 v -P3))));
+P2 v P4 v -N2:(P3 v -P4 v [R1](-N5 v -N3:(-P4 v -P2 v -[R1](N4 v N3 v N5)) v [R1](-N5 v N3 v P3)));
+P1 v -[R1](-P4 v -[R1](-N1 v -N3 v N2:(P3 v -N3 v N5:(N3 v -N2 v N1))) v N1:(N5 v P3 v -N5:(N4 v N1 v -P3))) v -[R1](-N1 v -N5:(P4 v N1:(P3 v -P4 v N4)) v -N3:(-P3 v -N1 v -N2));
+-N3 v N2 v N1:(P5 v N4 v -[R1](-N4 v N2 v N1:(-N5 v N4 v -[R1](-N1 v -P1 v -N4))));
+N1 v N4:(N5 v N3:(-P5 v N2 v [R1](-P5 v N5 v [R1](P2 v -N2 v -N1))) v -[R1](P4 v P2 v -[R1](N4 v -P4 v P5))) v N3:(P3 v -[R1](P2 v N3 v [R1](N3 v -P5 v N2)) v -[R1](-P2 v -P3 v N1));
+-N1 v -[R1](-P5 v N5:(N1 v N2:(N5 v [R1](N5 v P2 v -P5)) v [R1](N3 v P1 v -N2)) v N2:(-P2 v P4 v [R1](-N3 v P5 v P2))) v N3:(P1 v -P4 v -[R1](N1 v N4:(N5 v N1 v N2)));
+-P4 v -[R1](-P3 v N4 v -[R1](-N4 v N5:(-P3 v -N4:(P3 v -N3 v -P4)) v N4:(N5 v -N1 v P5))) v N2:(N1 v -[R1](-N4 v -P4 v -N5:(-N1 v -N4 v N3)) v -N4:(-N3 v -N2 v -N5));
+N5 v -N4 v -[R1](-P1 v -N2 v N3:(P4 v -N2:(-N1 v P3 v [R1](-N2 v -N3 v -N5)) v -[R1](P4 v -P3 v -N5)));
+P2 v [R1](P4 v -N2:(-P4 v -N3:(N2 v [R1](N2 v N4 v -N3)) v [R1](-N1 v N3 v P4)) v [R1](-N5 v N5:(P3 v P2 v -P5))) v -[R1](N5 v N1 v N4:(-N2 v P3 v -N2:(-P1 v -P2 v -P4)));
+N4 v -[R1](-N5 v -N1 v -N1:(-P2 v -N4 v N5:(-N4 v -N1 v -[R1](P3 v P1 v -P2)))) v N4:(-N5 v -P2 v N5:(-P5 v [R1](-N4 v N5 v N1)));
+P3 v -N3:(-N5 v -N4 v -[R1](-N1 v N3:(-P3 v N1 v -[R1](P3 v P5 v -N1)) v [R1](N5 v P5 v -P1))) v N4:(N5 v -N3 v -[R1](P2 v -[R1](-N4 v N5 v N3)));
+-P5 v -N2 v N4:(-N3 v [R1](N3 v N1 v N3:(-P4 v [R1](P4 v -N4 v -P3))) v -N2:(-P2 v [R1](N1 v -N3 v -P1)));
+N5 v N1 v -N1:(P4 v [R1](N2 v N2:(-P2 v [R1](-P4 v P3 v N2)) v [R1](N3 v N4 v -P2)) v N4:(-N5 v -N1 v -[R1](-N2 v -N1 v N4)));
+-P2 v N5 v N2:(P4 v -N4:(-P4 v P1 v -[R1](P1 v -[R1](-P4 v -N2 v P2))) v -[R1](-P4 v -[R1](-P2 v -P4 v P5)));
+-P5 v -P3 v -[R1](P4 v -[R1](P3 v -N5:(-P3 v -N3:(P3 v -P1 v -N5)) v -N3:(-N5 v -N4 v P4)) v -N2:(N3 v -P5 v -N1:(N3 v P3 v -P2)));
+-N3 v P5 v -N1:(-N4 v [R1](-N1 v -N2 v -[R1](P4 v -N3:(N4 v P4 v -N1))) v -[R1](N4 v -N5:(N1 v -N4 v N2)));
+-N2 v P2 v -[R1](-P4 v -P5 v N1:(P3 v -N5 v -[R1](P2 v N3:(-N5 v -P4 v P5))))
+end
diff --git a/examples/sat/test42.frm b/examples/sat/test42.frm
new file mode 100644
--- /dev/null
+++ b/examples/sat/test42.frm
@@ -0,0 +1,62 @@
+begin
+-P1 v N1 v [R1](-N5 v [R1](-P5 v P4 v N1:(-N5 v P5 v N3:(-N2 v N5 v P4))) v N5:(-N4 v -N4:(P2 v N3 v -N1)));
+N3 v -P2 v -N3:(-N4 v P1 v -[R1](-P5 v -P4 v -N2:(N1 v [R1](N5 v -N2 v N4))));
+-N1 v -P5 v [R1](P4 v -P2 v [R1](-P3 v N5 v N2:(-N1 v N4:(-P3 v N5 v N2))));
+P4 v -P1 v -[R1](N4 v -P3 v -N5:(-N4 v N5:(-P3 v -P5 v -[R1](P5 v -P1 v P4)) v -[R1](N2 v -N3 v N5)));
+-N4 v -N3 v -N2:(P1 v -P5 v -N1:(N3 v -P3 v [R1](N2 v [R1](-N1 v N3 v -P5))));
+N3 v -N2:(-N4 v -N4:(-P5 v -N2 v -[R1](N3 v -[R1](-N3 v -N2 v -N4))) v [R1](P3 v -N3 v -[R1](-P5 v N1 v -P4))) v N2:(N5 v -N4 v -[R1](-N3 v N1 v [R1](-N5 v P4 v N1)));
+-P5 v P2 v -[R1](N4 v P4 v -[R1](-P4 v -N5:(N2 v -N2:(-P5 v N3 v P3)) v -N4:(-P3 v P2 v -P5)));
+P3 v -N1 v N1:(-P1 v -[R1](-N3 v N3:(-N1 v -[R1](-P4 v N3 v N5)) v -[R1](P3 v P2 v N3)) v -[R1](-P1 v -N3:(N4 v -P2 v P3)));
+P1 v -[R1](-P4 v N3:(N1 v -P5 v -N3:(P1 v -[R1](P4 v N1 v -P5))) v N5:(-P5 v N2 v [R1](-N1 v -P2 v -N3))) v [R1](N4 v -P5 v N2:(-N1 v N4:(N2 v P2 v P5)));
+P2 v -N3:(N2 v -N2:(P4 v -N4 v -[R1](-P3 v -[R1](-N3 v -N4 v -P5))) v -[R1](-N2 v N3 v -[R1](N2 v -N5 v N4))) v -[R1](-N2 v -P4 v [R1](-N1 v -N3:(N2 v N4 v -N5)));
+-N1 v N4 v N5:(P1 v -N4:(-N3 v -N2 v [R1](-P3 v -[R1](-N4 v P3 v N5))) v -[R1](N1 v -P5 v -[R1](-N4 v -P5 v P1)));
+-N1 v N3:(P5 v [R1](N3 v -N5:(-P5 v [R1](N4 v N2 v -P1)) v -[R1](-N2 v N3 v N5)) v -[R1](N1 v N5 v N4:(N1 v P5 v N5))) v -[R1](-N4 v -N5:(P5 v -P2 v -[R1](-N4 v -P2 v -N5)) v -[R1](-N5 v -P1 v -P2));
+-P1 v -[R1](-P3 v N4:(P5 v -N5:(N2 v -P4 v [R1](N1 v -N2 v -N4)) v [R1](P5 v P3 v N2)) v -[R1](N4 v -N2 v -N3:(-N5 v -P5 v P4))) v -N3:(-P2 v -[R1](N3 v P1 v N2:(-P1 v -N3 v -P3)) v N3:(-P4 v N2 v -N5));
+P4 v N1:(-N2 v N4 v [R1](-N3 v N5:(-P3 v -[R1](-P2 v -P1 v -P5)) v [R1](-N5 v N4 v N3))) v N4:(P2 v -P4 v -[R1](-P2 v [R1](P2 v -N2 v P5)));
+-P5 v N3 v [R1](-N4 v -[R1](N1 v N3 v -N2:(-N4 v N1:(-P1 v -P4 v -N5))) v N2:(N5 v -N4 v -N3:(-P3 v -P4 v P2)));
+-P5 v -N4:(-P5 v -N5:(-P3 v -[R1](P5 v -[R1](-P4 v -N4 v P1)) v [R1](N2 v -N1 v -P3)) v [R1](P3 v -P5 v -[R1](N3 v P5 v -N4))) v N3:(N2 v [R1](P1 v -N4 v -[R1](N3 v -P5 v -N5)) v [R1](N5 v P1 v P4));
+P3 v -N4 v N1:(-N5 v N2 v [R1](-N4 v -N5:(-P2 v -N4 v [R1](-N1 v -N3 v N5)) v -[R1](-P2 v N2 v N1)));
+N3 v N5:(N1 v N4 v -[R1](-N1 v -N5:(P5 v -N4 v [R1](P5 v -P2 v -P1)) v [R1](-N4 v N5 v N1))) v N3:(-N2 v -[R1](P2 v N4 v -[R1](P5 v N4 v N5)) v -[R1](P3 v -N2 v N1));
+N3 v P4 v [R1](-N3 v -N5 v N4:(P2 v P3 v N3:(P4 v P1 v -[R1](-N4 v N1 v P4))));
+N3 v P2 v -N2:(-N5 v -N5:(N2 v -[R1](-N5 v -[R1](-N1 v -P3 v -P5)) v -[R1](-N4 v -N3 v N5)) v [R1](N1 v [R1](P5 v -P3 v -P2)));
+-N3 v -P5 v -N5:(-N2 v N1 v N4:(N3 v N5 v [R1](P1 v -[R1](-N3 v -N4 v -N2))));
+N4 v -P5 v -[R1](P1 v -[R1](-N3 v N1 v -N4:(P4 v -N2:(-P2 v P5 v -N5))) v N1:(-P2 v P3 v N2:(-P5 v -N3 v N1)));
+N4 v -N1:(-N2 v -N1:(N5 v -N2 v -[R1](N3 v -P1 v [R1](P1 v P5 v P2))) v -[R1](N5 v -[R1](-N1 v -N5 v -N2))) v N1:(N3 v [R1](-P4 v P2 v [R1](-N2 v P3 v P4)) v [R1](-N2 v N3 v N5));
+N3 v -N5:(-P2 v -N1 v -N5:(N2 v [R1](N2 v P1 v -[R1](-N2 v -P3 v P2)) v [R1](-N4 v -N2 v P3))) v N3:(-P3 v -[R1](-N3 v -P1 v -[R1](-N1 v -P1 v -N4)) v [R1](-N1 v P2 v N4));
+-P2 v -N1 v N1:(-P3 v N4:(-N1 v N2 v [R1](-N5 v -[R1](P4 v N4 v -N1))) v -[R1](N4 v -P5 v [R1](-P1 v -P2 v P4)));
+-N4 v N5 v -[R1](-N5 v N1 v -N2:(N1 v [R1](N1 v -N3 v N3:(-P1 v P4 v P3)) v -N4:(N5 v -P1 v P5)));
+P5 v -N4 v -[R1](P1 v -[R1](-N1 v -P3 v -N5:(-N1 v -N3 v -N3:(N2 v N5 v -N1))) v -N5:(-N3 v P1 v -N5:(-N2 v P4 v P2)));
+-P3 v -N1 v -[R1](-N3 v N5:(-N3 v N4 v -N5:(-N3 v [R1](-N3 v P4 v -N5))) v -[R1](-P5 v P4 v -N5:(P4 v P1 v P3)));
+-P5 v -N3 v [R1](-N5 v N3 v N2:(-N5 v N3:(-N2 v [R1](N2 v -P1 v -N4)) v [R1](P1 v -P5 v N2)));
+-N1 v -[R1](N3 v N5:(-N3 v -[R1](-P3 v -P4 v N1:(-P3 v -P1 v P5)) v N4:(-P1 v -N5 v -P3)) v -[R1](N1 v -P5 v -N4:(-P5 v N3 v -N5))) v -N5:(P1 v N5:(N4 v [R1](-N4 v -N2 v N3)) v [R1](P1 v -P2 v -N2));
+-N2 v -P2 v [R1](-P3 v -[R1](P4 v -N4:(P5 v -N1 v -N4:(-N1 v N2 v -N3)) v -N3:(P4 v -N1 v N4)) v -N3:(P3 v N2:(-P2 v P3 v -N3)));
+N4 v P5 v -N2:(-P2 v -P5 v -[R1](P1 v -P3 v -[R1](N5 v N4:(-N1 v N5 v N3))));
+P1 v -[R1](N5 v N2:(N3 v [R1](-N3 v -P3 v N2:(N1 v -N4 v P3)) v N4:(N1 v -P1 v -P2)) v [R1](-N4 v -N3:(-P3 v -P1 v -P4))) v -[R1](-P5 v -N1:(-N2 v P3 v -N3:(-N1 v -N5 v -N2)) v -N4:(-P2 v P1 v -P5));
+-N1 v -P1 v N5:(P1 v -P5 v -[R1](N5 v -N3 v -[R1](-P1 v N4:(N1 v N5 v N3))));
+-N3 v [R1](N5 v N1 v -N5:(-P5 v -N4:(N3 v N1 v -[R1](N2 v -P3 v P1)) v -[R1](-P4 v P1 v -N2))) v -[R1](-N5 v -N1:(-N5 v -N4:(-N1 v P1 v P5)) v -N2:(N4 v P2 v -P1));
+-N1 v P5 v -N3:(P5 v [R1](N4 v -N1:(-N2 v -[R1](P1 v -N3 v -P5)) v [R1](-N4 v -P2 v P5)) v -[R1](-N2 v P4 v -N5:(-N1 v P1 v -P3)));
+N3 v -N2:(-N5 v N1 v N1:(-P4 v -[R1](P5 v [R1](-N5 v P1 v P3)) v -[R1](-P5 v -N4 v -P1))) v -N2:(-P4 v -[R1](P4 v [R1](N5 v P3 v -P5)) v [R1](-N4 v N2 v -P4));
+P1 v -P5 v N5:(P5 v N2 v N2:(P3 v P4 v [R1](-N1 v -P1 v [R1](P5 v -P1 v -P4))));
+-P3 v -[R1](N2 v -[R1](P1 v N2:(N5 v -P5 v -N3:(-P1 v N4 v P3)) v N1:(N3 v -P1 v P2)) v N1:(-N5 v -N4:(P1 v -N3 v P5))) v [R1](N5 v -N5:(-P4 v -N2 v -N4:(N1 v -N5 v -N3)) v -N1:(-P4 v -P2 v P1));
+-N1 v [R1](N2 v -[R1](N1 v -P4 v N1:(-N5 v -N4 v N2:(P3 v -N3 v P5))) v -N1:(P5 v -P1 v N3:(N4 v -P3 v -P5))) v -N5:(-P5 v -[R1](N1 v -N2:(-P5 v P4 v -N4)) v N3:(-N4 v P2 v -P5));
+-P3 v -N5 v -N1:(P3 v -[R1](N3 v -P1 v [R1](P5 v -N2:(-N4 v -N3 v -P3))) v -[R1](N5 v -N2:(-P3 v -N5 v -N1)));
+P1 v N3 v -[R1](P1 v N3:(-P4 v P5 v -[R1](-P3 v N3:(N5 v P1 v P2))) v -[R1](N5 v N2:(-N5 v -N3 v -P4)));
+-P1 v -N5:(N4 v N3 v -N2:(-P1 v -[R1](P4 v -P2 v [R1](-N5 v P3 v P2)) v [R1](P5 v -P3 v P4))) v -N1:(P4 v [R1](-N1 v -[R1](-P5 v P1 v -N3)) v [R1](P2 v N5 v -P5));
+-P2 v -N4:(-P5 v [R1](P2 v [R1](-N3 v -N5 v N1:(P1 v -N5 v N4)) v -N1:(-N3 v -P2 v P1)) v N4:(P1 v -[R1](P4 v -P3 v N5))) v [R1](N2 v -N4 v [R1](P1 v -N1 v -N3:(-N4 v N2 v N5)));
+P1 v P2 v [R1](P1 v N2:(-P1 v [R1](-P5 v -N4:(-P5 v N3 v N2)) v N5:(P1 v P5 v -P3)) v -[R1](P2 v P4 v -N4:(-N3 v -N5 v -P3)));
+P5 v -[R1](N2 v N4 v -N5:(N1 v P4 v N4:(-P3 v N3 v -[R1](-N3 v -N1 v -P3)))) v -N1:(-N3 v N2 v -N4:(-N1 v N5 v [R1](P2 v -P1 v -N2)));
+-N2 v N5 v [R1](-P3 v [R1](-N5 v -P4 v N2:(N3 v N5:(N3 v -P1 v -P5))) v -N2:(-P5 v -P3 v N3:(-N4 v P5 v -P3)));
+N5 v N2:(P5 v N1 v -[R1](-N5 v N4:(-P2 v -N1 v -[R1](P5 v P3 v N3)) v -[R1](P1 v N5 v P3))) v -[R1](P5 v N5:(-P1 v N1 v [R1](P5 v N3 v N1)) v -[R1](P1 v P4 v P3));
+-N4 v [R1](N5 v N3:(-N4 v -N2 v -N3:(P2 v -N4 v -[R1](P4 v -N1 v N2))) v [R1](P4 v -N4:(-N3 v -P1 v -P3))) v -N4:(P4 v -N4:(-N1 v -P5 v -[R1](N3 v P4 v -P3)) v [R1](P4 v -P2 v -N2));
+-N3 v N5 v -[R1](P4 v -N1:(N5 v N2:(N3 v -P3 v [R1](P1 v -N5 v P3)) v [R1](N1 v P2 v P3)) v -[R1](-P5 v N4 v N1:(P2 v P4 v P5)));
+-N2 v -N2:(-N1 v -P3 v [R1](N1 v -N3 v -N2:(-N5 v -N4 v [R1](P3 v P1 v P2)))) v -[R1](N4 v N5 v -N5:(N4 v N2 v -[R1](-P2 v P4 v -P1)));
+-P1 v -[R1](N3 v -P1 v [R1](-N4 v -N5:(P5 v N1:(P2 v P5 v P4)) v N2:(-P1 v N5 v N1))) v -N1:(-N4 v -N5:(-P1 v -[R1](-P4 v -P5 v -P1)) v -[R1](-P2 v N3 v -N4));
+-P4 v -P3 v [R1](-N4 v -[R1](N1 v N4:(-N3 v -N2:(-N1 v -P4 v N4)) v -N5:(-P1 v P2 v -P3)) v N1:(N5 v P1 v N3:(-N2 v N4 v P2)));
+P3 v -[R1](P2 v -N4 v [R1](N4 v N5 v N2:(N3 v N2:(P5 v -P1 v N1)))) v [R1](-P4 v -P1 v -N3:(-N5 v -N2:(N5 v -P5 v -P1)));
+N5 v N1 v N2:(-P1 v -[R1](N5 v N2:(-N5 v [R1](-N3 v P5 v -N4)) v [R1](N2 v -N3 v -N1)) v N1:(P3 v -[R1](-P2 v N5 v -P3)));
+-P2 v N2 v -[R1](-P5 v P4 v N4:(-P2 v -[R1](N5 v N4 v N3:(N1 v -N2 v N4)) v -N1:(-N2 v -P2 v -P4)));
+P1 v -[R1](-N2 v -N2:(-N4 v -N2:(-P2 v -[R1](N1 v -N3 v N2)) v [R1](N4 v -N3 v -P1)) v -N5:(N2 v -P5 v -[R1](N1 v -N3 v P2))) v -N1:(N2 v P5 v [R1](P5 v -N5:(P1 v -N1 v -N2)));
+N1 v -N4 v [R1](-N3 v -N5 v -[R1](-P1 v -P4 v -N3:(N5 v P5 v -N3:(-N4 v -P4 v -P5))));
+P2 v -P5 v N3:(P5 v -N2:(-N5 v -[R1](-P1 v [R1](-P4 v -P1 v N4)) v [R1](-N5 v -N4 v -N3)) v -[R1](-N3 v -N2 v -[R1](P1 v N1 v N5)));
+-N5 v N2:(-P5 v -P3 v -[R1](-P2 v N4 v [R1](P1 v -N2:(-P3 v -P1 v N5)))) v -[R1](N3 v -[R1](-P5 v P3 v -N4:(-N2 v -P3 v P1)) v -N2:(-P5 v -P1 v -N5))
+end
diff --git a/examples/sat/test43.frm b/examples/sat/test43.frm
new file mode 100644
--- /dev/null
+++ b/examples/sat/test43.frm
@@ -0,0 +1,62 @@
+begin
+-N2 v -N1 v [R1](N2 v -P2 v -N5:(-N4 v N3:(N4 v [R1](-N2 v -N1 v P1)) v [R1](-N3 v P2 v -P3)));
+P5 v -N4 v -[R1](-N3 v N5:(-N2 v -N4 v -N2:(-P5 v -N4 v -[R1](N5 v -N3 v N4))) v -[R1](N1 v -N2:(-N3 v N1 v -N5)));
+N3 v -N5 v [R1](P5 v -N4:(P3 v [R1](N4 v -N1:(P3 v P4 v -N3)) v -N5:(-N4 v -N1 v -P4)) v N5:(-N1 v [R1](P2 v -P5 v -P3)));
+N1 v -P4 v -[R1](-N2 v N1 v -[R1](N3 v N1 v N4:(-P4 v N2:(-P5 v -N1 v N3))));
+P5 v -P3 v N4:(N3 v -P4 v N1:(-P1 v [R1](P5 v [R1](-P4 v -N1 v N5)) v -[R1](-N5 v N1 v P3)));
+P1 v [R1](P3 v -N4 v -[R1](-P5 v -N5 v -N5:(-N1 v -P4 v -N4:(N5 v -N2 v N3)))) v -[R1](N1 v N1:(-P1 v N4 v -N2:(N5 v N4 v P4)) v -N2:(N5 v -P3 v -P2));
+P1 v N4 v N2:(P3 v N1:(-P4 v [R1](N1 v -N5 v -[R1](-N5 v -P3 v P2)) v -[R1](-P3 v -P5 v -P2)) v [R1](N2 v [R1](-N1 v N4 v N3)));
+-P1 v -P4 v [R1](N5 v -N2:(-N5 v -P4 v -[R1](N2 v N1 v N4:(P1 v -N1 v P5))) v [R1](-P1 v -P5 v N1:(N5 v N4 v N3)));
+-P1 v [R1](-P2 v -P5 v -N1:(N4 v N4:(P3 v -[R1](N1 v N5 v -N2)) v -[R1](-N1 v -N2 v -N5))) v -[R1](-N2 v -N3:(P1 v -N1:(-P2 v -P3 v P1)) v N2:(N1 v -P2 v -P1));
+-P4 v -[R1](N1 v P2 v -N5:(P4 v -N1 v -[R1](N3 v P4 v -N5:(-N4 v -P3 v -N1)))) v -N2:(-N5 v N3 v [R1](-N4 v -P5 v -N2:(P4 v P5 v N1)));
+-N4 v -N5:(P2 v [R1](-P4 v -[R1](N3 v -P1 v -N1:(P4 v N4 v -P3)) v -N3:(N2 v -N4 v N1)) v -N1:(-N2 v -N4 v [R1](-P2 v P3 v P4))) v -N5:(-N3 v -P5 v [R1](-N3 v -N1 v -[R1](-N2 v N5 v -P1)));
+-P5 v -N5 v -N1:(-N5 v [R1](N5 v [R1](-N1 v P4 v -N5:(-N4 v N1 v -N2)) v N3:(-P2 v -N2 v N1)) v N2:(-N3 v -P4 v [R1](-N5 v -N3 v N4)));
+-N2 v -P4 v [R1](N5 v -P1 v -[R1](-P2 v -N4:(-N5 v -N3:(-P2 v N1 v N2)) v -N1:(P5 v -P4 v N4)));
+P1 v -P2 v N2:(P2 v P3 v N3:(P2 v [R1](N4 v -N1 v -[R1](-N5 v P5 v -P3)) v -[R1](-N5 v N4 v P5)));
+N2 v N4 v N4:(-N5 v [R1](N1 v -[R1](-P5 v P1 v -N4:(N1 v N5 v -N2)) v -N4:(-P1 v P5 v P4)) v N4:(-P4 v -P1 v [R1](-P1 v -P2 v N3)));
+P1 v [R1](-N3 v -N1:(N3 v -N2 v -N1:(-P3 v -[R1](P3 v P2 v P4))) v [R1](-N5 v -N1 v -N5:(-N1 v P4 v N4))) v -N3:(-P4 v -P1 v -[R1](-N3 v N2:(P1 v -N3 v -N1)));
+-N3 v -[R1](N2 v [R1](P4 v N3:(-P1 v N2:(N3 v N5 v N1)) v -N3:(-N1 v P1 v -P3)) v -N1:(P2 v P1 v -N3:(P4 v -N2 v -N5))) v [R1](P4 v -N5:(P3 v N5:(N1 v N2 v N3)) v N1:(N2 v P3 v N3));
+-P5 v -N2:(-P3 v N1:(N3 v -[R1](-N4 v [R1](N1 v P1 v P3)) v [R1](-P5 v P4 v P3)) v [R1](N2 v -[R1](N2 v P3 v -N4))) v -[R1](N3 v [R1](-P2 v -N2:(P5 v P1 v -N3)) v -N4:(P1 v P3 v N1));
+N5 v N2 v N3:(P5 v -N5:(-P3 v [R1](-N1 v [R1](P1 v P5 v N2)) v [R1](-P2 v N2 v N3)) v -[R1](P2 v -[R1](-N4 v -P5 v -N5)));
+N5 v P4 v -[R1](-P5 v [R1](-N3 v N1:(-P4 v -N4:(-P2 v N2 v -N5)) v -N2:(-N5 v -P5 v -N1)) v -N3:(N5 v N5:(-N2 v -P4 v -P3)));
+-N3 v [R1](P5 v [R1](-N3 v -P3 v -N5:(-N1 v N3:(N4 v P3 v -N5))) v -N2:(-P2 v N1:(P2 v N5 v N4))) v -N5:(P5 v -N4 v -N1:(-P5 v [R1](-N2 v -N3 v N4)));
+-N4 v -N2:(P4 v -[R1](-N4 v -N5 v N2:(-P3 v -[R1](-N5 v -N3 v P1))) v -N5:(-N1 v [R1](-N5 v -P5 v P2))) v -N3:(-P3 v N4 v -[R1](-P1 v -[R1](-N2 v P2 v P1)));
+-P4 v P3 v -[R1](N5 v -N5:(-P3 v [R1](N5 v -N1:(-P1 v -P3 v -P4)) v -N5:(P4 v -P3 v P2)) v -[R1](-P2 v -P3 v N4:(-P1 v -P4 v N5)));
+-N1 v -P1 v [R1](P4 v -P3 v -N3:(N2 v N5:(N2 v N1 v [R1](-N2 v P3 v -P5)) v [R1](P2 v -P5 v P3)));
+P5 v -P3 v -N4:(-P3 v P2 v -N5:(-P2 v -N1 v -[R1](-P2 v -N1 v -[R1](-P3 v N1 v P5))));
+-N4 v -N3:(-P1 v -N2 v -N3:(-P5 v -[R1](-P3 v [R1](N1 v P1 v N2)) v -[R1](N1 v N4 v -P3))) v [R1](-N2 v -N2:(-P4 v N3 v -[R1](P3 v -P5 v P4)) v -[R1](-N5 v -N3 v N4));
+-N1 v -N2 v -N3:(-P2 v [R1](N2 v -N1 v -[R1](-P4 v -N1:(-P1 v -P4 v -P5))) v [R1](P2 v -P1 v N2:(N5 v -N4 v P2)));
+-P3 v -[R1](P3 v N1:(N4 v -N2:(P3 v -[R1](N2 v P2 v -P5)) v [R1](-P4 v -N1 v N4)) v [R1](P1 v N3 v N5:(-P5 v P3 v N2))) v [R1](-P2 v -P1 v N5:(P4 v P1 v -N5:(N3 v P1 v -P3)));
+P2 v P5 v [R1](P3 v -N5:(-P5 v -N2:(P5 v -P1 v -[R1](-N3 v N1 v -P3)) v [R1](-P5 v -N4 v N3)) v [R1](-N5 v N4:(P5 v -N1 v -P3)));
+-N1 v -[R1](-P4 v N4:(N5 v [R1](P1 v N5:(P1 v N4 v -N2)) v -N5:(-P3 v -P5 v -N3)) v N5:(-P1 v P5 v -[R1](P5 v P2 v P4))) v -N3:(-N5 v -P2 v -N2:(-N5 v [R1](N1 v N3 v P3)));
+-N4 v -[R1](P1 v -N4 v [R1](N5 v N3:(P3 v -P1 v N1:(N5 v -P4 v P2)) v -N4:(N1 v P3 v -P1))) v -[R1](-N5 v -N3 v -N1:(P5 v N4 v -N3:(P1 v N2 v -N4)));
+N5 v -N1:(N5 v -N2 v -N5:(-N1 v -[R1](-N4 v P4 v -[R1](P4 v N3 v N4)) v [R1](N4 v P2 v N5))) v -[R1](P1 v N2 v N4:(N2 v -N3 v -[R1](P2 v -P3 v P5)));
+N3 v P2 v N4:(-N3 v N2:(-P3 v [R1](P1 v -[R1](P4 v -N4 v -N5)) v [R1](P4 v -P3 v -P1)) v [R1](-P1 v -[R1](-P1 v -P3 v N4)));
+-P2 v -[R1](P3 v -N2 v N2:(-N4 v N3 v [R1](N5 v -N1:(P5 v -N3 v -N5)))) v -[R1](N2 v -N5:(N2 v N4:(-N5 v P3 v -N3)) v -N3:(-N2 v -P3 v P4));
+N1 v N2 v -N2:(N4 v [R1](P2 v N4:(P1 v -N3 v [R1](-N4 v -P3 v -P2)) v -[R1](-P4 v -N3 v -N5)) v -N4:(N1 v -P1 v -[R1](-P3 v N1 v P5)));
+-N1 v N3:(-N2 v P3 v -[R1](-N3 v -P5 v -[R1](P2 v N5 v N2:(-P1 v -P5 v -N1)))) v [R1](P4 v N4 v -N3:(N1 v -N5 v -[R1](N4 v -P5 v -P3)));
+-P4 v P2 v -N4:(N3 v -N4:(-P1 v -N2 v [R1](-P3 v -[R1](-N1 v P2 v P5))) v -[R1](P4 v [R1](N3 v P3 v P5)));
+P1 v [R1](P4 v -[R1](P5 v N1:(P5 v N5:(P5 v P2 v -P3)) v N1:(-P4 v N3 v -N2)) v N5:(-P2 v -N3:(N1 v -N2 v -P1))) v -N1:(N3 v -P1 v -[R1](P2 v P3 v -N2:(P3 v P5 v -N1)));
+N1 v -P2 v -[R1](N1 v -N1:(N5 v N4 v N5:(-P3 v N3 v [R1](-N3 v N2 v N4))) v [R1](-P2 v -N5:(N2 v -P4 v P5)));
+P4 v P5 v -[R1](-N5 v N1 v N5:(-N2 v [R1](N2 v -N5 v N2:(P1 v N5 v P4)) v -N1:(-P2 v N5 v -P5)));
+-P2 v -N5 v -N1:(N5 v -N2:(-P4 v N1 v -[R1](N3 v -[R1](-P5 v -N2 v P1))) v -[R1](-N4 v -N3 v [R1](-N2 v N3 v N4)));
+P3 v P2 v -[R1](-P1 v -P5 v [R1](-N2 v -P2 v -N4:(N1 v -N4:(-P2 v P4 v N3))));
+P1 v P4 v [R1](-P5 v -N1 v -N2:(N3 v -[R1](N4 v -P2 v -N5:(P3 v -N3 v P2)) v -N3:(-N1 v N2 v -N4)));
+P1 v N5:(-P2 v -[R1](P1 v -[R1](-P3 v -P1 v N1:(-P2 v -P4 v P5)) v -N4:(P5 v -P4 v -N1)) v [R1](P2 v P5 v N4:(P3 v N1 v N5))) v -[R1](P5 v N5 v N3:(-N1 v -N2 v -[R1](P2 v -P5 v P1)));
+N4 v -[R1](-N5 v N2 v -N1:(-P1 v N3 v N3:(P4 v -P1 v -[R1](-N5 v -P4 v P1)))) v N2:(N4 v -N3 v N1:(N4 v -N3 v -[R1](-N4 v -N2 v -N5)));
+N3 v N2 v -N5:(N4 v -[R1](-P2 v -N2 v [R1](N4 v -N5:(-P1 v P3 v N3))) v [R1](-N5 v -N2:(P4 v -P2 v -N3)));
+-P5 v -P3 v -N5:(-P3 v -P5 v -[R1](-N2 v -[R1](-N2 v N5 v N1:(-P1 v -N4 v P5)) v -N4:(P5 v P1 v P2)));
+N5 v [R1](P1 v -P2 v -[R1](-P1 v -P5 v -N3:(-N1 v -P2 v N5:(-N4 v -P4 v P5)))) v -N2:(P3 v -N5 v N1:(P1 v -[R1](N4 v -P1 v -N1)));
+N4 v P4 v -N5:(N1 v [R1](N3 v -P3 v [R1](N4 v -P5 v -N3:(P5 v -N5 v -P3))) v [R1](-N4 v N2:(N4 v N1 v -N3)));
+-N1 v P2 v N5:(P3 v N1 v -[R1](N3 v N2:(-P1 v -P4 v -[R1](-N2 v N5 v -P3)) v -[R1](N5 v -P4 v -N3)));
+-N1 v -[R1](-N1 v -P4 v -N3:(N2 v N4 v [R1](-N1 v P2 v -N5:(-N4 v -P2 v -P1)))) v [R1](N3 v -N4:(-P4 v -P5 v -N2:(-N5 v -N4 v -N1)) v N2:(N1 v N5 v -N3));
+N4 v -[R1](-N5 v P3 v -N4:(-N2 v N1:(-N3 v N2 v -[R1](N4 v P5 v P2)) v [R1](N5 v N4 v -P3))) v -N1:(N4 v P2 v [R1](-N2 v -N5 v N2:(-P1 v -N4 v -P5)));
+-P5 v -P4 v [R1](N3 v -[R1](-P2 v -N1 v N5:(-N1 v N3:(-P2 v -N1 v P4))) v -N3:(N1 v N1:(N4 v P4 v -P3)));
+P3 v N3:(-N4 v N5 v N1:(P4 v [R1](P1 v [R1](-P5 v -P4 v N4)) v -[R1](-P2 v -P5 v P4))) v [R1](N1 v -N3:(-P5 v [R1](-N3 v -P1 v N1)) v [R1](P4 v -P3 v -P2));
+-P4 v [R1](P2 v N2 v -N1:(N5 v -[R1](-N1 v -N5:(-P2 v N4 v P1)) v N3:(-N4 v -N5 v -P5))) v [R1](-P1 v -N1 v -N3:(-P1 v N4:(P3 v -P2 v -P5)));
+-P4 v -N1:(P4 v -[R1](N3 v -[R1](-P1 v -N1:(-P3 v N3 v N5)) v -N1:(N5 v N3 v N4)) v -N3:(N1 v -P5 v [R1](P4 v -N4 v P2))) v N1:(N5 v -[R1](N1 v N3 v [R1](P5 v -P3 v P2)) v -[R1](P2 v -N4 v -N5));
+-P4 v -N1:(-P1 v -N4 v -N3:(N1 v N2 v [R1](N2 v [R1](-P3 v N4 v N1)))) v -N3:(-N5 v P4 v -[R1](N4 v -[R1](N1 v P1 v P5)));
+P5 v -[R1](N3 v -N2 v [R1](-P1 v N2 v N3:(N5 v N4 v -N5:(N1 v -N3 v -N2)))) v [R1](-P4 v -P3 v N3:(-N1 v N2 v -N5:(N1 v -P1 v -P2)));
+-P1 v -P3 v [R1](N1 v -[R1](P1 v -N3 v -N4:(P4 v -N2 v N3:(-P1 v P4 v N2))) v -N1:(P4 v -N2 v -N3:(-P1 v N5 v -P2)));
+-P2 v -N1:(P5 v -[R1](P5 v [R1](-N1 v -N5:(-P2 v -P3 v P1)) v N1:(-P1 v -P3 v N2)) v -N1:(P5 v N3 v [R1](N2 v N3 v P4))) v N3:(-P2 v -[R1](-N2 v P1 v [R1](N2 v -N3 v -N5)) v [R1](P2 v -N5 v N1))
+end
diff --git a/examples/sat/test44.frm b/examples/sat/test44.frm
new file mode 100644
--- /dev/null
+++ b/examples/sat/test44.frm
@@ -0,0 +1,72 @@
+begin
+P5 v [R1](N2 v -N1 v N1:(P1 v -[R1](-N5 v N5:(P3 v P5 v -P1)) v N2:(-N3 v -P4 v P3))) v -N3:(-P5 v [R1](-N4 v N3:(N1 v P5 v N4)) v -N5:(-P1 v -P5 v N3));
+-P3 v [R1](-N3 v -N1 v [R1](N3 v -P2 v -N2:(-P4 v N1:(-P3 v -P4 v -P5)))) v -N3:(P4 v -P2 v -N2:(N3 v -[R1](-P5 v P2 v P3)));
+-N4 v -P2 v [R1](-P3 v N1 v -[R1](P3 v N1:(-P3 v N2 v N3:(N2 v -N4 v N5)) v N4:(P2 v -N1 v -N2)));
+-N3 v N5 v -[R1](-P3 v -N4:(-P1 v -N3 v -N3:(N1 v -[R1](-N3 v -P5 v P3))) v -[R1](-P5 v -N1 v -N2:(P4 v N1 v -P1)));
+P1 v P5 v -[R1](-P4 v [R1](-P1 v P2 v -N4:(-P1 v -N2:(P4 v P3 v -N5))) v -N2:(-P5 v N1:(-N5 v -N2 v -P2)));
+-P1 v P3 v -[R1](-P4 v -[R1](-P3 v -N1:(N3 v P5 v -N5:(N2 v -P5 v P2)) v N4:(-N3 v -P5 v -P1)) v N5:(N1 v N3 v N3:(P1 v -N1 v P3)));
+-N4 v N5 v [R1](-P1 v N1 v -N3:(-P4 v -[R1](-P1 v -N2:(N5 v -P2 v -N3)) v -N4:(-N3 v N1 v N5)));
+P1 v -N3 v N5:(-P1 v P2 v [R1](P3 v [R1](-N5 v -N5:(N1 v -N2 v -P1)) v N4:(-P1 v N3 v -N2)));
+P5 v -[R1](N3 v N1 v -N4:(N5 v P4 v [R1](P4 v P1 v -N5:(-P2 v -N1 v N2)))) v -N1:(N4 v -N2:(N4 v N1 v [R1](-N4 v -N2 v N5)) v -[R1](N3 v N5 v N1));
+-P5 v [R1](-N5 v N5:(N3 v -N2 v N2:(P1 v -[R1](-P5 v -N1 v -P3))) v [R1](P5 v -N1:(-P1 v P4 v -N4))) v -N2:(N1 v -N1:(-P3 v -[R1](P5 v -P3 v N1)) v [R1](-P1 v P5 v N1));
+-P4 v -N1:(-P2 v P5 v N5:(-N2 v -N3 v [R1](P2 v -N3 v -[R1](N3 v -P5 v -P4)))) v -N4:(N1 v -P1 v [R1](P1 v [R1](P1 v -P2 v P5)));
+-P1 v N2:(N5 v N2:(-N3 v -P3 v -[R1](-P3 v [R1](N1 v -N5 v P1))) v [R1](-P2 v -P4 v [R1](-P3 v P2 v -N5))) v -N5:(N3 v P5 v [R1](-N5 v -[R1](-N5 v -N2 v -P3)));
+P1 v -[R1](-N3 v -N2 v [R1](N1 v -P4 v -N5:(-P4 v P2 v -N4:(N3 v N5 v -P3)))) v -[R1](-N4 v -N1:(P4 v -N5 v N2:(-N3 v -N4 v N5)) v N2:(-P3 v -N3 v -N5));
+-N4 v P5 v -N2:(-P3 v N4:(-P5 v P1 v -[R1](-N1 v -N4 v -[R1](N1 v P3 v N5))) v -[R1](P1 v -P2 v [R1](N2 v -P3 v N1)));
+N4 v N1 v [R1](-N3 v -N2 v -[R1](-P2 v P5 v N2:(-P1 v N1:(P2 v -P1 v P4))));
+-N4 v N5:(-N2 v N1 v N3:(P4 v [R1](P1 v -[R1](P1 v -P3 v -P2)) v -[R1](-N3 v -P4 v -N1))) v N5:(N2 v -[R1](-N1 v -[R1](P5 v P4 v N3)) v -[R1](N5 v P1 v N3));
+-P1 v -N1 v -[R1](-P5 v -N5 v [R1](P5 v -N1 v N1:(-P3 v N5:(N3 v -N1 v -N4))));
+P2 v P4 v N4:(-N3 v -P4 v -[R1](N3 v N2 v -N2:(N3 v [R1](P5 v N1 v -N3))));
+-P5 v -[R1](P5 v N2:(P4 v [R1](-N1 v -N5:(N4 v -N3 v N1)) v N4:(N1 v N5 v N2)) v [R1](N5 v P3 v N5:(-N2 v -P4 v N3))) v N2:(-N4 v -P2 v -[R1](-P4 v -N3:(P5 v N2 v N1)));
+P4 v -[R1](-P2 v [R1](P2 v N5:(N4 v N1:(-N2 v -P3 v N4)) v -N2:(P5 v -P3 v -N1)) v -N4:(-P5 v -N1:(-N5 v -N4 v -P5))) v N1:(N4 v -N4:(N2 v -P4 v -[R1](-P2 v -N1 v N3)) v [R1](-P1 v -P2 v -P5));
+-N5 v -P3 v -[R1](-P1 v -P4 v N2:(N4 v -N2:(-N1 v N3 v -[R1](-P5 v P2 v N5)) v [R1](P1 v -P3 v P2)));
+-P1 v N2:(-P2 v [R1](-P4 v [R1](-N1 v P1 v N2:(N4 v P1 v -N1)) v N2:(-N1 v -N4 v -P1)) v [R1](N2 v N1 v N5:(-P3 v -N3 v N1))) v N3:(P4 v -N2 v -[R1](P2 v -[R1](P5 v N1 v P4)));
+-P5 v N2:(-N4 v N3 v -[R1](P4 v P5 v [R1](-P4 v P2 v N3:(-P3 v P5 v N4)))) v -[R1](-P4 v [R1](-N2 v -P5 v -N4:(P2 v -N2 v -P5)) v -N5:(N4 v N1 v -P3));
+-N3 v -N5:(P3 v -[R1](-N3 v N4:(P5 v -P3 v -[R1](-P5 v P2 v P4)) v -[R1](-P3 v -P5 v P4)) v -[R1](-N4 v -N4:(P4 v -N2 v -N1))) v [R1](P1 v -[R1](P2 v -N2:(-N4 v -N1 v -P2)) v N4:(-P2 v P4 v -N3));
+N1 v [R1](-N4 v -N1:(N3 v N4 v -[R1](-N5 v N3:(N4 v P3 v N5))) v [R1](-P5 v P1 v N5:(-P4 v P3 v -P1))) v -N1:(-P4 v N5 v N4:(-N2 v -[R1](-P5 v -N5 v -P2)));
+N2 v -P5 v -[R1](P1 v -N3 v N5:(-N2 v -N3:(P3 v [R1](-N3 v -P1 v -P2)) v -[R1](N5 v N4 v -P4)));
+N4 v N2:(-P5 v -N1:(-P3 v [R1](-P4 v N4 v -[R1](N4 v P4 v N1)) v [R1](-N4 v P5 v N3)) v -[R1](P4 v P3 v [R1](N3 v N2 v N1))) v -[R1](P4 v N1 v N3:(N1 v -P4 v [R1](-N4 v -N1 v N5)));
+-P2 v P1 v N4:(-N1 v -[R1](-P4 v P5 v -N2:(P3 v N4 v [R1](N5 v -P5 v -N3))) v [R1](N5 v N5:(-P2 v -N3 v -N1)));
+N5 v -N1 v [R1](N2 v N4:(-N5 v -P4 v -[R1](-P3 v N1:(-N2 v -N4 v N3))) v -[R1](-P4 v -P3 v N3:(N4 v N1 v N2)));
+-P2 v P1 v -[R1](P2 v -N2 v -N1:(N5 v -[R1](P4 v N2:(-P5 v -N4 v P2)) v -N5:(P4 v -N2 v -N3)));
+-N2 v [R1](P3 v -N5:(-P3 v -[R1](-P3 v N5 v N3:(P3 v N2 v P5)) v N5:(N2 v -N1 v N3)) v [R1](P3 v N2 v -N4:(N2 v P5 v N1))) v -N5:(-P1 v N2 v [R1](P4 v -P2 v -N3:(N1 v -P1 v -P4)));
+P1 v [R1](-P5 v P3 v [R1](P3 v -N2 v N3:(N4 v -N3:(-P3 v P2 v P5)))) v [R1](N5 v P4 v -N2:(N4 v P5 v -N1:(-P2 v P1 v -P3)));
+-N1 v N5:(-N4 v -N3:(P4 v [R1](P4 v [R1](N3 v P5 v -P4)) v [R1](N5 v -P4 v -N2)) v [R1](-P2 v [R1](-N4 v P1 v -N1))) v N3:(N1 v -[R1](N3 v N5 v -[R1](-P5 v -P2 v P4)) v -[R1](P4 v -N3 v -P5));
+N2 v -[R1](P2 v N1:(-P5 v -P2 v N4:(-N5 v -[R1](-N5 v -P3 v -N3))) v -N1:(-P1 v -[R1](P3 v -N4 v P4))) v -N2:(N4 v P4 v N2:(N5 v -P4 v -[R1](-P4 v P3 v -N3)));
+-N4 v -P5 v [R1](-N4 v N5:(P4 v [R1](-P1 v N1:(-N3 v N2 v N5)) v -N5:(P3 v N3 v -P4)) v N4:(P2 v -[R1](P2 v -N3 v P5)));
+P1 v -N1 v N3:(-N5 v P2 v -[R1](-P1 v -[R1](-N2 v -P5 v -N5:(-P3 v -P1 v -N2)) v -N5:(-P1 v P4 v N2)));
+P1 v -N5 v N1:(N4 v -N5:(-P5 v -[R1](-N4 v -[R1](P5 v -N5 v N2)) v -[R1](-N4 v N2 v N3)) v [R1](-N3 v -[R1](N4 v N2 v -N3)));
+N3 v [R1](-P1 v N1:(-P3 v -N4 v -[R1](N5 v N2 v -N1:(-P5 v -P3 v -N5))) v [R1](-N1 v N1:(P1 v -P5 v P2))) v [R1](P1 v N4:(-N3 v N5:(N2 v -N1 v N3)) v N1:(P2 v N3 v P1));
+-P1 v -N5:(N3 v -N2 v N1:(N3 v -N5 v [R1](-N5 v [R1](-P2 v N5 v -P1)))) v [R1](-N5 v -[R1](N3 v N2 v -N1:(-N4 v -N2 v -P3)) v -N2:(N1 v P1 v P5));
+-N4 v P5 v -[R1](-P2 v [R1](-P2 v P4 v -N2:(N1 v -N1:(N2 v -P5 v -N4))) v N5:(P4 v P5 v -N3:(N4 v -P2 v -P1)));
+P3 v P5 v N4:(N2 v -N1:(-P5 v [R1](P4 v -[R1](-P5 v N1 v -P1)) v -[R1](-N1 v N2 v -P3)) v [R1](-P5 v N2 v -[R1](N2 v -N5 v -P4)));
+P1 v N3 v -N2:(N1 v -N4 v -N3:(-P3 v -[R1](N5 v -P2 v -[R1](-P3 v P4 v N5)) v -[R1](-N1 v -P5 v P2)));
+-N4 v -[R1](P5 v -[R1](-P1 v N5:(P3 v -N1:(P5 v -P3 v P4)) v N5:(-N2 v N3 v N1)) v N3:(N5 v N2:(-P3 v P1 v N3))) v [R1](N1 v -N5:(-P5 v -N2:(-P3 v P2 v N5)) v -N4:(P3 v -N1 v P4));
+-P3 v P2 v -[R1](-N4 v P1 v -[R1](N4 v N5 v N1:(-N4 v -N5:(-N3 v -P2 v P3))));
+N3 v N1:(P1 v -N2 v -[R1](N2 v [R1](N3 v N5 v N2:(N3 v P4 v -P5)) v N3:(N5 v P4 v P2))) v [R1](N1 v N2:(-P1 v -P3 v -[R1](-N2 v N3 v -P4)) v [R1](N3 v P4 v -P5));
+P3 v N3 v -N2:(-P4 v -P3 v -N1:(-P4 v P1 v [R1](-P4 v P2 v [R1](-N3 v P1 v N1))));
+-P3 v N3:(-N5 v -P2 v N2:(P4 v -[R1](P1 v [R1](N5 v N1 v P1)) v [R1](-N2 v -P1 v N3))) v [R1](P3 v N2:(-P4 v N4 v [R1](-N2 v -N5 v -P3)) v -[R1](P3 v -N5 v P5));
+-P3 v -[R1](-N1 v P5 v -N2:(P4 v -[R1](N1 v -N5 v -N3:(P3 v N2 v N1)) v N5:(-N4 v N2 v N1))) v N2:(N1 v -[R1](N1 v N2:(-P3 v N4 v -P2)) v -N4:(-N5 v -N1 v N3));
+P3 v N4 v [R1](P2 v P5 v -[R1](-N4 v -N2:(-P3 v N4 v -N3:(N4 v -P4 v P2)) v N1:(P2 v P1 v N5)));
+-P5 v P1 v N1:(-P2 v [R1](-P5 v P3 v N3:(P4 v -[R1](-N3 v -N4 v -N1))) v [R1](N3 v P5 v -N5:(-N4 v N1 v -P4)));
+-N4 v N3 v [R1](-P4 v N5:(-P4 v N3 v N2:(-N4 v [R1](P5 v N3 v P3))) v [R1](P5 v N4:(-P5 v -P4 v -P2)));
+-N2 v -N5:(-P3 v P5 v N2:(-P1 v [R1](-N5 v -N2 v [R1](-N1 v -N2 v N4)) v -[R1](-P3 v N1 v N4))) v -N4:(P2 v -[R1](-P2 v -[R1](P4 v N5 v P1)) v -[R1](-P1 v -P3 v -N4));
+P2 v N5:(P1 v -P3 v -[R1](N2 v N5 v -[R1](P1 v N2:(-N3 v -N1 v -N4)))) v [R1](P5 v -P3 v N5:(P5 v P3 v [R1](-N4 v N1 v -P3)));
+-N1 v -P2 v -[R1](N2 v -[R1](P3 v -N3 v -N1:(N2 v -N5 v N4:(P3 v -N2 v -P1))) v N4:(N1 v -P1 v N1:(P4 v -P1 v -P2)));
+N3 v -[R1](-N5 v -[R1](P5 v N4 v -N1:(N3 v -N4:(N2 v -P4 v -P1))) v N3:(-N2 v N1:(N2 v N4 v -N5))) v -[R1](P1 v N3:(P3 v -N1:(-N3 v -P3 v -N5)) v N1:(N5 v -N3 v -N2));
+-P3 v -[R1](P1 v N5 v [R1](N2 v N3 v -N1:(-P1 v -N5 v -N3:(N2 v -N5 v -P3)))) v N1:(P1 v N2:(-P1 v -[R1](-N3 v P1 v P2)) v -[R1](-P1 v N1 v -N2));
+P5 v -[R1](-P3 v N1 v -[R1](-P1 v N1 v N2:(P5 v P2 v N4:(-P1 v -P4 v -P5)))) v -[R1](-N5 v -P4 v -N3:(-N2 v -N3:(-P1 v P4 v P5)));
+-P2 v N2 v N4:(N1 v N4:(-P4 v -[R1](-N4 v P4 v -[R1](-P5 v -N1 v -P1)) v [R1](N4 v N5 v -N1)) v -[R1](P2 v [R1](P5 v P4 v -P3)));
+-N1 v P5 v [R1](-N2 v N4 v -N4:(N3 v P3 v -N1:(-N5 v N2 v -[R1](-P3 v -N3 v -N1))));
+-N3 v -[R1](P3 v -N4 v -N2:(-P4 v N3:(N2 v P1 v -[R1](-P4 v -P1 v P3)) v -[R1](N2 v -N5 v N3))) v -N3:(N1 v -N4 v -N3:(-P2 v -P3 v -[R1](-N5 v N2 v -N4)));
+-P5 v -[R1](-N1 v P5 v -[R1](-P1 v -N4:(P3 v -N3:(N5 v N4 v N1)) v -N1:(N4 v -P5 v N5))) v [R1](-N3 v -N4:(-N1 v P2 v N4:(-N5 v N3 v -P1)) v -N5:(P4 v P1 v -N1));
+P3 v -N3:(-P5 v [R1](P5 v N3:(N5 v -[R1](N4 v -N1 v -P3)) v [R1](-P3 v P4 v -P1)) v -[R1](-N3 v -N1:(-N3 v P4 v P3))) v -N1:(P5 v N4 v [R1](-P3 v -P1 v -[R1](-N2 v -N5 v -N4)));
+N2 v P5 v -[R1](-P1 v -N2:(-P5 v -N3:(P5 v N2 v [R1](-N4 v P1 v -P2)) v [R1](P1 v N2 v N1)) v [R1](P4 v -N2 v N5:(P3 v -P5 v -P1)));
+-N3 v -[R1](P3 v [R1](N2 v -P2 v -N1:(N3 v N2 v N5:(-N3 v -N4 v -P2))) v N1:(-N4 v -N3:(-N1 v N5 v -N4))) v -N3:(P2 v N1:(P2 v [R1](-N4 v P5 v -P4)) v -[R1](-N1 v -N5 v -N3));
+P5 v [R1](-N2 v -N5:(N3 v N2 v -[R1](N4 v N5:(-N2 v -N3 v -P5))) v -[R1](-P2 v -N1:(N4 v -P5 v N2))) v -[R1](N5 v -N3 v -N4:(-P2 v -N2 v -N2:(-N3 v P1 v N1)));
+P2 v -N3 v N3:(N1 v -[R1](-N2 v P5 v -N3:(-N1 v [R1](N5 v -N2 v -N4))) v N5:(P5 v [R1](-P1 v P3 v N1)));
+-N1 v P2 v -N4:(P5 v N5:(-N2 v [R1](-P1 v -[R1](P1 v -N4 v P5)) v -[R1](-N5 v N1 v P1)) v [R1](-P2 v [R1](-N1 v -N5 v P1)));
+P5 v -[R1](-N1 v -N4 v -[R1](P1 v N3:(N4 v N1:(P4 v -P1 v -N4)) v -N4:(P5 v -N2 v P4))) v -[R1](-P5 v -P2 v -N5:(N4 v -P4 v N4:(-P3 v P4 v P1)));
+P4 v N2:(N1 v P5 v -N2:(P5 v -N4 v [R1](-N3 v P5 v -[R1](P2 v N5 v -N3)))) v -N5:(-P3 v -[R1](P4 v -[R1](-N3 v -N4 v N2)) v -[R1](-N3 v -N2 v P2));
+-P3 v -[R1](N1 v P2 v -[R1](-P4 v -P2 v N2:(-P5 v -N5 v N3:(-P1 v N4 v -P3)))) v N2:(-P4 v N1:(-N3 v -P3 v [R1](-N3 v N5 v P5)) v [R1](-P4 v -N4 v -P1))
+end
diff --git a/examples/sat_no_mod/all1.frm b/examples/sat_no_mod/all1.frm
deleted file mode 100644
--- a/examples/sat_no_mod/all1.frm
+++ /dev/null
@@ -1,52 +0,0 @@
-% Input file in the format of hylolib 1.3
-
-signature
-{
-
-propositions { tall, strong, pretty, naive }
-nominals     { alice, bob, jean, marie, unknown }
-relations    { love,
-               lovedBy : {inverseof love},
-               canManipulate : {trclosureof lovedBy},
-               know : {reflexive},
-               touches : {symmetric},
-               U : {universal},
-               fatherOf,
-               motherOf,
-               parentOf : {equals {fatherOf,motherOf}},
-               childOf : {inverseof parentOf},
-               youngerThan : {transitive, subsetof childOf}
-             }
-
-}
-
-theory {
- [U]((tall & strong) --> pretty);
-
- alice: ( strong  & !tall & !naive);
- bob: ( tall & !strong ) ;
-
- (alice:bob) v jean:<love>marie;
-
- bob:[lovedBy]naive;
-
- alice:<youngerThan>marie;
- marie:<youngerThan>bob;
- bob:<youngerThan>jean;
-
- unknown:<parentOf>alice
-
-}
-
-query (satisfiable? , "out1") {
- alice:<canManipulate>jean
-}
-
-query (satisfiable? , "out2") {
- unknown:<parentOf>jean
-}
-
-query (retrieve , "retrieve1") {
- <youngerThan>jean
-}
-
diff --git a/examples/unsat/d_unsat1.frm b/examples/unsat/d_unsat1.frm
deleted file mode 100644
--- a/examples/unsat/d_unsat1.frm
+++ /dev/null
@@ -1,4 +0,0 @@
-signature { automatic } theory
-{
-A D N1
-}
diff --git a/examples/unsat/d_unsat2.frm b/examples/unsat/d_unsat2.frm
deleted file mode 100644
--- a/examples/unsat/d_unsat2.frm
+++ /dev/null
@@ -1,6 +0,0 @@
-signature { automatic } theory
-{
-N1 & B N1;
-E P1;
-E !P1
-}
diff --git a/examples/unsat/d_unsat3.frm b/examples/unsat/d_unsat3.frm
deleted file mode 100644
--- a/examples/unsat/d_unsat3.frm
+++ /dev/null
@@ -1,5 +0,0 @@
-signature { automatic } theory
-{
-N1:!N2;
-E B !(N1 v N2)
-}
diff --git a/examples/unsat/d_unsat4.frm b/examples/unsat/d_unsat4.frm
deleted file mode 100644
--- a/examples/unsat/d_unsat4.frm
+++ /dev/null
@@ -1,8 +0,0 @@
-signature { automatic } theory
-{
-N1:!N2; N1:!N3; N1:!N4;
-N2:!N3; N2:!N4; N3:!N4;
-N1:P1; N2:P1;
-N3:!P1; N4:!P1;
-(E B P1) v (E B !P1)
-}
diff --git a/examples/unsat/d_unsat5.frm b/examples/unsat/d_unsat5.frm
deleted file mode 100644
--- a/examples/unsat/d_unsat5.frm
+++ /dev/null
@@ -1,16 +0,0 @@
-signature { automatic } theory
-{
-!P1 v ![R1](!N1 v !D(!P2 v N1:(N1 v P3)));
-!N1 v !D(P1 v !A(!N1 v !N1:(!N1 v !P1)));
-P3 v A(!P3 v [R1](!N1 v D(!P2 v P3)));
-P1 v [R1](P3 v A(N1 v N1:(!P3 v !N1)));
-!N1 v !A(N1 v !D(P2 v ![R1](P1 v N1)));
-!P1 v !A(P3 v !D(N1 v N1:(!N1 v !P2)));
-N1 v !A(P1 v !N1:(!N1 v [R1](P1 v P3)));
-!P1 v !D(!P1 v !A(N1 v !N1:(P1 v !P3)));
-!N1 v !A(!N1 v !D(N1 v N1:(P2 v N1)));
-N1 v ![R1](P1 v [R1](!P2 v D(!P1 v P3)));
-N1 v A(!P2 v D(!P1 v ![R1](!P3 v !N1)));
-!P2 v N1:(N1 v [R1](!P2 v !A(P3 v N1)));
-N1 v [R1](N1 v !N1:(P3 v !N1:(!P2 v N1)))
-}
diff --git a/examples/unsat/d_unsat6.frm b/examples/unsat/d_unsat6.frm
deleted file mode 100644
--- a/examples/unsat/d_unsat6.frm
+++ /dev/null
@@ -1,4 +0,0 @@
-signature { automatic } theory
-{
-<>([]!N0 ^ B false)
-}
diff --git a/examples/unsat/interpol.frm b/examples/unsat/interpol.frm
--- a/examples/unsat/interpol.frm
+++ b/examples/unsat/interpol.frm
@@ -1,6 +1,3 @@
-% Interpolation formula
-
-signature { automatic } theory
-{
+begin
 !((<>p1 & <>!p1) --> (([](p2 --> N1) --> <>!p2)))
-}
+end
diff --git a/examples/unsat/symmetry1.frm b/examples/unsat/symmetry1.frm
deleted file mode 100644
--- a/examples/unsat/symmetry1.frm
+++ /dev/null
@@ -1,14 +0,0 @@
-signature {
-propositions { p }
-nominals { n,m }
-relations { s : {symmetric} }
-}
-
-theory
-
-{
- n:<s><s><s>m;
- n:p;
- m:[s][s][s]!p
-
-}
diff --git a/examples/unsat/test01.frm b/examples/unsat/test01.frm
--- a/examples/unsat/test01.frm
+++ b/examples/unsat/test01.frm
@@ -1,5 +1,3 @@
-signature { automatic } theory
-
-{
+begin
  P1 & !P1
-}
+end
diff --git a/examples/unsat/test02.frm b/examples/unsat/test02.frm
--- a/examples/unsat/test02.frm
+++ b/examples/unsat/test02.frm
@@ -1,7 +1,5 @@
-signature { automatic } theory
-
-{
+begin
  P1 | P2 | P3 | P4;
  !P1 | !P2;
  !(P1 --> ((P3 <--> P4) --> P1))
-}
+end
diff --git a/examples/unsat/test03.frm b/examples/unsat/test03.frm
--- a/examples/unsat/test03.frm
+++ b/examples/unsat/test03.frm
@@ -1,7 +1,5 @@
-signature { automatic } theory
-{
-
+begin
 P1 |  P2 ;
 P1 | !P2;
 !P1
-}
+end
diff --git a/examples/unsat/test04.frm b/examples/unsat/test04.frm
--- a/examples/unsat/test04.frm
+++ b/examples/unsat/test04.frm
@@ -1,6 +1,4 @@
-signature { automatic } theory
-
-{
+begin
 !(((P3 | (!P4 & P5)) <--> (P7 | (P4 --> P2))) <--> (((P3 | (!P4 & P5)) --> (P7 |
 (P4 --> P2))) & ((P7 | (P4 --> P2)) --> (P3 | (!P4 & P5)))))
-}
+end
diff --git a/examples/unsat/test05.frm b/examples/unsat/test05.frm
--- a/examples/unsat/test05.frm
+++ b/examples/unsat/test05.frm
@@ -1,7 +1,5 @@
-signature { automatic } theory
-
-{
+begin
  !((P1 & P2) -> ( ((P4 <--> !P7) | !P9) --> ((P1 & P2) | (P2 | !P2)) ));
  P1 | P2;
  P4 <--> ! P5
-}
+end
diff --git a/examples/unsat/test06.frm b/examples/unsat/test06.frm
--- a/examples/unsat/test06.frm
+++ b/examples/unsat/test06.frm
@@ -1,7 +1,5 @@
-signature { automatic } theory
-
-{
+begin
  N1 : (<R1> N2);
  N2 : P1;
  N1 : [R1] !P1
-}
+end
diff --git a/examples/unsat/test07.frm b/examples/unsat/test07.frm
--- a/examples/unsat/test07.frm
+++ b/examples/unsat/test07.frm
@@ -1,5 +1,3 @@
-signature { automatic } theory
-
-{
+begin
   !(([R1](P1 --> P2)) --> (([R1] P1) --> ([R1] P2)))
-}
+end
diff --git a/examples/unsat/test08.frm b/examples/unsat/test08.frm
--- a/examples/unsat/test08.frm
+++ b/examples/unsat/test08.frm
@@ -1,5 +1,3 @@
-signature { automatic } theory
-
-{
+begin
   !([R1](P1 | !P1))
-}
+end
diff --git a/examples/unsat/test09.frm b/examples/unsat/test09.frm
--- a/examples/unsat/test09.frm
+++ b/examples/unsat/test09.frm
@@ -1,5 +1,3 @@
-signature { automatic } theory
-
-{
+begin
   !(([R1](P1 & P2)) -> (([R1]P1) & ([R1]P2)))
-}
+end
diff --git a/examples/unsat/test10.frm b/examples/unsat/test10.frm
--- a/examples/unsat/test10.frm
+++ b/examples/unsat/test10.frm
@@ -1,5 +1,3 @@
-signature { automatic } theory
-
-{
+begin
    !(((<R1>P1) | (<R1>P2)) --> (<R1>(P1 | P2)))
-}
+end
diff --git a/examples/unsat/test11.frm b/examples/unsat/test11.frm
--- a/examples/unsat/test11.frm
+++ b/examples/unsat/test11.frm
@@ -1,4 +1,3 @@
-signature { automatic } theory
-{
+begin
 !(N1 : N1)
-}
+end
diff --git a/examples/unsat/test12.frm b/examples/unsat/test12.frm
--- a/examples/unsat/test12.frm
+++ b/examples/unsat/test12.frm
@@ -1,6 +1,5 @@
-signature { automatic } theory
-{
+begin
 N1: N2;
 N1: [R1] P1;
 N2: <R1> !P1
-}
+end
diff --git a/examples/unsat/test13.frm b/examples/unsat/test13.frm
--- a/examples/unsat/test13.frm
+++ b/examples/unsat/test13.frm
@@ -1,4 +1,3 @@
-signature { automatic } theory
-{
+begin
 !([R1](P1 --> P2) --> [R1]P1 --> [R1]P2)
-}
+end
diff --git a/examples/unsat/test14.frm b/examples/unsat/test14.frm
--- a/examples/unsat/test14.frm
+++ b/examples/unsat/test14.frm
@@ -1,6 +1,5 @@
-signature { automatic } theory
-{ 
+begin
 !((!<>(n1:n3 v <>(p1 <--> []p3)) & <>(n3:<>p1 --> [](p3 v <>(p4 <-->
 <>p2)))) --> <>(!(n1:n3 v <>(p1 <--> []p3) & (n3:<>p1 --> [](p3 v <>(p4 <-->
 <>p2)))))) 
-}
+end
diff --git a/examples/unsat/test15.frm b/examples/unsat/test15.frm
--- a/examples/unsat/test15.frm
+++ b/examples/unsat/test15.frm
@@ -1,4 +1,3 @@
-signature { automatic } theory
-{
+begin
 !(<>(n1 & <><><><><>(n1:n2) & (<>(p1 --> [](p3 <--> <>p1))) & <><><><><>(n2:n3)) & <>(n3 & p2) --> <>((<>(p1 --> [](p3 <--> <>p1))) & p2))
-}    
+end
diff --git a/examples/unsat/test16.frm b/examples/unsat/test16.frm
--- a/examples/unsat/test16.frm
+++ b/examples/unsat/test16.frm
@@ -1,5 +1,3 @@
-signature { automatic } theory
-{
+begin
 !(((<><><><>(n1:n2)) & n1:(([]<>(p1 v n2:(p1 <--> <>p3))) --> (<>p1 <--> []<>(false v n2:(n3 & P4))))) --> (n2:([]<>(p1 v n2:(p1 <--> <>p3))) --> n1:(<>p1 <--> []<>(false v n2:(n3 & P4)))))
-}    
-
+end
diff --git a/examples/unsat/test17.frm b/examples/unsat/test17.frm
--- a/examples/unsat/test17.frm
+++ b/examples/unsat/test17.frm
@@ -1,5 +1,3 @@
-signature { automatic } theory
-{
+begin
 !(n1:(n1 & n2:(n2 & ([](p1 -->((!(p1 -> (p2 --> p1))) v p2)) --> ([]p1 --> []p2)))))
-}    
-
+end
diff --git a/examples/unsat/test18.frm b/examples/unsat/test18.frm
--- a/examples/unsat/test18.frm
+++ b/examples/unsat/test18.frm
@@ -1,6 +1,5 @@
-signature { automatic } theory
-{
+begin
 n1:<>(n1 v (p1 ^ !p1));
 n1:((<>true v (p1 --> (p2 --> p1)) v []false) --> p1);
 !(n1:<>p1) 
-}    
+end
diff --git a/examples/unsat/test19.frm b/examples/unsat/test19.frm
--- a/examples/unsat/test19.frm
+++ b/examples/unsat/test19.frm
@@ -1,5 +1,4 @@
-signature { automatic } theory
-{
+begin
 <>((p1 v p2) & (n1:p3));
 [](p1 --> p3);
 [](p2 --> p3);
@@ -7,4 +6,4 @@
 n1:<>n2;
 n2:((n1:!p1) --> p5);
 !(<>p3 v n1:<>p5)
-}    
+end
diff --git a/examples/unsat/test20.frm b/examples/unsat/test20.frm
--- a/examples/unsat/test20.frm
+++ b/examples/unsat/test20.frm
@@ -1,5 +1,4 @@
-signature { automatic } theory
-{
+begin
 n1:(p1 -> <>p2);
 n2:(p2 -> []p3);
 n1:!n2;
@@ -9,4 +8,4 @@
 n2:<>n1;
 n1:!p3;
 n3:<>(n2 & p2)
-}    
+end
diff --git a/examples/unsat/test21.frm b/examples/unsat/test21.frm
--- a/examples/unsat/test21.frm
+++ b/examples/unsat/test21.frm
@@ -1,5 +1,4 @@
-signature { automatic } theory
-{
+begin
 n1:(p1 --> <>([](<>p1 <--> []<>(p1 v false))));
 n2:(([](<>p1 <--> []<>(p1 v false))) --> []p3);
 n1:!n2;
@@ -9,4 +8,4 @@
 n2:<>n1;
 n1:!p3;
 n3:<>(n2 & ([](<>p1 <--> []<>(p1 v false)))) 
-}    
+end
diff --git a/examples/unsat/test22.frm b/examples/unsat/test22.frm
--- a/examples/unsat/test22.frm
+++ b/examples/unsat/test22.frm
@@ -1,5 +1,4 @@
-signature { automatic } theory
-{
+begin
 n1:<>(!((<>(n1 & p1) & <>(n1 & p2))-> <>(p1 & p2)));
 <>(p1 v <>(p1 v <>(p1 v <>(p1 v <>(p1 v <>(p1 v <>(n2:n1)))))));
 []!p1;
@@ -8,4 +7,4 @@
 [][][][]!p1;
 [][][][][]!p1;
 n2:<>true
-}    
+end
diff --git a/examples/unsat/test23.frm b/examples/unsat/test23.frm
--- a/examples/unsat/test23.frm
+++ b/examples/unsat/test23.frm
@@ -1,5 +1,4 @@
-signature { automatic } theory
-{
+begin
 n1:<>(!((<>(n1 & p1) & <>(n1 & p2))-> <>(p1 & p2)));
 <>((p1 <--> [](p3 <--> <>false)) v <>((p1 <--> [](p3 <--> <>false)) v <>((p1 <--> [](p3 <--> <>false)) v <>((p1 <--> [](p3 <--> <>false)) v <>((p1 <--> [](p3 <--> <>false)) v <>((p1 <--> [](p3 <--> <>false)) v <>(n2:n1)))))));
 [](!(p1 <--> [](p3 <--> <>false)));
@@ -8,5 +7,4 @@
 [][][][](!(p1 <--> [](p3 <--> <>false)));
 [][][][][](!(p1 <--> [](p3 <--> <>false)));
 n2:<>true
-}    
-
+end
diff --git a/examples/unsat/test24.frm b/examples/unsat/test24.frm
--- a/examples/unsat/test24.frm
+++ b/examples/unsat/test24.frm
@@ -1,5 +1,4 @@
-signature { automatic } theory
-{
+begin
 n1:(p1 --> <>([](<>p1 <--> []<>(p1 v false))));
 n2:(([](<>p1 <--> []<>(p1 v false))) -> [](([](p1 <--> (n2:n1 v []<>p2)))));
 n1:!n2;
@@ -9,6 +8,4 @@
 n2:<>n1;
 n1:!(([](p1 <--> (n2:n1 v []<>p2))));
 n3:<>(n2 & ([](<>p1 <--> []<>(p1 v false))))
-}    
-
-
+end
diff --git a/examples/unsat/test25.frm b/examples/unsat/test25.frm
--- a/examples/unsat/test25.frm
+++ b/examples/unsat/test25.frm
@@ -1,6 +1,4 @@
-signature { automatic } theory
-{
+begin
 !(<>(n1 & <><><><><>(n1:n2) & (<>(p1 --> [](p3 <--> <>p1))) & <><><><><>(n2:n3)) & <>(n3 & (p1 v (p3 <--> <>[]p1))) --> <>((<>(p1 --> [](p3 <--> <>p1))) & (p1 v (p3 <--> <>[]p1))))
-}    
-
+end
 
diff --git a/examples/unsat/test28.frm b/examples/unsat/test28.frm
--- a/examples/unsat/test28.frm
+++ b/examples/unsat/test28.frm
@@ -1,6 +1,5 @@
-signature { automatic } theory
-{
+begin
 n1:<>(n1 v (p1 & !p1));
 n1:(<>true  --> p1);
 !(n1:<>p1) 
-}    
+end
diff --git a/examples/unsat/test29.frm b/examples/unsat/test29.frm
--- a/examples/unsat/test29.frm
+++ b/examples/unsat/test29.frm
@@ -1,5 +1,4 @@
-signature { automatic } theory
-{
+begin
 (n1 v !([R1](n3 v (n3:(!n4 v !(n2:(p8 v ([R1](p6 v ([R1](!p3 v !(n4:(n2 v (n2:(n1 v (n4:(n3 v p1))))))))))))))))) &
 (!n4 v !(n3:(!n1 v (n2:(!n3 v !([R1](n3 v (n4:(n2 v ([R1](p7 v !(n3:(p6 v !(n4:(n1 v !([R1](n1 v !p5))))))))))))))))) &
 (p4 v !([R1](n4 v ([R1](!n4 v (n1:(n3 v !([R1](!n1 v ([R1](!n3 v (n4:(!p6 v !(n2:(!p3 v !(n4:(!n3 v n1))))))))))))))))) &
@@ -7,4 +6,4 @@
 (n2 v ([R1](n3 v !(n2:(!n3 v (n3:(!n4 v (n3:(!p2 v ([R1](!p2 v (n3:(!p3 v !([R1](!p3 v ([R1](n2 v !n1))))))))))))))))) &
 (!n2 v (n4:(!p4 v !([R1](n1 v (n4:(p4 v (n4:(p4 v !(n3:(p2 v ([R1](!p1 v ([R1](p1 v ([R1](n2 v !n1))))))))))))))))) &
 (n4 v !(n1:(!n3 v (n1:(!p2 v ([R1](n1 v !(n4:(!p3 v !([R1](n2 v ([R1](!n2 v (n1:(!p4 v ([R1](n4 v !n3)))))))))))))))))
-}
+end
diff --git a/examples/unsat/test32.frm b/examples/unsat/test32.frm
--- a/examples/unsat/test32.frm
+++ b/examples/unsat/test32.frm
@@ -1,8 +1,6 @@
-signature { automatic } theory
-{
+begin
 n2:n1;
 n1 v <R1>(n1:(n2 & !p1));
 <R1>(n1:p1);
 !n2 
-}
-
+end
diff --git a/examples/unsat/test33.frm b/examples/unsat/test33.frm
--- a/examples/unsat/test33.frm
+++ b/examples/unsat/test33.frm
@@ -1,4 +1,3 @@
-signature { automatic } theory
-{
+begin
 A (p1 ^ <>!p1)
-}
+end
diff --git a/examples/unsat/test34.frm b/examples/unsat/test34.frm
--- a/examples/unsat/test34.frm
+++ b/examples/unsat/test34.frm
@@ -1,5 +1,4 @@
-signature { automatic } theory
-{
+begin
 A(P1 v P2);
 N1:(!P1 & !P2)
-}
+end
diff --git a/examples/unsat/test35.frm b/examples/unsat/test35.frm
--- a/examples/unsat/test35.frm
+++ b/examples/unsat/test35.frm
@@ -1,5 +1,3 @@
-signature { automatic } theory
-{
+begin
 down(N1 !N1)
-}
-
+end
diff --git a/examples/unsat/test36.frm b/examples/unsat/test36.frm
--- a/examples/unsat/test36.frm
+++ b/examples/unsat/test36.frm
@@ -1,4 +1,3 @@
-signature { automatic } theory
-{
+begin
 !((down (N1 dia (N1 ^ p1) )) --> p1)
-}
+end
diff --git a/examples/unsat/test37.frm b/examples/unsat/test37.frm
--- a/examples/unsat/test37.frm
+++ b/examples/unsat/test37.frm
@@ -1,5 +1,4 @@
-signature { automatic } theory
-{
+begin
 n3:[R3](down (N1 [R1]([R1]( down( N2 (N1:<R1>N2)))))) ;
 n3:<R3>n1;
 n3:<R3>n2;
@@ -7,4 +6,4 @@
 n1:<R1>n2;
 n2:<R1>n3;
 n1:!<R1>n3
-}
+end
diff --git a/examples/unsat/test38.frm b/examples/unsat/test38.frm
--- a/examples/unsat/test38.frm
+++ b/examples/unsat/test38.frm
@@ -1,5 +1,4 @@
-signature { automatic } theory
-{
+begin
 p1 v <><><><>p1 v down(N1 <>(N1:[]p1));
 A !p1
-}
+end
diff --git a/examples/unsat/test39.frm b/examples/unsat/test39.frm
new file mode 100644
--- /dev/null
+++ b/examples/unsat/test39.frm
@@ -0,0 +1,102 @@
+begin
+N2 v [R1](-N1 v [R1](-N5 v -P5 v -N2:(-P3 v N3:(N5 v -N2 v P1))) v -N1:(-P2 v N2:(-N1 v P3 v -N3))) v [R1](P5 v N4:(P1 v -P2 v N5:(P2 v -P3 v N4)) v N4:(N2 v -P5 v N1));
+-N2 v -[R1](N3 v -N1 v [R1](P4 v N3 v N1:(N4 v -P2 v -N2:(P2 v P4 v N1)))) v -[R1](-P4 v N5 v N3:(P3 v -N3:(-N1 v P2 v -N4)));
+-P1 v -N1 v N1:(-P5 v -N2:(-N4 v -[R1](N3 v -P5 v [R1](-P4 v -P5 v P2)) v [R1](-N2 v N4 v P2)) v [R1](P2 v -N5 v [R1](-P1 v N1 v N5)));
+-N1 v [R1](N3 v -N3:(N5 v -P2 v N2:(-N4 v N5 v [R1](P1 v -N2 v N1))) v -[R1](-N2 v P1 v -N3:(N1 v N4 v P1))) v [R1](-N3 v -P3 v -N3:(-N5 v N4 v -N2:(P1 v N1 v P4)));
+P1 v -N3:(-P3 v -[R1](N4 v -N2 v [R1](-P4 v N2:(-P4 v P3 v -P2))) v N3:(N1 v P5 v -[R1](-P2 v -P4 v -N3))) v -N3:(-N5 v -N2 v [R1](P4 v -N4 v [R1](-P2 v N5 v P4)));
+-N1 v -[R1](-N1 v N2:(-P3 v -P5 v -N3:(-P5 v -[R1](-P2 v P3 v P5))) v [R1](-N2 v P2 v -N2:(-N3 v N5 v -N1))) v [R1](-P2 v N5 v -N4:(-N2 v -P1 v -N2:(-N1 v P1 v -N5)));
+-N1 v -N4:(-P4 v [R1](-P5 v -N1:(-N3 v -P5 v -[R1](-P4 v P2 v -P5)) v -[R1](-P4 v -P3 v -P2)) v N2:(-N3 v -P2 v -[R1](N3 v N5 v -N4))) v -N3:(N2 v -[R1](P5 v -N3 v [R1](P5 v -N1 v -N2)) v -[R1](-N2 v P3 v -P1));
+P4 v -N1 v -N1:(-N3 v -P3 v N5:(-N2 v -[R1](P2 v -[R1](-N2 v -N5 v -P4)) v [R1](N4 v P5 v P3)));
+-P1 v [R1](N4 v -[R1](P3 v N2:(-P1 v N5 v N2:(N1 v N3 v P3)) v N3:(-N4 v -P1 v N2)) v N1:(P3 v N2 v N5:(-P1 v N4 v -P3))) v -[R1](N1 v -N1:(P4 v -N5:(-N1 v -P5 v N3)) v -N5:(-P3 v P1 v -N4));
+-P3 v [R1](-N2 v [R1](-N3 v -P3 v N3:(-N1 v -N2:(-N1 v N5 v P2))) v N2:(-P1 v -N4:(P3 v P1 v -P5))) v -[R1](-P2 v -P3 v -N1:(P3 v -N4 v -N1:(N3 v -P3 v -P1)));
+-N4 v N3:(-N5 v P3 v N1:(N3 v N4 v [R1](P1 v -[R1](-N1 v P4 v -N4)))) v -N5:(-N4 v -[R1](-P3 v [R1](-P1 v -N5 v P4)) v [R1](-P2 v N3 v -P3));
+P3 v -N2:(P3 v -[R1](N2 v -P1 v -N3:(N1 v [R1](N1 v P1 v -P2))) v -[R1](-N5 v -P5 v -N1:(P4 v -N5 v -N2))) v -[R1](N5 v [R1](-N1 v N4:(N5 v -N1 v -N3)) v -N3:(-N2 v -P1 v -N5));
+-P3 v -N1 v -[R1](-P3 v -[R1](P1 v P2 v N3:(-P5 v -N1 v -N3:(-N2 v P5 v P3))) v -N1:(-P1 v -N4 v N3:(N2 v -N4 v N1)));
+-P3 v [R1](P4 v P5 v -[R1](-P3 v N1:(-N4 v -N5 v N2:(-P5 v -N5 v N4)) v N1:(-N3 v P2 v N4))) v N2:(N5 v N5:(P1 v [R1](N2 v N3 v -N4)) v -[R1](-P2 v N2 v N1));
+-N2 v -[R1](-N5 v [R1](-N1 v -N4 v N5:(-N2 v -N3 v -N5:(-P1 v -P4 v -N2))) v -N2:(-N1 v P5 v -N4:(-P2 v -P4 v P5))) v N4:(-N1 v -N3 v -[R1](P1 v P2 v N5:(P4 v P1 v -N2)));
+-P1 v -P2 v -[R1](N2 v N2:(-N4 v [R1](-P3 v -N2:(-N5 v -P1 v N4)) v -N3:(P4 v P5 v N4)) v [R1](-P3 v -P5 v -N4:(-N5 v P4 v -P5)));
+-N1 v N5 v [R1](-N2 v P1 v N4:(-P1 v -N3 v N5:(N1 v [R1](N2 v P4 v P2))));
+P5 v [R1](-N4 v [R1](N2 v -N1:(P4 v -P3 v -N3:(N1 v -P5 v -N2)) v -N4:(-N2 v -N5 v N3)) v N4:(-N1 v -N3:(-N5 v -P1 v P2))) v -N3:(N4 v P3 v N5:(-N1 v -[R1](-P4 v P1 v P2)));
+-N5 v -N4 v -[R1](P2 v N1:(N4 v [R1](P3 v -N4 v N3:(P5 v N2 v -N1)) v N2:(P5 v -N3 v N4)) v N3:(-N1 v -P1 v [R1](N3 v -N2 v N4)));
+-P1 v -[R1](-N5 v P5 v -[R1](-P4 v -N5 v -N5:(-N1 v -P4 v -N4:(P5 v P4 v -P1)))) v -[R1](-P5 v N3:(-N5 v -N1 v N3:(-P4 v P3 v -P2)) v N1:(N5 v -P5 v P2));
+-P1 v -N2:(-N4 v -P4 v [R1](N5 v N4 v -N3:(P4 v -N4 v [R1](P3 v N2 v N5)))) v -N1:(-P3 v -[R1](-N2 v -[R1](-N2 v -P2 v -N3)) v [R1](P3 v -N1 v -P4));
+-P1 v -N2 v -[R1](P3 v [R1](P4 v -N2:(-P3 v N1 v -N4:(N1 v -N2 v -P4)) v N5:(N3 v -N1 v -P2)) v N4:(-P5 v N1 v -N3:(N4 v -P4 v N5)));
+P1 v N5 v -[R1](-N4 v [R1](-N2 v N3 v N5:(-P1 v -N4 v N1:(P5 v -P4 v -P2))) v N2:(P3 v P5 v N2:(N1 v -P1 v N3)));
+-N5 v -P1 v -[R1](-P4 v P2 v N1:(-P1 v N4:(N1 v [R1](-N2 v -N5 v -P4)) v [R1](N3 v N1 v N2)));
+-P3 v -N3:(-P3 v N3:(P4 v [R1](N1 v -[R1](P4 v N4 v N5)) v -[R1](-N5 v -P3 v -P4)) v [R1](N3 v N1 v -[R1](N5 v -P3 v -N2))) v -[R1](-P4 v -P2 v N3:(-P3 v N4 v -[R1](N2 v P5 v N1)));
+-N3 v -[R1](P5 v -P4 v N1:(N3 v [R1](-N1 v -N3:(P1 v -P5 v -P2)) v N5:(-P5 v -N2 v P4))) v N2:(-N4 v -N1 v N5:(P5 v [R1](-N5 v -N3 v P5)));
+N1 v -[R1](-P5 v [R1](P5 v -P1 v N5:(N2 v N4:(-N2 v N5 v -P1))) v -N1:(P3 v N4:(-P2 v -N2 v -N1))) v [R1](-P3 v -N3:(-P3 v -N2:(-N5 v -P1 v -P5)) v -N2:(P5 v P4 v P1));
+N4 v N3 v -[R1](N1 v N2 v N4:(-P2 v P1 v -[R1](P2 v N5:(-P2 v -P4 v N2))));
+-P1 v [R1](P2 v -N3 v -[R1](N5 v -P2 v N3:(-P5 v -P1 v -N2:(-N4 v -N5 v -P5)))) v N2:(-N3 v P5 v [R1](P2 v -N2 v N5:(-N2 v N3 v P4)));
+-N1 v N4 v -[R1](-N1 v -N2 v [R1](P2 v N1:(P5 v N5:(N2 v P2 v -N4)) v N1:(P5 v P2 v P1)));
+N4 v -N5:(P4 v -N1:(P4 v [R1](N4 v -P4 v [R1](-P5 v -N4 v -P1)) v -[R1](N2 v N1 v P1)) v -[R1](N4 v -N2 v -[R1](P2 v N2 v P1))) v [R1](P5 v -P1 v -N5:(-N3 v -P2 v [R1](-N4 v N3 v N1)));
+P5 v N5 v -[R1](P5 v N4 v N3:(N4 v -N2 v -[R1](P1 v N4:(P5 v -P2 v N2))));
+N5 v -P5 v N2:(-N3 v N2:(-P4 v -[R1](-N1 v N4 v [R1](P3 v -P4 v N3)) v [R1](N3 v P2 v -P3)) v -[R1](P4 v [R1](P2 v -P3 v -P5)));
+P5 v -P4 v -[R1](N5 v -N3:(-N1 v [R1](-P5 v -N4:(-N2 v -P1 v -P3)) v -N1:(P1 v -N3 v -N4)) v N4:(N2 v [R1](-N2 v -P5 v N4)));
+-N3 v -N4:(N5 v -N2 v [R1](N3 v N4 v -N1:(N4 v -N2 v [R1](-N2 v -N3 v P3)))) v -N4:(P1 v -[R1](-P4 v -N1 v -[R1](N5 v N4 v -P3)) v -[R1](-P2 v -N3 v N2));
+-N4 v P4 v -N3:(P4 v N1 v -[R1](-N5 v -N1:(-N3 v -P2 v -[R1](-N5 v N4 v P5)) v [R1](P2 v -P1 v -N3)));
+-N5 v P5 v -[R1](P1 v N2 v -[R1](P5 v N2 v -N4:(N1 v -N4:(-N2 v -N1 v -P5))));
+-P1 v [R1](P1 v -N5 v -[R1](-P2 v N1 v -N3:(-P1 v N2:(-N4 v P3 v P2)))) v -[R1](N1 v -N1:(N5 v N3 v -N2:(-P3 v -P4 v P5)) v -N3:(-P3 v -N2 v P1));
+P5 v -N5 v [R1](P5 v -P2 v -[R1](-N5 v N3 v N4:(-N3 v -N2 v -N1:(-P5 v P3 v N3))));
+N4 v -N5 v -N5:(-P5 v N1 v -[R1](-N4 v [R1](N4 v N5:(-P1 v -N4 v -P5)) v -N1:(P1 v N4 v P4)));
+-P4 v -[R1](-P5 v -P3 v -N4:(-P1 v -N3 v -N2:(P1 v N1 v -[R1](-P2 v -P4 v N1)))) v -[R1](N4 v -P5 v -N3:(-P3 v -P5 v N5:(P1 v N1 v -N2)));
+P5 v -[R1](N3 v -N5 v -N2:(P1 v N4 v -[R1](N1 v N4 v -N2:(-N1 v -N4 v -P2)))) v N2:(-P4 v -[R1](-N2 v N4 v N4:(-P3 v -N3 v -P2)) v -N3:(-N5 v -N1 v P3));
+-P5 v N4 v -N5:(-P3 v -N5:(-N3 v -[R1](-N2 v P5 v -[R1](P2 v N3 v P5)) v [R1](-P2 v P3 v -P4)) v -[R1](N5 v [R1](-P5 v -N4 v -N3)));
+P3 v P2 v N5:(-P1 v -P2 v -N3:(-P3 v -[R1](-P3 v [R1](P5 v N2 v -N5)) v [R1](-P2 v -N5 v N1)));
+N5 v P4 v -N2:(-N5 v -[R1](N3 v -N2 v [R1](P3 v -N1:(P2 v -P3 v -P1))) v [R1](N5 v -P1 v -N4:(P2 v -P3 v P5)));
+-P5 v -P4 v N3:(P1 v -N1 v -N4:(P5 v -[R1](P1 v [R1](-P3 v -P2 v P1)) v -[R1](-P5 v P1 v -P2)));
+-P1 v -N3 v -N3:(N4 v N5:(P1 v [R1](-P5 v N2 v -[R1](-N5 v N1 v N2)) v -[R1](-N5 v N3 v P1)) v -[R1](P3 v P2 v [R1](-N2 v -P2 v N4)));
+P1 v -N5 v -[R1](-P3 v P1 v [R1](-P3 v -N4:(P2 v N1:(P5 v P3 v N5)) v -N3:(-P1 v P5 v -N5)));
+N1 v P5 v N3:(P4 v -P3 v -N1:(-P3 v P5 v -[R1](-N5 v -N1 v -[R1](P5 v -N2 v P2))));
+N5 v -N1:(-N5 v -N4:(P5 v N2 v -[R1](P2 v -[R1](-P3 v -N4 v -N2))) v [R1](-N1 v -N2 v [R1](N2 v P4 v P5))) v -N2:(P3 v -[R1](P4 v -[R1](-P1 v P5 v -P3)) v -[R1](P5 v -N4 v -P3));
+P4 v N5 v [R1](-P2 v N1 v -[R1](P3 v P4 v -N3:(-N4 v -P1 v N2:(-N4 v P1 v N1))));
+-P1 v N1:(-N5 v N2 v N4:(-N1 v P3 v [R1](N4 v [R1](-P4 v -P3 v -P1)))) v N5:(N1 v -[R1](-N3 v -N5 v -[R1](N3 v -N4 v P3)) v -[R1](N1 v N2 v N5));
+P3 v -N3:(N5 v P1 v -N5:(N2 v -P5 v -[R1](-P4 v [R1](P1 v N1 v -P5)))) v N4:(-N1 v -N3 v [R1](-N1 v -P5 v -[R1](-N3 v N5 v P2)));
+N2 v P2 v N2:(-N1 v [R1](-P2 v N3:(P4 v -[R1](-P2 v N1 v N2)) v -[R1](-N4 v P1 v -P3)) v -[R1](N1 v N5 v -N3:(-N4 v -N1 v P1)));
+P1 v P2 v N5:(-N2 v [R1](N1 v P1 v -[R1](P3 v N2 v -N4:(P3 v -P2 v N2))) v -[R1](-P1 v -N3 v N1:(-P4 v N5 v -N2)));
+P3 v N5 v -[R1](N4 v -P5 v N1:(-P5 v -N4 v -N3:(P2 v [R1](-P4 v P1 v -P2))));
+N5 v -N4:(-N1 v P1 v N2:(N1 v -N4 v -[R1](-P5 v [R1](N1 v P1 v -P3)))) v [R1](-N4 v -N4:(N3 v -[R1](N1 v -N4 v -N3)) v -[R1](-P2 v -P3 v -N4));
+P3 v -N2:(-N1 v -[R1](-P4 v P3 v N4:(P1 v -N3 v -[R1](-N3 v P4 v -N1))) v N5:(-P4 v P5 v [R1](-N2 v -P2 v P5))) v N3:(-P2 v [R1](-N4 v -N3 v -[R1](P5 v -N1 v -P2)) v -[R1](-N2 v P2 v N5));
+N5 v -N1 v -[R1](N2 v -N5 v N4:(N3 v P3 v -N1:(P4 v -P1 v [R1](N4 v -P4 v P5))));
+-P5 v -N4:(N2 v -P1 v [R1](N5 v N4:(-P4 v -P2 v -[R1](P2 v N5 v P5)) v [R1](-P2 v N4 v -P1))) v [R1](N1 v [R1](-P4 v N2 v -N2:(P1 v N1 v -P3)) v -N3:(N2 v -N1 v N4));
+N2 v N2:(N5 v N4 v -[R1](P2 v N3:(-P2 v -N5 v -[R1](N4 v N1 v P3)) v [R1](N2 v -P2 v P3))) v -[R1](P4 v -N5:(-P2 v [R1](P2 v -P1 v -P3)) v -[R1](-N4 v -N1 v -N3));
+-N3 v -P4 v -[R1](N3 v -N1 v -N5:(-P4 v P3 v [R1](N3 v N3:(-P2 v -P4 v -N5))));
+P5 v -[R1](-P5 v P1 v [R1](P3 v -N4 v -N5:(-N3 v N5:(-N1 v N3 v -N4)))) v -[R1](-P2 v N2:(P5 v N3:(-N2 v P5 v -P4)) v N2:(N1 v N5 v N4));
+-N5 v [R1](-N4 v -N5 v N3:(-N4 v -N5 v [R1](-P4 v -N4 v N4:(-N3 v N5 v N2)))) v -[R1](N5 v -N2:(-N1 v N3:(P4 v N2 v -N1)) v N3:(P5 v P3 v N4));
+N4 v N3 v -[R1](-P1 v N4 v [R1](-N2 v -N5:(N3 v N5:(-N1 v -N2 v -P3)) v -N4:(P3 v -N5 v -P5)));
+N4 v -N1 v -[R1](-P1 v [R1](-P2 v -N3:(N5 v -N1 v -N4:(N5 v -N3 v -P5)) v N3:(-N4 v P1 v -P5)) v -N5:(N1 v N1:(-P3 v -N2 v -N5)));
+-P4 v [R1](-P4 v -N5 v [R1](N4 v -N5:(P5 v N2:(N3 v -P1 v P5)) v N5:(N1 v -P4 v P3))) v [R1](-N4 v N2 v N5:(P1 v -P5 v -N2:(-P5 v N3 v P1)));
+N5 v [R1](N1 v -[R1](P3 v -N4:(P1 v N4:(-P2 v N1 v P1)) v N5:(-N1 v P1 v N4)) v N1:(P1 v -P3 v -N1:(P4 v N2 v P3))) v -N5:(-P2 v -N4:(-N5 v -P1 v -[R1](N3 v -N5 v -N1)) v -[R1](-P2 v -N4 v -P3));
+P4 v N4:(-N5 v -P3 v N2:(-N5 v [R1](-P4 v -[R1](N5 v -N4 v -N2)) v -[R1](P4 v P5 v P1))) v -N4:(-P2 v -[R1](-N1 v [R1](N4 v N3 v P4)) v [R1](-P5 v P1 v -N3));
+N4 v -N3:(P4 v N1 v [R1](N4 v P2 v N1:(N3 v -[R1](-P5 v P4 v -P2)))) v N3:(N1 v -P4 v [R1](P4 v -P3 v -[R1](N1 v N4 v -P1)));
+-N1 v N5:(P2 v -[R1](P5 v -N1 v -N5:(-P1 v N4 v -[R1](-N1 v -P3 v P5))) v [R1](-N3 v N5:(-P3 v N3 v P2))) v N3:(-P1 v -N2 v [R1](-P5 v [R1](-N4 v -P3 v N2)));
+P5 v -P3 v N1:(-N3 v P1 v -[R1](N4 v N1 v N5:(N4 v N1 v [R1](-N5 v P2 v P3))));
+P5 v [R1](P5 v -[R1](-N3 v N3:(-P4 v P3 v -N1:(-P1 v P5 v P4)) v -N2:(P4 v N5 v N3)) v N4:(P4 v -N5 v N5:(N2 v N3 v -P5))) v -[R1](-P4 v N4:(N5 v -N2:(-N5 v N3 v N4)) v N1:(-N5 v -P2 v N3));
+P1 v -N3:(-P1 v -P4 v -N3:(N1 v -[R1](P1 v -[R1](N1 v P5 v P1)) v [R1](P2 v P3 v N3))) v -[R1](N1 v -[R1](N2 v -N3:(-N5 v N2 v -N1)) v N1:(-P5 v -N4 v -P2));
+-N3 v -N4 v [R1](-P2 v -[R1](-P2 v P3 v -N3:(-N1 v N3:(P5 v N2 v -N5))) v -N3:(-P5 v -N5 v -N2:(N5 v P4 v -N3)));
+-P5 v N4 v -N5:(N3 v -[R1](-P3 v -[R1](-N5 v N4 v -N5:(-P2 v -N2 v -N4)) v N3:(P2 v -N4 v -N5)) v [R1](N4 v N1:(-N5 v P2 v P5)));
+-P2 v -N4 v N2:(-N5 v P2 v [R1](-N2 v -N4 v -N3:(N4 v N2 v -[R1](-P5 v P1 v -P2))));
+-P1 v N1:(P4 v [R1](P2 v [R1](-P3 v N2 v -N3:(-P5 v P2 v P4)) v N4:(N3 v N5 v N1)) v -N1:(-N4 v -[R1](P5 v P1 v N1))) v [R1](P1 v -P4 v -N5:(-P1 v -N2 v -[R1](P3 v N5 v N2)));
+-P4 v N4 v -[R1](-P5 v -N4 v N3:(-P1 v N2 v -[R1](-P3 v -P2 v N4:(P2 v -P3 v P4))));
+-P1 v N3:(P4 v [R1](-N4 v -N3:(-N4 v [R1](N2 v P4 v -N5)) v [R1](N2 v -P2 v -P1)) v -[R1](-N5 v N1:(-P4 v -P3 v -N2))) v -[R1](P3 v -P2 v -N3:(-P2 v -[R1](P1 v -N2 v -P5)));
+-N2 v [R1](P4 v P1 v -[R1](P1 v N1:(-P5 v N4:(P3 v P5 v P2)) v N5:(N4 v P2 v P3))) v -N4:(-P5 v N2:(-N1 v N5 v [R1](P4 v -N1 v P2)) v [R1](-P2 v -N3 v P5));
+-N3 v [R1](N5 v -N1:(-N5 v P2 v -N4:(-P2 v N3 v [R1](-P2 v -N3 v P1))) v N1:(-N5 v -N3 v [R1](P4 v -P2 v N2))) v -[R1](-P2 v -N3:(-N2 v -P4 v N3:(P1 v N1 v N2)) v N5:(N3 v -P5 v N2));
+N1 v -[R1](N3 v N5 v [R1](-P5 v -N1:(P5 v -P3 v -N2:(N5 v -P2 v P4)) v -N3:(N4 v -P3 v -N5))) v -[R1](P5 v N2:(P1 v -N5 v N1:(-P4 v P3 v -N2)) v -N2:(N1 v -P1 v -N4));
+-N2 v N5 v -N1:(-N5 v -N4 v -[R1](-N4 v -[R1](P3 v -N1:(N5 v -N3 v P5)) v -N5:(N1 v -N4 v -P1)));
+-P2 v -N4:(-N5 v -P2 v -[R1](-N5 v P3 v N5:(P3 v -[R1](-N4 v P4 v P5)))) v -[R1](N2 v P1 v N4:(-N2 v -N1 v -[R1](P5 v -N4 v N5)));
+N5 v -[R1](N5 v -N2 v -[R1](P1 v -N2 v N4:(-N3 v -N4:(P1 v -N3 v -N1)))) v -[R1](-N5 v -N5:(N4 v P1 v N4:(-N1 v N3 v -P4)) v N1:(-N4 v -P5 v P2));
+-P1 v N4:(N3 v N2 v N2:(P1 v P5 v [R1](-P2 v -[R1](N2 v -P4 v P5)))) v [R1](-P2 v N5:(-N2 v [R1](N1 v N4 v N2)) v -[R1](N3 v -N5 v -N2));
+N4 v -P2 v -[R1](N1 v [R1](P2 v N5:(P5 v -N4:(-N3 v P1 v -N5)) v -N1:(-P4 v P5 v -P1)) v N3:(-N5 v N1:(P4 v -N4 v P5)));
+P4 v N1 v N2:(N1 v P3 v [R1](-N1 v -N4 v [R1](P5 v N2:(-N4 v N5 v -P4))));
+-N4 v -P4 v -N2:(-N5 v -N4:(-N5 v -[R1](P2 v [R1](-P1 v -P5 v -N5)) v -[R1](P2 v N1 v -N2)) v -[R1](P3 v [R1](-P5 v -N1 v -P1)));
+P2 v P3 v [R1](N1 v -N1:(P2 v N4:(P3 v -[R1](-N5 v P5 v P3)) v -[R1](-P2 v N5 v N1)) v [R1](P1 v -P3 v N1:(-P5 v N5 v -N2)));
+-N3 v -N5:(-N1 v P1 v N3:(-P5 v -P2 v -[R1](-P1 v [R1](-N3 v P1 v -N1)))) v -N2:(-P5 v [R1](-N1 v -[R1](N1 v -P4 v N3)) v [R1](-P4 v -N3 v -P5));
+P5 v -[R1](P2 v -P4 v -[R1](N1 v N3:(-N4 v -N3:(-N5 v -N1 v P4)) v -N2:(P2 v P4 v -P3))) v -[R1](P4 v N1:(P1 v P4 v -N5:(-P4 v -P5 v N3)) v N1:(N2 v -N4 v P2));
+N3 v [R1](-N3 v -[R1](P3 v N5 v -N1:(N2 v N4 v -N3:(N5 v P3 v -P2))) v N2:(P5 v P3 v -N5:(N3 v -N2 v -N1))) v -[R1](-N5 v N1 v -N2:(N3 v -N5:(-N1 v N2 v N3)));
+P4 v -[R1](N3 v -N4 v [R1](P3 v -N5:(P5 v N3:(P3 v -P4 v -P2)) v N5:(-P2 v -P4 v -N2))) v N5:(-P5 v -P2 v -[R1](-P2 v P4 v -N5:(-N1 v -P3 v P2)));
+-N4 v N1 v -N1:(-P2 v -N4:(-P3 v N1 v -[R1](N4 v -N1 v -[R1](P4 v N4 v -N5))) v -[R1](-N1 v -[R1](-P4 v N4 v N5)));
+P1 v P3 v -[R1](P1 v -N5:(N3 v -[R1](P1 v P4 v -N2:(-N1 v -N4 v -N3)) v -N1:(-P3 v -P5 v -P4)) v -[R1](-N5 v N1:(N5 v -P2 v -P5)));
+-P2 v N5 v N2:(N4 v -P5 v -[R1](-N5 v P5 v [R1](P4 v -N3:(P2 v -P5 v P4))));
+N4 v P1 v [R1](N4 v [R1](-P1 v -N4:(-N5 v -N4:(-P1 v -N3 v -P5)) v N1:(P2 v P3 v N4)) v -N3:(-P5 v N4 v N2:(-P3 v -N5 v -P2)));
+P1 v N4 v N3:(N5 v -P2 v -N3:(P5 v P4 v -[R1](-N4 v -[R1](-P2 v P1 v -N5))))
+end
diff --git a/examples/unsat/test40.frm b/examples/unsat/test40.frm
new file mode 100644
--- /dev/null
+++ b/examples/unsat/test40.frm
@@ -0,0 +1,102 @@
+begin
+-N2 v -N4:(-P5 v -[R1](P5 v P4 v -[R1](N2 v P1 v -N3:(P4 v N1 v N2))) v [R1](N2 v -P1 v N5:(-P5 v -P1 v N3))) v -[R1](-N3 v -N2 v -N2:(P2 v -[R1](N2 v -N3 v N5)));
+-P5 v [R1](-N4 v -N5:(P4 v -[R1](-P4 v -N2:(P3 v -P2 v P5)) v -N5:(P2 v -N4 v -N2)) v -N2:(-N3 v [R1](-P4 v -N3 v N1))) v -[R1](-N5 v N3 v -N1:(-N4 v -N2 v N5:(-N1 v -N2 v -P5)));
+-N2 v -N4:(-N1 v N2 v N4:(P5 v N5 v [R1](-P3 v -[R1](-N4 v N1 v N5)))) v -N2:(-N3 v [R1](-N5 v -P1 v [R1](P2 v N5 v P1)) v -[R1](P4 v -N4 v -N2));
+P4 v N1 v [R1](-P5 v [R1](P1 v -P2 v -N1:(N3 v N4:(-P5 v -N2 v N1))) v -N3:(N2 v -N1:(N4 v -N3 v -N5)));
+-N5 v -N4:(N3 v P5 v [R1](N4 v N1 v -[R1](N2 v -N1 v N4:(-N3 v N1 v -P5)))) v -[R1](-P2 v -P3 v -N5:(-P5 v [R1](-P5 v -P3 v -N4)));
+-P5 v -P4 v -N1:(-P5 v -N3:(-N4 v [R1](P2 v N1 v -[R1](N4 v -N5 v N3)) v [R1](-P4 v P1 v N3)) v [R1](N2 v -[R1](-N2 v -N5 v P2)));
+-P3 v -[R1](-P1 v -P5 v -[R1](P2 v P4 v -N2:(-P3 v N4 v N5:(N2 v P1 v -N3)))) v -[R1](-N2 v P4 v N1:(-N5 v -P4 v -N1:(-N4 v N5 v -P3)));
+-P3 v -P2 v -N3:(-N1 v -P3 v -[R1](P5 v -N3 v [R1](-P2 v -N4:(N3 v P1 v N2))));
+N4 v -P4 v -[R1](-P1 v P5 v -[R1](-N1 v -N3:(-P4 v -N2 v -N1:(P4 v -N5 v N3)) v -N3:(P1 v N1 v -N2)));
+-N2 v -N3 v N5:(N2 v [R1](-N3 v -N5 v -N3:(-P5 v [R1](-N5 v -P2 v P5))) v N3:(N1 v -N5 v -[R1](N2 v -N4 v -P2)));
+-N4 v N1 v -[R1](-P1 v N4 v -N5:(-N1 v N1:(P5 v N4 v [R1](N1 v -P3 v N5)) v -[R1](-P4 v P5 v N1)));
+-P2 v -[R1](P1 v -[R1](P5 v -N4:(P4 v -P1 v -N1:(-P5 v -P4 v P3)) v N2:(-P5 v N1 v P2)) v -N1:(-P3 v -P2 v -N1:(-P4 v N5 v N3))) v [R1](N5 v N2:(N5 v N4 v -N4:(N5 v N2 v N3)) v N2:(-P4 v -P5 v P1));
+N4 v P4 v N1:(N3 v N2:(-P3 v [R1](-P3 v [R1](-N1 v -P5 v N3)) v -[R1](-P4 v P5 v -N1)) v -[R1](-N1 v -N5 v [R1](P4 v N3 v N5)));
+N1 v -P5 v [R1](-P1 v -P4 v [R1](-N3 v -N5 v N5:(-N3 v N3:(-N4 v P2 v -N1))));
+P2 v -N1:(-P2 v N5 v -[R1](-N1 v -[R1](P5 v P3 v -N1:(N2 v N5 v N4)) v N2:(N4 v P1 v N5))) v [R1](P2 v -N3:(-N4 v -P5 v -[R1](N1 v -N5 v N2)) v [R1](-P1 v P3 v -P4));
+-N5 v N4 v -N3:(-P4 v -N4 v N3:(N5 v N2 v [R1](-P4 v -[R1](N4 v -N3 v -N2))));
+-P2 v -N1 v -[R1](P4 v -P5 v -N3:(P5 v -N2 v N2:(-N5 v -N4 v [R1](N3 v -P1 v -N2))));
+N1 v -[R1](P5 v -[R1](N3 v -P4 v N1:(N3 v N3:(-P2 v N2 v N5))) v N1:(-N4 v N4:(P3 v -P2 v -N1))) v N2:(N5 v [R1](-P5 v -N5:(-P5 v N3 v P3)) v -N5:(-N1 v N4 v -N3));
+-P3 v -N2:(-N4 v N3 v N3:(-P3 v [R1](-N1 v -[R1](N3 v P1 v -N2)) v [R1](-P3 v N4 v N2))) v -[R1](P1 v N1:(-N2 v P5 v [R1](-N2 v N4 v N5)) v -[R1](N2 v N3 v N5));
+N3 v -[R1](-P3 v -[R1](P4 v -P3 v N5:(-P1 v -N3 v -N1:(P5 v P4 v -P1))) v N2:(P5 v -N2:(-N5 v -N4 v -P5))) v N1:(P4 v N2 v [R1](-N1 v N2:(-N3 v -P4 v -N4)));
+-N4 v N3 v N5:(P1 v N2:(-N4 v [R1](N5 v -P3 v [R1](-P1 v N3 v N2)) v -[R1](-N1 v N2 v -P4)) v [R1](-P4 v [R1](-P2 v -P1 v -P4)));
+P1 v P3 v N2:(N1 v -[R1](P2 v N3:(N2 v [R1](P3 v N4 v -N1)) v -[R1](-P3 v N5 v -N3)) v [R1](-P2 v -N4:(-P3 v -N1 v -P4)));
+N5 v -N3 v -[R1](P4 v [R1](N1 v -N1:(-N4 v P5 v N2:(N3 v -P3 v -N4)) v -N5:(P5 v -P1 v -N3)) v -N5:(N2 v -N5:(-N4 v -P2 v N2)));
+-N1 v -N4 v -[R1](N4 v P1 v -N3:(-N1 v -N5 v N3:(P4 v [R1](N2 v P2 v -N1))));
+-P3 v -[R1](N5 v N1:(-N4 v P2 v -[R1](-P5 v N4 v N2:(P3 v N5 v -N3))) v [R1](-N5 v N1:(P4 v -N5 v -N2))) v -N2:(-P5 v N3 v -[R1](-N4 v -N2 v N2:(-N5 v -P4 v -N1)));
+P3 v -N3 v N3:(-N2 v P2 v N2:(-P2 v -N3 v [R1](-P2 v [R1](P2 v -P5 v N4))));
+P3 v [R1](N5 v -N2 v -N4:(N2 v -N4:(P5 v -P4 v -[R1](P1 v -P4 v -P3)) v [R1](-N5 v -N1 v N4))) v -N5:(P3 v -P1 v [R1](-N5 v -N3:(-N5 v -P1 v -P3)));
+N2 v -N2:(P2 v P1 v -[R1](-P5 v -N5:(-N2 v [R1](-P4 v -P3 v -P2)) v [R1](N1 v -N3 v -N5))) v -[R1](-P5 v N3:(-N4 v -P3 v -[R1](N5 v -P3 v -N2)) v [R1](-N4 v -P1 v N3));
+P5 v N1:(N2 v -P2 v N5:(-N3 v N1 v -[R1](N4 v P1 v [R1](P2 v -P5 v P3)))) v -N2:(N1 v -[R1](N5 v P2 v [R1](-N2 v -P2 v -P1)) v -[R1](N3 v P4 v N1));
+P2 v -P5 v -N4:(-N2 v -N2:(-N4 v -[R1](P5 v N1 v -[R1](N4 v -N5 v -N2)) v [R1](-P1 v N3 v N1)) v [R1](P4 v [R1](N4 v N5 v N3)));
+-P1 v N2:(-N4 v -[R1](-N2 v -[R1](-P4 v -P3 v -N5:(-P2 v N2 v -P3)) v N4:(N3 v -P5 v -N1)) v [R1](-P5 v N5:(-P2 v -N2 v -N3))) v -[R1](P5 v N4 v -N2:(-N4 v [R1](-N1 v N2 v -N3)));
+-P2 v -N4:(P4 v N5 v N4:(P1 v -[R1](-P4 v [R1](-P4 v P5 v -P3)) v [R1](N2 v -P1 v N3))) v N5:(-P2 v [R1](N5 v -[R1](P3 v N4 v N1)) v -[R1](N4 v -N5 v -N3));
+P3 v [R1](P1 v -[R1](-P1 v -P3 v -N4:(-N2 v P4 v N1:(N5 v -N4 v P4))) v -N4:(-P1 v -P2 v N1:(-P3 v N3 v -P4))) v -N1:(N5 v N5:(-P2 v -[R1](-P3 v -P2 v -N1)) v [R1](-N5 v -N1 v N2));
+-N1 v -N2:(P3 v -N5:(P2 v -[R1](P3 v N4 v -[R1](-N2 v P3 v P1)) v [R1](-N4 v -N5 v -P1)) v -[R1](P5 v P3 v [R1](N1 v -N3 v N4))) v -N2:(N4 v P4 v -[R1](N3 v [R1](-P5 v P2 v -N1)));
+-N2 v P1 v [R1](P2 v -N3:(-P2 v N4:(-P5 v N5 v [R1](P2 v -N2 v N5)) v -[R1](N1 v -N4 v P1)) v N2:(-P1 v [R1](P2 v P5 v P1)));
+-N1 v N3:(P1 v N4:(-P5 v -P4 v [R1](P3 v -[R1](P4 v -N5 v P2))) v [R1](-P2 v [R1](N3 v N4 v P2))) v -[R1](P1 v [R1](P1 v -P4 v -N3:(-N4 v P2 v -N2)) v -N4:(-P4 v -P1 v -P5));
+P1 v P4 v [R1](N4 v P3 v [R1](-N1 v N2:(P2 v N5 v -N2:(N1 v P4 v P3)) v -N4:(-P5 v N5 v P2)));
+N5 v [R1](N1 v [R1](N4 v N1 v -N1:(P3 v N3 v -N5:(-N2 v -P4 v -P3))) v N5:(-P1 v -N4:(N5 v -N3 v -P4))) v -[R1](-P5 v P1 v N5:(-P3 v -P1 v N4:(P2 v -P1 v N3)));
+P2 v -N2:(P2 v N5 v [R1](N2 v N2:(-P1 v N4 v [R1](-N2 v N4 v -P1)) v [R1](-N3 v -P2 v -P4))) v -N3:(P4 v P2 v -[R1](-P2 v N5 v [R1](-P4 v -N4 v -N3)));
+N3 v [R1](-N1 v [R1](N2 v -N4 v -N5:(P2 v N4 v -N2:(P2 v P1 v N1))) v N1:(P4 v -N3 v N2:(-N5 v N3 v -P3))) v -N5:(-N4 v N1:(P3 v -N3 v -[R1](P5 v -P3 v -P2)) v [R1](N5 v P5 v -P4));
+-N4 v N2:(-P3 v -N5 v N2:(P1 v -P5 v -[R1](-P4 v -P3 v -[R1](N3 v -N2 v -N4)))) v N2:(-P5 v -N3 v [R1](-P1 v -[R1](N4 v -P1 v -N1)));
+-N2 v -[R1](P3 v -P1 v -N1:(-N4 v N4:(-N2 v -[R1](P3 v -P2 v -P1)) v -[R1](-P1 v -P2 v -N3))) v [R1](-P3 v N2:(-N3 v -P4 v -N5:(N3 v -P5 v N1)) v N4:(P1 v -P4 v -P3));
+N2 v -P4 v N5:(-N1 v N1:(-P2 v P5 v -[R1](N2 v -[R1](N5 v -N2 v N1))) v -[R1](-P5 v -P1 v -[R1](N5 v P5 v N3)));
+N4 v P4 v -N2:(-N5 v N3 v [R1](N1 v -N3:(-P2 v [R1](-N2 v N4 v -P4)) v [R1](-N1 v -N5 v -P5)));
+-P2 v -[R1](P1 v N4 v [R1](P1 v -N5 v -N2:(P2 v P4 v N3:(N5 v N2 v -P3)))) v -N3:(P2 v N1 v -N5:(N3 v -N4 v -[R1](N5 v -P3 v -P1)));
+P2 v N2 v [R1](-P5 v P4 v N1:(P3 v -N5 v [R1](N2 v P2 v N3:(-P5 v -P3 v P4))));
+-P4 v -P1 v [R1](N2 v -N2:(-N3 v N5 v -[R1](P5 v N1:(N5 v -N2 v -N4))) v [R1](N2 v N1:(-P5 v -P3 v P2)));
+-P3 v -N1:(N2 v [R1](-P3 v -N2 v [R1](-N2 v -N1 v N3:(P2 v P4 v P1))) v -N5:(-N3 v [R1](-N2 v N5 v -N1))) v N5:(P1 v -[R1](P5 v [R1](P5 v -P1 v -P3)) v -[R1](P5 v -N4 v -N1));
+P1 v P4 v [R1](-P5 v -P3 v -N1:(-P3 v -P1 v [R1](P5 v -N4:(N3 v N5 v -P5))));
+N3 v P3 v -[R1](P2 v [R1](-P2 v N2:(-N3 v P1 v N5:(P5 v N1 v P2)) v -N1:(-P5 v P3 v N5)) v N4:(N1 v -N5:(N3 v P5 v N4)));
+P5 v -P4 v N3:(-N4 v -N5 v -N2:(N3 v [R1](-N2 v P2 v -[R1](P3 v -P1 v -N5)) v -[R1](P3 v P1 v -P4)));
+N4 v -N3 v [R1](P5 v -N4 v [R1](P2 v N1:(-P2 v -N4 v -N3:(P5 v -P2 v N5)) v N4:(-N3 v -P1 v -P3)));
+-N5 v N4:(-N2 v -N1 v [R1](N1 v N4 v [R1](N4 v N3 v N3:(N1 v P3 v N2)))) v [R1](-N1 v -N4:(-N1 v -N3 v -[R1](P5 v P3 v -P1)) v -[R1](P2 v -P4 v P5));
+P3 v N3:(-P3 v -N4 v [R1](N5 v -[R1](P5 v P2 v N1:(N3 v -N5 v -N2)) v -N1:(N3 v N2 v -N5))) v -[R1](N4 v -[R1](-N3 v -N3:(-N2 v N4 v N1)) v -N2:(N3 v -N5 v -P1));
+-N4 v P2 v [R1](N4 v -[R1](-N2 v P4 v -N3:(P2 v -N5 v N4:(-P1 v P3 v N1))) v -N1:(N2 v N3:(-P1 v -P3 v N1)));
+-P1 v P5 v -[R1](P4 v -P3 v [R1](-N5 v P1 v N4:(-P5 v N2 v -N4:(-P2 v -P4 v P5))));
+P4 v -[R1](P3 v -N5:(P2 v -N5:(-N1 v -[R1](-N3 v -P2 v N5)) v [R1](N2 v N5 v P2)) v [R1](N5 v N1 v -N1:(-N5 v P5 v -P1))) v N3:(N1 v -N5 v [R1](N2 v P3 v N5:(N3 v P1 v P3)));
+N5 v P5 v [R1](-P2 v [R1](P2 v -N4:(P1 v -N3:(-N4 v N2 v -P1)) v N2:(-N4 v N5 v -N3)) v -N5:(N3 v N4 v N5:(-N2 v -N3 v -N4)));
+-N5 v N3 v N3:(N2 v [R1](N5 v -N1:(N3 v -P1 v -[R1](P1 v N3 v P3)) v [R1](-P5 v -P1 v P3)) v -[R1](P5 v -N4:(-N3 v -N1 v -N5)));
+P1 v -N4:(-N3 v -P5 v -[R1](-P4 v -N4:(-P5 v -[R1](N2 v -N3 v N1)) v -[R1](-N5 v -N1 v N4))) v N3:(P5 v -[R1](N2 v [R1](-P1 v -N1 v -N3)) v -[R1](P4 v -P5 v -N4));
+P4 v -P1 v -N1:(-N2 v P1 v [R1](-P4 v N3:(-P2 v -P1 v -[R1](P2 v -P4 v -N1)) v -[R1](-P4 v N1 v N5)));
+-P5 v N1:(-P2 v P3 v -N2:(-P3 v [R1](N5 v [R1](-P5 v P4 v -N3)) v [R1](-P4 v -N1 v N2))) v -N3:(P5 v P1 v [R1](N2 v [R1](-P5 v P2 v -N2)));
+N5 v N4:(-P5 v N2:(P5 v -N3 v [R1](-P5 v [R1](-N2 v P3 v P5))) v -[R1](-N2 v [R1](-N2 v P5 v -P2))) v [R1](-N4 v P5 v [R1](P2 v N4 v -N5:(-N3 v N1 v P3)));
+N1 v -N3:(-P1 v N1:(P4 v -N5 v [R1](-P1 v -[R1](-P2 v -P4 v N4))) v -[R1](N3 v -P4 v -[R1](-N2 v -P2 v -N1))) v [R1](-P4 v -N1 v N4:(-N2 v -N5 v -[R1](-P2 v N4 v -P1)));
+P5 v P3 v N1:(-N3 v P4 v -N2:(P2 v -[R1](-P1 v -[R1](-P1 v -N4 v -N3)) v -[R1](-P2 v -P3 v P1)));
+-P1 v N5:(N3 v -P2 v [R1](N4 v N2 v N5:(N4 v -[R1](-P1 v N1 v -P5)))) v -N3:(-N5 v [R1](P2 v -P3 v [R1](-P4 v N1 v P2)) v -[R1](P1 v -N1 v N4));
+P5 v N5 v [R1](-N4 v -N5 v N4:(N2 v -[R1](N2 v N4 v N5:(-P1 v -P5 v P3)) v -N5:(-P5 v N3 v P1)));
+N1 v -N4:(-P3 v N1:(P2 v -P1 v [R1](N3 v -[R1](N2 v -P4 v N4))) v [R1](-N5 v P3 v -[R1](-P3 v -P5 v P1))) v -[R1](-N5 v -N3 v N2:(N5 v -P4 v [R1](-N1 v -N2 v -P1)));
+N2 v -N3 v -[R1](N2 v -[R1](-N4 v N3:(P1 v N2:(N1 v -P3 v P1)) v -N3:(-N4 v P3 v N1)) v -N5:(N4 v N3 v -N3:(N2 v N5 v -N4)));
+N4 v -P1 v -N4:(-N5 v -N3:(N4 v -[R1](-N5 v -[R1](-P2 v -N3 v N2)) v -[R1](P4 v P2 v N3)) v -[R1](-N3 v -P2 v -[R1](N1 v P4 v -P1)));
+-P3 v [R1](-P3 v -[R1](N3 v -P3 v -N1:(P1 v N5:(-P3 v -N1 v -N4))) v -N3:(-P5 v -P2 v N5:(P5 v -P1 v -P4))) v -N1:(-N5 v -P1 v -[R1](N5 v N2 v N3:(N5 v P2 v P4)));
+P2 v -N3:(-N4 v -P5 v N4:(P2 v N2 v [R1](-P4 v P2 v [R1](P4 v -N3 v -N2)))) v -N5:(-N4 v -N1 v [R1](-N3 v -N4 v -[R1](N5 v -P4 v -N3)));
+N5 v -N1 v [R1](-N5 v [R1](-P3 v -N2:(N3 v -N5:(P5 v -P3 v -N4)) v -N5:(P5 v -N4 v -N2)) v -N4:(P2 v -N1 v N5:(P3 v N2 v N4)));
+-N1 v N4 v N1:(N4 v N5:(-P3 v -[R1](P5 v N1 v -[R1](N3 v P1 v N1)) v [R1](-N1 v P3 v -P5)) v -[R1](P5 v N4 v [R1](-N4 v -P3 v -P5)));
+-N4 v -[R1](-P5 v P4 v N2:(-N4 v -P5 v [R1](N3 v -N4:(-N5 v -N3 v P1)))) v N2:(-N1 v -N5:(P2 v -[R1](-N5 v -N4 v N3)) v [R1](N5 v -P3 v P1));
+N3 v [R1](P3 v -P5 v -N5:(-P1 v -N2 v N1:(P3 v N3 v [R1](P4 v -P1 v -N2)))) v [R1](-N4 v -N5:(N2 v -N5:(-N3 v N2 v -P4)) v N2:(-N1 v -N3 v P3));
+N1 v N1:(P1 v -[R1](-N4 v -P1 v N5:(-N2 v [R1](-P2 v -N3 v P3))) v N5:(-N1 v [R1](N4 v N3 v -P3))) v [R1](-N5 v -N5:(P3 v N4 v -[R1](-N5 v N2 v N4)) v -[R1](N4 v P1 v -P2));
+P5 v -N5 v -[R1](N1 v P5 v N4:(-N3 v N3:(P2 v -[R1](P5 v -P1 v P2)) v -[R1](P3 v -P5 v P1)));
+N4 v P4 v -N3:(N1 v N2 v [R1](P4 v -N2 v -[R1](-N1 v N1:(P2 v N4 v -N3))));
+-P3 v N5 v [R1](P2 v [R1](-N3 v -P3 v N3:(-P5 v -N5:(-N1 v N3 v -P2))) v -N5:(P2 v -P1 v -N1:(P4 v -N4 v P3)));
+N5 v -N1 v N5:(P1 v -N2 v -[R1](P3 v N4:(-P1 v -[R1](N5 v P3 v N3)) v [R1](-N3 v -P1 v -P2)));
+P5 v N2 v -[R1](-P3 v [R1](N1 v -P3 v -N5:(-P2 v -N5:(-P4 v -P3 v N4))) v N1:(-N3 v -N2:(-N3 v -N5 v P1)));
+-N1 v -[R1](N2 v -N3 v -N1:(-P3 v -P1 v N1:(-P4 v -P5 v [R1](N3 v P2 v P5)))) v N3:(P1 v -N5:(-P1 v -P4 v -[R1](-N3 v P1 v -P4)) v -[R1](N5 v N4 v N1));
+P1 v N3:(-P2 v -N1:(-N2 v -[R1](-N3 v -P3 v -[R1](-N1 v N4 v N2)) v [R1](N2 v -P4 v N1)) v -[R1](P5 v -[R1](-P4 v -P3 v -N1))) v -N4:(P1 v [R1](-N4 v N2 v -[R1](-P3 v N5 v -N1)) v [R1](N5 v N2 v N4));
+N3 v P2 v [R1](-P2 v -[R1](P1 v -P2 v N4:(-N1 v P3 v N4:(-N2 v P1 v -N1))) v N1:(-P1 v N5:(-P4 v P3 v -P2)));
+-P5 v -N4 v -N3:(P1 v -N5 v -N2:(-N1 v -[R1](-P3 v -[R1](-P3 v -P5 v -P4)) v [R1](P5 v P1 v N1)));
+-N2 v N1:(-P2 v [R1](-N5 v -N3:(N1 v -P5 v -[R1](P2 v P5 v -P3)) v -[R1](N2 v N3 v P5)) v -N3:(N1 v -[R1](N5 v -N2 v P5))) v N4:(-P5 v [R1](P4 v [R1](-N4 v -P3 v P5)) v [R1](-P1 v P3 v P5));
+P5 v -N5 v [R1](-N4 v -P5 v -N1:(N4 v [R1](-P5 v -P4 v N4:(P5 v P4 v N1)) v N5:(P3 v P5 v -P2)));
+P1 v -P3 v -[R1](P1 v [R1](P3 v N2 v -N4:(-P5 v P4 v -N4:(P2 v -P4 v -P1))) v N3:(-N1 v N4:(P2 v -P3 v P1)));
+P1 v N2 v -[R1](P4 v -P2 v -[R1](-N2 v N5 v N4:(P4 v -N2:(-P3 v -N3 v N5))));
+-P3 v -N2:(N1 v [R1](N1 v [R1](N1 v -P2 v -N1:(P5 v -N5 v N4)) v -N2:(P4 v -N4 v -N1)) v [R1](-P5 v N3:(N1 v -P1 v -N2))) v -[R1](-N2 v -N4:(-N2 v N3 v [R1](-N1 v P3 v P1)) v [R1](-P1 v -N3 v -P4));
+N2 v P1 v N4:(N3 v -[R1](P3 v P5 v N1:(P2 v -P4 v -[R1](P1 v -P2 v N3))) v [R1](N4 v -N2 v N1:(P4 v N4 v P2)));
+-P2 v N4 v [R1](-P1 v N2:(-N5 v N4:(N5 v -[R1](-P2 v N3 v P1)) v -[R1](N2 v -N4 v P5)) v -N3:(-N2 v -N4 v -[R1](N1 v -P2 v N5)));
+-N5 v N5:(-P3 v [R1](-P4 v -N4:(-N2 v -[R1](-N4 v N1 v -P4)) v -[R1](N4 v -N1 v -N2)) v -[R1](N1 v -P3 v N1:(P3 v -P1 v -P4))) v -[R1](P3 v -[R1](-N3 v -N1:(P1 v P4 v -N3)) v -N5:(-P3 v P2 v N4));
+N2 v -P1 v -N4:(-N1 v P3 v [R1](-N5 v [R1](-N3 v -N5:(P1 v -P2 v -P5)) v -N4:(-P2 v -P1 v -P5)));
+N2 v P5 v [R1](N3 v -[R1](-N4 v N1 v N1:(N5 v P5 v N1:(N5 v N4 v -P4))) v N2:(N4 v -N2:(P1 v -N5 v -P5)));
+-P1 v N4:(-P4 v P3 v -N1:(N5 v -P3 v -[R1](-P4 v P2 v [R1](P3 v -N4 v N2)))) v [R1](-N1 v N3 v -N4:(-P1 v [R1](-P5 v -N1 v -N5)));
+N5 v [R1](P5 v N4 v -[R1](N4 v -N3:(-N4 v -N5:(-N4 v N2 v -N1)) v N4:(-P2 v N2 v N1))) v -N1:(-P1 v -[R1](-P1 v -N1:(P1 v -P5 v P4)) v -N1:(-P5 v N4 v -P4));
+N1 v N4 v N1:(P5 v N2:(P5 v [R1](P1 v [R1](-N1 v -N2 v N5)) v [R1](-P5 v N4 v -P1)) v -[R1](N4 v [R1](N4 v -N2 v P5)));
+-N4 v N2 v -N2:(N4 v -N3 v -[R1](-P2 v -N1 v -N3:(-P1 v [R1](P1 v N1 v N3))))
+end
diff --git a/src/HTab/Branch.hs b/src/HTab/Branch.hs
--- a/src/HTab/Branch.hs
+++ b/src/HTab/Branch.hs
@@ -1,77 +1,67 @@
 module HTab.Branch
 (
-Branch(..), BranchInfo(..), TodoList(..), BlockingMode(..),
-createNewPref, createNewProp, createNewNomTestRelevance,
+Branch(..), BranchInfo(..), TodoList(..),
+createNewNode, createNewNom,
 addFormulas, addAccFormula,
 addToBlockedDias,
-addDiaRuleCheck, addDownRuleCheck, addDiffRuleCheck,
-addParentPrefix, addFirstFormulas,
-emptyBranch,
+addDiaRuleCheck, addDownRuleCheck,
+initialBranch,
 reduceDisjunctionProposeLazy, doLazyBranching,
 merge,
 getUrfather, getUrfatherAndDeps,
-getModelRepresentative, isNotBlocked,
+getModelRepresentative, patternBlocked,
 diaAlreadyDone, downAlreadyDone,
 ReducedDisjunct(..),
 patternOf, findByPattern,
-prefixes, isInTheModel, relationIsInTheModel,
-isSymmetric, isTransitive
+prefixes, isInTheModel,
+isTransitive
 ) where
 
 import Control.Applicative ( (<$>) )
-import Data.List(minimumBy)
-import Data.Maybe( mapMaybe, fromMaybe )
-import Data.Ord ( comparing )
+import Data.Maybe( mapMaybe )
 
 import Data.Map ( Map )
 import qualified Data.Map as Map
 import Data.Set ( Set )
 import qualified Data.Set as Set
 import Data.IntMap ( IntMap)
-import qualified Data.IntMap as IntMap
+import qualified Data.IntMap as I
 
+import HTab.DMap ( DMap )
+import qualified HTab.DMap as D
 import qualified HTab.DisjSet as DS
-
 import HTab.CommandLine(Params(..))
-
 import HTab.Formula
-
-import HTab.DMap ( DMap(..), toMap )
-import qualified HTab.DMap as DMap
-
-import HTab.Relations ( Relations(..), emptyRels, insertRelation, mergePrefixes,
-                        successors, predecessors, linksFromTo )
+import HTab.Relations ( OutRels, emptyRels, insertRelation, mergePrefixes,
+                        successors, linksFromTo, showRels )
+import HTab.Literals ( UpdateResult(..), Literals,
+                       SlotUpdateResult(..), LiteralSlot,
+                       updateMap, lsUnions, lsAddDeps, lsQuery)
 
 data BranchInfo = BranchOK Branch |
                   BranchClash Branch Prefix DependencySet Formula
 
-type ClashableInfo      = DMap {- Prefix Literal -} DependencySet
 type BoxConstraints     = DMap {- Prefix Rel -} [(Formula,DependencySet)]
 type BranchingWitnesses = DMap {- Prefix Literal -} [PrFormula]
 type EquivClasses = DS.DisjSet DS.Pointer
-data BlockingMode = PatternBlocking | AnywhereBlocking | ChainTwinBlocking  deriving (Eq,Show)
 
 data Branch =
               Branch {
                  -- the premodel
-                      clashStr :: ClashableInfo,
-                        accStr :: Relations,
+                      literals :: Literals,
+                        accStr :: OutRels,
+                 -- local and global constraints
+                        boxFwd :: BoxConstraints,
+                      univCons :: [(DependencySet,Formula)],
                  -- pending formulas / todo lists
                       todoList :: TodoList,
-                 -- immediate rules constraints
-                  boxConstrFwd :: BoxConstraints,
-                  boxConstrBwd :: BoxConstraints,
-                      univCons :: [(DependencySet,Formula)],
                  -- saturation of rules
                        diaRlCh :: IntMap {- Prefix -} (Set (Rel,Formula)),
                       downRlCh :: IntMap {- Prefix -} (Set Formula),
-                        atRlCh :: Set Formula,
+                        atRlCh :: Set (Nom,Formula),
                      existRlCh :: Set Formula,
-                      dDiaRlCh :: Map Formula (Maybe Prop),
                  -- pattern blocking
-             individualPattern :: IntMap (Set Formula),
-                 -- set of formulas true at each point of the premodel
-                   prefToForms :: IntMap {- Prefix -} (Set Formula),
+                      patterns :: IntMap (Set Formula),
                  -- backjumping data attached to equivalence classes
                     prToDepSet :: IntMap {- Prefix -} DependencySet,
                  -- prefix/nominal equivalence classes
@@ -79,102 +69,52 @@
                  -- book keeping
                       lastPref :: Prefix,
                        nextNom :: Nom,
-                      nextProp :: Prop,
                  -- lazy branching
                    brWitnesses :: BranchingWitnesses,
-                 -- caching / memoisation data
-             downVarRelevantCh :: Map Formula Bool,
                  -- information about language of input formula and blocking mode
                  inputLanguage :: LanguageInfo,
-                     blockMode :: BlockingMode,
-             unblockedPrefsLim :: Prefix,
                    blockedDias :: IntMap {- Prefix -} [PrFormula],
-                    prefParent :: IntMap {- Prefix -} Prefix,
-              relevantNominals :: Set Nom,
                        relInfo :: RelInfo,
                       encoding :: Encoding}
 
 --
 
-emptyBranch :: LanguageInfo -> RelInfo -> Encoding -> Params -> Branch
-emptyBranch fLang relInfo_ encoding_ p =
-                Branch
-                { clashStr          = DMap.empty,
-                  accStr            = emptyRels,
-                  todoList          = emptyTodoList,
-                  boxConstrBwd      = DMap.empty,
-                  boxConstrFwd      = DMap.empty,
-                  diaRlCh           = IntMap.empty,
-                  downRlCh          = IntMap.empty,
-                  atRlCh            = Set.empty,
-                  existRlCh         = Set.empty,
-                  dDiaRlCh          = Map.empty,
-                  downVarRelevantCh = Map.empty,
-                  individualPattern = IntMap.empty,
-                  univCons          = [],
-                  lastPref          = 0,
-                  nextNom           = maxNom encoding_ + 4,
-                  nextProp          = maxProp encoding_ + 4,
-                  prefToForms       = IntMap.empty,
-                  prToDepSet        = IntMap.empty,
-                  brWitnesses       = DMap.empty,
-                  nomPrefClasses    = DS.mkDSet,
-                  inputLanguage     = fLang,
-                  blockMode         = blockingMode,
-                  unblockedPrefsLim = 0,
-                  blockedDias       = IntMap.empty,
-                  prefParent        = IntMap.empty,
-                  relevantNominals  = set $ relevantNoms fLang,
-                  relInfo           = relInfo_,
-                  encoding          = encoding_
-                }
- where blockingMode
-        | languagePast fLang || relInfo_ `oneIs` Symmetric = ChainTwinBlocking
-        | patternBlocking p = PatternBlocking
-        | otherwise         = AnywhereBlocking
-
 instance Show Branch where
- show br
-  = concat [  show (inputLanguage br),
-              "\nClashable formulas:", showIMap (\v -> "(" ++ showMap_lits v ++ ")") "\n " (toMap $ clashStr br),
-              "\n", show (todoList br),
-              "\nRelations: ", show (accStr br),
-              "\nBox fwd: ", showIMap (\v -> "(" ++ showMap_rel v ++ ")") "\n " (toMap $ boxConstrFwd br),
-              "\nBox bwd: ", showIMap (\v -> "(" ++ showMap_rel v ++ ")") "\n " (toMap $ boxConstrBwd br),
-              "\nWitnesses: ", showIMap (\v  -> "(" ++ showMap_lits2 v ++ ")") "\n " (toMap $ brWitnesses br),
-              "\nDia rule chart: ", show (diaRlCh br),
-              "\nIndividual patterns: ", show (individualPattern br),
-              "\nDown rule chart: ", show (downRlCh br),
-              "\n@ rule chart: ", show (list $ atRlCh br),
-              "\nExist rule chart: ", show (list $ existRlCh br),
-              "\nDiff dia rule chart: ", show (dDiaRlCh br),
-              "\nDown var relevant chart: ", show (downVarRelevantCh br),
-              "\nUniv constraints: ", show (univCons br),
-              "\nPrefix to dependency set: ", showIMap  dsShow "\n " (prToDepSet br),
-              "\nPrefix to formulas: ", showIMap  (show . Set.toList) "\n " (prefToForms br),
-              "\nParent: ", show (prefParent br),
-              "\nBlocking mode: ", show (blockMode br),
-              "\nPrefix-Nominal classes : ", showMap ", " (nomPrefClasses br),
-              "\nModel-relevant nominals : ", unwords $ map showLit $ list $ relevantNominals br,
-              "\nlastPref : ", show (lastPref br),
-              " nextnom : ", showLit (nextNom br),
-              " nextprop : ", showLit (nextProp br)
-           ]
-              where
-               showIMap :: (a -> String) -> String -> IntMap a -> String
-               showIMap vShow sep = IntMap.foldWithKey (\k v -> (++ sep ++ show k ++ " -> " ++ vShow v )) ""
-               showMap sep        = Map.foldrWithKey (\k v -> (++ sep ++ show k ++ " -> " ++ show v )) ""
-               showMap_lits       = IntMap.foldWithKey (\l d   -> (++ showLit l ++ " " ++ dsShow d  ++ ", ")) ""
-               showMap_lits2      = IntMap.foldWithKey (\l fs  -> (++ showLit l ++ " " ++ ":" ++ show fs ++ ", ")) ""
-               showMap_rel        = IntMap.foldWithKey (\r dxs -> (++ "-" ++ showRel r ++ "-> " ++ show dxs ++ ", ")) ""
+ show br = concat
+  [  show (inputLanguage br),
+     "\nLiterals:", showIMap (\v -> "(" ++ showMap_lits v ++ ")") "\n " (literals br),
+     "\nRelations: ", showRels (accStr br),
+     "\nBoxes: ", showIMap (\v -> "(" ++ showMap_rel v ++ ")") "\n " (boxFwd br),
+     "\n", show (todoList br),
+     "\nWitnesses: ",
+     showIMap (\v -> "(" ++ showMap_lits2 v ++ ")") "\n " (brWitnesses br),
+     "\nDia rule chart: ", show (diaRlCh br),
+     "\nIndividual patterns: ", show (patterns br),
+     "\nDown rule chart: ", show (downRlCh br),
+     "\n@ rule chart: ", show (list $ atRlCh br),
+     "\nExist rule chart: ", show (list $ existRlCh br),
+     "\nUniv constraints: ", show (univCons br),
+     "\nPrefix to dependency set: ", showIMap  dsShow "\n " (prToDepSet br),
+     "\nPrefix-Nominal classes : ", showMap ", " (nomPrefClasses br),
+     "\nlastPref : ", show (lastPref br),
+     " nextnom : ", showLit (nextNom br)
+  ]
+   where
+    showIMap :: (a -> String) -> String -> IntMap a -> String
+    showIMap vShow sep
+     = I.foldWithKey (\k v -> (++ sep ++ show k ++ " -> " ++ vShow v )) ""
+    showMap sep = Map.foldrWithKey (\k v -> (++ sep ++ show k ++ " -> " ++ show v )) ""
+    showMap_lits = I.foldWithKey (\l d -> (++ showLit l ++ " " ++ dsShow d  ++ ", ")) ""
+    showMap_lits2 = I.foldWithKey (\l fs -> (++ showLit l ++ " :" ++ show fs ++ ", ")) ""
+    showMap_rel
+     = I.foldWithKey (\r dxs -> (++ "-" ++ showRel r ++ "-> " ++ show dxs ++ ", ")) ""
 
 data TodoList= TodoList{disjTodo :: Set PrFormula,
                          diaTodo :: Set PrFormula,
                        existTodo :: Set PrFormula,
                           atTodo :: Set PrFormula,
                         downTodo :: Set PrFormula,
-                        diffTodo :: Set PrFormula,
-                       mergeTodo :: Set (DependencySet, Prefix, DS.Pointer),
+                       mergeTodo :: Set (DependencySet, Prefix, Nom),
                      roleIncTodo :: Set (DependencySet, Prefix, Prefix, [Rel]) }
  deriving Show
 
@@ -185,16 +125,10 @@
                  existTodo = Set.empty,
                     atTodo = Set.empty,
                   downTodo = Set.empty,
-                  diffTodo = Set.empty,
                  mergeTodo = Set.empty,
                roleIncTodo = Set.empty
                }
 
-{-
-   "add formula" functions, that handle
-   prefixes and nominals
--}
-
 addFormulas :: Params -> [PrFormula] -> Branch -> BranchInfo
 addFormulas p fs br =
  foldr (\f bi ->
@@ -211,32 +145,33 @@
    $ bookKeepFormula p pf br
 
 bookKeepFormula :: Params -> PrFormula -> Branch -> Branch
-bookKeepFormula p pf_ br
- =   addToPrefToForms         pf
-   $ rescheduleLazyBranching  p pf
+bookKeepFormula p pf_@(PrFormula pr ds f) br
+ =   rescheduleLazyBranching  p pf
    $ rescheduleBlockedDias    ur br
   where
-    (ur,pf) = toUrfather br pf_
+   (ur,ds2,_) = getUrfatherAndDeps br (DS.Prefix pr)
+   pf = if ur == pr then pf_
+         else PrFormula ur (dsUnion ds ds2) f
 
 rescheduleLazyBranching :: Params -> PrFormula -> Branch -> Branch
 rescheduleLazyBranching p (PrFormula pr ds (Lit l)) br   -- pr already urfather
  | lazyBranching p && isProp l
    =
-     let (Just innerMap) = DMap.lookup1 pr (brWitnesses br)
+     let (Just innerMap) = D.lookup1 pr (brWitnesses br)
      in
 
-     case DMap.lookup pr l (brWitnesses br) of
+     case D.lookup pr l (brWitnesses br) of
       Just _
-        -> let innerMap2 = IntMap.delete l innerMap
-               newBrW = DMap.insert1 pr innerMap2 (brWitnesses br)
+        -> let innerMap2 = I.delete l innerMap
+               newBrW = D.insert1 pr innerMap2 (brWitnesses br)
                newBr = br{brWitnesses = newBrW}
            in
             newBr -- forget  the disjunctions, they are really satisfied
       Nothing
-       -> case DMap.lookup pr (negLit l) (brWitnesses br) of
+       -> case D.lookup pr (negLit l) (brWitnesses br) of
            Just fs
-             -> let innerMap2 = IntMap.delete (negLit l) innerMap
-                    newBrW = DMap.insert1 pr innerMap2 (brWitnesses br)
+             -> let innerMap2 = I.delete (negLit l) innerMap
+                    newBrW = D.insert1 pr innerMap2 (brWitnesses br)
                     newBr = br{brWitnesses = newBrW}
                 in
                  foldr addToTodo newBr (map (addDeps ds) fs) --reschedule
@@ -254,22 +189,21 @@
    Dia _ _    -> BranchOK $ addToTodo pf br
    Box r f    -> addBoxConstraint      pr r f ds p br
    A f        -> addUnivConstraint          f ds p br
-   B f        -> bRule                pr   f ds p br
    E _        -> BranchOK $ addToTodo pf br
-   D _        -> BranchOK $ addToTodo pf br
    At _ _     -> BranchOK $ addToTodo pf br
    Down _ _   -> BranchOK $ addToTodo pf br
-   Lit l | isPositiveNom l -> addToClashable pr ds l $ addToTodo pf br
-   Lit l                   -> addToClashable pr ds l br
+   Lit l | isPositiveNom l -> addToLiterals pr ds l $ addToTodo pf br
+   Lit l                   -> addToLiterals pr ds l br
 
 putAwayDisjunction :: Params -> PrFormula -> Branch -> BranchInfo
 putAwayDisjunction p pf@(PrFormula pr ds f@(Dis fs)) br
- | lazyBranching p && blockMode br /= ChainTwinBlocking
+ | lazyBranching p
   = case reduceDisjunctionProposeLazy br pr fs of
      Contradiction dsClash -> BranchClash br pr (dsUnion ds dsClash) f
      Triviality -> BranchOK br
      Reduced new_ds disjuncts mProposed
-      -> let fNew = PrFormula pr (dsUnion ds new_ds) (Dis disjuncts) --todo if there was no reduction, leave ds
+      -> let fNew = PrFormula pr (dsUnion ds new_ds) (Dis disjuncts)
+              -- TODO if there was no reduction, leave ds
          in
           case mProposed of
             Nothing -> BranchOK $ addToTodo fNew br
@@ -284,17 +218,18 @@
 -- assume the tests have been done beforehand, always returns BranchOK
 doLazyBranching :: Prefix -> Literal -> [PrFormula] -> Branch -> BranchInfo
 doLazyBranching pr lit pfs br
- = case DMap.lookup1 pr (brWitnesses br) of
-    Nothing -> let newBrW = DMap.insert pr lit pfs (brWitnesses br)
+ = case D.lookup1 pr (brWitnesses br) of
+    Nothing -> let newBrW = D.insert pr lit pfs (brWitnesses br)
                in BranchOK br{brWitnesses = newBrW}
     Just innerMap
-     -> case IntMap.lookup lit innerMap of -- assume this is the only place where l or (negLit l) occur
-         Nothing -> let newInner = IntMap.insert lit pfs innerMap
-                        newBrW = DMap.insert1 pr newInner (brWitnesses br)
+     -> case I.lookup lit innerMap of
+        -- assume this is the only place where l or (negLit l) occur
+         Nothing -> let newInner = I.insert lit pfs innerMap
+                        newBrW = D.insert1 pr newInner (brWitnesses br)
                     in BranchOK br{brWitnesses = newBrW}
          Just fs -- assume the test was already done
-          -> let newInner = IntMap.insert lit (pfs++fs) innerMap
-                 newBrW = DMap.insert1 pr newInner (brWitnesses br)
+          -> let newInner = I.insert lit (pfs++fs) innerMap
+                 newBrW = D.insert1 pr newInner (brWitnesses br)
              in BranchOK br{brWitnesses = newBrW}
 
 
@@ -316,142 +251,137 @@
          Dis _              -> utodo{ disjTodo = Set.insert pf ( disjTodo utodo)}
          Dia _ _            -> utodo{  diaTodo = Set.insert pf (  diaTodo utodo)}
          E _                -> utodo{existTodo = Set.insert pf (existTodo utodo)}
-         D _                -> utodo{ diffTodo = Set.insert pf ( diffTodo utodo)}
          At _ _             -> utodo{   atTodo = Set.insert pf (   atTodo utodo)}
          Down _ _           -> utodo{ downTodo = Set.insert pf ( downTodo utodo)}
          Lit l
-          | isPositiveNom l -> utodo{mergeTodo = Set.insert (ds,p,DS.Nominal l) (mergeTodo utodo)}
+          | isPositiveNom l -> utodo{mergeTodo = Set.insert (ds,p,l)
+                                                            (mergeTodo utodo)}
          _                  -> error $ "addToTodo: " ++ show f2
    alreadyDone =
     case f2 of
-     E  _               -> existAlreadyDone br f2
-     D _                -> False
-     At _ _             -> atAlreadyDone br f2
+     E  f3              -> Set.member f3 (existRlCh br)
+     At n f3            -> Set.member (n,f3) (atRlCh br)
      Down _ _           -> downAlreadyDone br pf
-     Dia  _ _           -> False -- the test happens later, when the todo list is processed
-     Dis _              -> False -- the test happens later, when the todo list is processed
+     Dia  _ _           -> False -- test happens when the todo list is processed
+     Dis _              -> False -- test happens when the todo list is processed
      Lit l
       | isPositiveNom l -> inSameClass br p l
      _                  -> error $ "alreadyDone: " ++ show f2
    brWithSaturation =
     case f2 of
-     E _         -> br{existRlCh = Set.insert f2 (existRlCh br)}
-     At _ _      -> br{atRlCh    = Set.insert f2 (atRlCh br)}
+     E f3        -> br{existRlCh = Set.insert f3 (existRlCh br)}
+     At n f3     -> br{atRlCh    = Set.insert (n,f3) (atRlCh br)}
      _           -> br
 
 rescheduleBlockedDias :: Prefix -> Branch -> Branch
 rescheduleBlockedDias  pr br
  = foldr addToTodo br2 toAdd
-  where toAdd =  IntMap.findWithDefault [] pr (blockedDias br)
-        br2 = br{blockedDias = IntMap.delete pr $ blockedDias br}
+  where toAdd = get [] pr (blockedDias br)
+        br2 = br{blockedDias = I.delete pr $ blockedDias br}
 
 addToBlockedDias :: PrFormula -> Branch -> BranchInfo
 addToBlockedDias f@(PrFormula pr _ _) br
- = BranchOK br{blockedDias = IntMap.insertWith (++) ur [f] (blockedDias br)}
+ = BranchOK br{blockedDias = I.insertWith (++) ur [f] (blockedDias br)}
    where ur = getUrfather br (DS.Prefix pr)
 
 {-    helper functions for equivalence class merge     -}
 
-merge :: Params -> Prefix -> DependencySet -> DS.Pointer -> Branch -> BranchInfo
-merge p pr fDs pointer br -- pointer is a nominal or a prefix
+merge :: Params -> Prefix -> DependencySet -> Nom -> Branch -> BranchInfo
+merge p pr fDs n br
  = let
        (DS.Prefix ur1,classes1) = DS.find  (DS.Prefix pr) (nomPrefClasses br)
-       (poAncestor   ,classes2) = DS.find  pointer classes1
-       classes3                 = DS.union (DS.Prefix pr) pointer classes2
+       (poAncestor   ,classes2) = DS.find  (DS.Nominal n) classes1
+       classes3                 = DS.union (DS.Prefix pr) (DS.Nominal n) classes2
    in
     case poAncestor of
-     DS.Nominal _     -> BranchOK $ addClassDeps ur1 fDs $ br { nomPrefClasses = classes3 }
-                         -- nominal not yet in the equivalence classes
+     DS.Nominal _   -> BranchOK $ addClassDeps ur1 fDs $ br { nomPrefClasses = classes3 }
+                         -- new nominal from down-arrow rule
      DS.Prefix ur2
-       | ur1 == ur2   -> BranchOK $ addClassDeps ur1 fDs br
-       | otherwise
-          ->
-            let
-               oldUr                    = max ur1 ur2
-               newUr                    = min ur1 ur2
-               clashableInfoSlots       = mapMaybe (\ur -> DMap.lookup1 ur (clashStr br))  [ur1,ur2]
-               currentDeps              = dsUnions $ fDs:(map (findDeps br) [ur1,ur2])
-               newPrToDepSet            = IntMap.insert newUr currentDeps (prToDepSet br)
-               newClashableSlotUrfather = cisAddDeps currentDeps $ cisUnions clashableInfoSlots
-            in
-             case newClashableSlotUrfather of
-              SlotUpdateFailure clashingDeps ->
-                  let newBr = br{nomPrefClasses = classes3} in
-                  BranchClash newBr pr (dsUnion clashingDeps currentDeps) (neg taut)
-
-              SlotUpdateSuccess urfatherSlot ->
-                  let newClashStr     = DMap $ IntMap.delete oldUr $ IntMap.insert newUr urfatherSlot (toMap $ clashStr br)
+      | ur1 == ur2 -> BranchOK $ addClassDeps ur1 fDs br
+      | otherwise
+         ->
+          let
+           oldUr           = max ur1 ur2
+           newUr           = min ur1 ur2
+           literalSlots    = mapMaybe (\ur -> D.lookup1 ur (literals br)) [ur1,ur2]
+           currentDeps     = dsUnions $ fDs:(map (findDeps br) [ur1,ur2])
+           newPrToDepSet   = I.insert newUr currentDeps (prToDepSet br)
+           newUrfatherSlot = lsAddDeps currentDeps $ lsUnions literalSlots
+          in
+           case newUrfatherSlot of
+            SlotUpdateFailure clashingDeps ->
+             let newBr = br{nomPrefClasses = classes3} in
+             BranchClash newBr pr (dsUnion clashingDeps currentDeps) (neg taut)
 
-                      -- structures that merge
-                      newPrefToForms  = moveInMap (prefToForms br) oldUr newUr Set.union
-                      newBoxConstrFwd = DMap.moveInnerDataDMapPlusDeps fDs (boxConstrFwd br) oldUr newUr
-                      newBoxConstrBwd = DMap.moveInnerDataDMapPlusDeps fDs (boxConstrBwd br) oldUr newUr
-                      newAccStr       = mergePrefixes (accStr br) oldUr newUr fDs
-                      newDiaRlCh      = moveInMap (diaRlCh br)  oldUr newUr Set.union
-                      newBlockedDias  = moveInMap (blockedDias br) oldUr newUr (++)
-                      (newBrWitnesses,unwitnessedToAdd) = mergeWitnesses oldUr newUr urfatherSlot (brWitnesses br)
+            SlotUpdateSuccess slot ->
+             let
+              newLiterals = I.delete oldUr $ I.insert newUr slot $ literals br
 
-                      -- structures that combine
-                      mapBoxFwd = map (\idx -> IntMap.findWithDefault IntMap.empty idx (toMap $ boxConstrFwd br) ) [ur1,ur2]
-                      mapAccFwd = map (successors (accStr br)) [ur1,ur2]
-                      formulasToSend1 = concatMap (boxRule currentDeps) $ almostCartesianProduct mapBoxFwd mapAccFwd
+              -- structures that merge
+              newBoxFwd = D.moveInnerDataDMapPlusDeps fDs (boxFwd br) oldUr newUr
+              newAccStr       = mergePrefixes (accStr br) oldUr newUr fDs
+              newDiaRlCh      = moveInMap (diaRlCh br)  oldUr newUr Set.union
+              newBlockedDias  = moveInMap (blockedDias br) oldUr newUr (++)
+              (newBrWit,unwitnessed) = mergeWitnesses oldUr newUr slot (brWitnesses br)
 
-                      mapBoxBwd = map (\idx -> IntMap.findWithDefault IntMap.empty idx (toMap $ boxConstrBwd br) ) [ur1,ur2]
-                      mapAccBwd = map (predecessors (accStr br)) [ur1,ur2]
-                      formulasToSend2 = concatMap (boxRule currentDeps) $ almostCartesianProduct mapBoxBwd mapAccBwd
+              -- structures that combine
+              mapBoxFwd = map (\idx -> get I.empty idx (boxFwd br) ) [ur1,ur2]
+              mapAccFwd = map (successors (accStr br)) [ur1,ur2]
+              forms1    = concatMap (boxRule currentDeps) $ combine mapBoxFwd mapAccFwd
 
-                      formulasToAdd   = nubAndMergeDeps $     formulasToSend1
-                                                           ++ formulasToSend2
-                                                           ++ unwitnessedToAdd
+              formulasToAdd = nubAndMergeDeps $ forms1 ++ unwitnessed
 
-                      newBr           = br{nomPrefClasses = classes3,
-                                           boxConstrFwd   = newBoxConstrFwd,
-                                           boxConstrBwd   = newBoxConstrBwd,
-                                           accStr         = newAccStr,
-                                           prToDepSet     = newPrToDepSet,
-                                           prefToForms    = newPrefToForms,
-                                           diaRlCh        = newDiaRlCh,
-                                           blockedDias    = newBlockedDias,
-                                           clashStr       = newClashStr,
-                                           brWitnesses    = newBrWitnesses}
-                  in
-                      addFormulas p formulasToAdd newBr
+              newBr           = br{nomPrefClasses = classes3,
+                                   boxFwd         = newBoxFwd,
+                                   accStr         = newAccStr,
+                                   prToDepSet     = newPrToDepSet,
+                                   diaRlCh        = newDiaRlCh,
+                                   blockedDias    = newBlockedDias,
+                                   literals       = newLiterals,
+                                   brWitnesses    = newBrWit}
+             in
+              addFormulas p formulasToAdd newBr
 
-mergeWitnesses :: Prefix -> Prefix -> ClashableInfoSlot -> BranchingWitnesses -> (BranchingWitnesses, [PrFormula])
-mergeWitnesses oldUr newUr urfatherSlot dbrWits@(DMap brWits)
- =( DMap.insert1 newUr newDest2 ( DMap.delete oldUr dbrWits ), toAdd1 ++ toAdd2 )
+mergeWitnesses :: Prefix -> Prefix -> LiteralSlot -> BranchingWitnesses
+                   -> (BranchingWitnesses, [PrFormula])
+mergeWitnesses oldUr newUr urfatherSlot brWits
+ =( D.insert1 newUr newDest2 ( D.delete oldUr brWits ), toAdd1 ++ toAdd2 )
   where
-   srcInnerMap  = IntMap.findWithDefault IntMap.empty oldUr brWits
-   destInnerMap = IntMap.findWithDefault IntMap.empty newUr brWits
+   srcInnerMap  = get I.empty oldUr brWits
+   destInnerMap = get I.empty newUr brWits
    (newDest1,toAdd1) = mergeWitnessesWitnessesMap srcInnerMap destInnerMap
-   (newDest2,toAdd2) = mergeWitnessesAgainstClashable newDest1 urfatherSlot
+   (newDest2,toAdd2) = mergeWitnessesAgainstLiterals newDest1 urfatherSlot
 
-mergeWitnessesWitnessesMap :: IntMap [PrFormula] -> IntMap [PrFormula] -> (IntMap [PrFormula], [PrFormula])
+mergeWitnessesWitnessesMap :: IntMap [PrFormula] -> IntMap [PrFormula]
+                               -> (IntMap [PrFormula], [PrFormula])
 mergeWitnessesWitnessesMap srcWitMap destWitMap
- = foldr go (destWitMap,[]) $ IntMap.assocs srcWitMap
+ = foldr go (destWitMap,[]) $ I.assocs srcWitMap
    where
       go (l,fs) (destMap,toAddAgain)
-         = case IntMap.lookup l destMap of
-            Just fs2 -> (IntMap.insert l (fs2++fs) destMap, toAddAgain)
+         = case I.lookup l destMap of
+            Just fs2 -> (I.insert l (fs2++fs) destMap, toAddAgain)
             Nothing
-             -> case IntMap.lookup (negLit l) destMap of -- (negLit l) is just one bit away from l in the map, but we don't use it
-                  Just fs2 -> (IntMap.delete (negLit l) destMap, fs++fs2++toAddAgain)
-                  Nothing ->  (IntMap.insert l fs destMap, toAddAgain)
+             -> case I.lookup (negLit l) destMap of
+       -- (negLit l) is just one bit away from l in the map, but we don't use it
+                  Just fs2 -> (I.delete (negLit l) destMap, fs++fs2++toAddAgain)
+                  Nothing ->  (I.insert l fs destMap, toAddAgain)
 
-mergeWitnessesAgainstClashable :: IntMap [PrFormula] -> ClashableInfoSlot -> (IntMap [PrFormula],[PrFormula])
-mergeWitnessesAgainstClashable  witMap cis
- = foldr go (witMap,[]) $ IntMap.assocs witMap
+mergeWitnessesAgainstLiterals :: IntMap [PrFormula] -> LiteralSlot
+                                   -> (IntMap [PrFormula],[PrFormula])
+mergeWitnessesAgainstLiterals  witMap ls
+ = foldr go (witMap,[]) $ I.assocs witMap
    where
     go (lit,fs) (destMap,toAddAgain)
-      | lit `IntMap.member` cis = (IntMap.delete lit destMap,toAddAgain)
-      | negLit lit `IntMap.member` cis = (IntMap.delete lit destMap,fs++toAddAgain) -- same remark as above
+      | lit `I.member` ls = (I.delete lit destMap,toAddAgain)
+      | negLit lit `I.member` ls = (I.delete lit destMap,fs++toAddAgain)
+          -- same remark as above
       | otherwise = (destMap,toAddAgain)
 
 nubAndMergeDeps :: [PrFormula] -> [PrFormula]
--- Rationale : because of the equivalence classes, a same formula can be added to a branch
--- as several prefixed formulas with different branching dependencies. This functions takes
--- a list of prefixes formulas, looks which inner formulas are the same and merge their
--- branching dependencies.
+-- Rationale : because of the equivalence classes, a same formula can be added
+-- to a branch as several prefixed formulas with different branching dependencies.
+-- This functions takes a list of prefixed formulas, looks which inner formulas
+-- are the same and merge their branching dependencies.
 nubAndMergeDeps prfs =  namd prfs (Map.empty::Map (Prefix,Formula) DependencySet)
 
 namd :: [PrFormula] -> Map (Prefix,Formula) DependencySet -> [PrFormula]
@@ -460,26 +390,6 @@
 
 namd [] theMap = map (\((p,f),ds) -> PrFormula p ds f) (Map.assocs theMap)
 
-{-
-   Functions related to nom, prefixes and nominals ...
--}
-
-toUrfather :: Branch -> PrFormula -> (Prefix,PrFormula)
-toUrfather br f@(PrFormula pr ds f2)
- = (urfather, newF)
-   where
-     (urfather,ds2,_) = getUrfatherAndDeps br (DS.Prefix pr)
-     newF  = if urfather == pr
-                 then f else PrFormula urfather (dsUnion ds ds2) f2
-
-addToPrefToForms :: PrFormula -> Branch -> Branch
-addToPrefToForms (PrFormula pr _ f) br
- | blockMode br == PatternBlocking = br
- | forInclusion br f               = br{prefToForms = newMap}
- | otherwise                       = br
- where currentPtf = prefToForms br
-       newMap = IntMap.insertWith Set.union pr (Set.singleton f) currentPtf
-
 {-     handling nominal urfathers, equivalence classes and dependencies     -}
 
 isNominalUrfather :: Branch -> Prefix -> Bool
@@ -507,10 +417,10 @@
         deps = findDeps br ur
 
 findDeps :: Branch -> Prefix -> DependencySet
-findDeps br pr = IntMap.findWithDefault dsEmpty pr (prToDepSet br)
+findDeps br pr = get dsEmpty pr (prToDepSet br)
 
 addClassDeps :: Prefix -> DependencySet -> Branch -> Branch
-addClassDeps pr ds br = br { prToDepSet = IntMap.insertWith dsUnion pr ds (prToDepSet br) }
+addClassDeps pr ds br = br { prToDepSet = I.insertWith dsUnion pr ds (prToDepSet br) }
 
 inSameClass :: Branch -> Prefix -> Int -> Bool
 inSameClass br p n
@@ -520,85 +430,77 @@
 
 {-     box-related constraints     -}
 
-boxRule :: DependencySet -> (IntMap {- Rel -} [(Formula,DependencySet)], IntMap {- Rel -} [(Prefix,DependencySet)]) -> [PrFormula]
+boxRule :: DependencySet
+            -> (IntMap {- Rel -} [(Formula,DependencySet)],
+                IntMap {- Rel -} [(Prefix,DependencySet)] )
+            -> [PrFormula]
 boxRule deps (mapBox, mapAcc)
  = [PrFormula p (dsUnions [deps,ds1,ds2]) f |
-                      r1 <- IntMap.keys mapBox,
-                      r2 <- IntMap.keys mapAcc,
+                      r1 <- I.keys mapBox,
+                      r2 <- I.keys mapAcc,
                       r1 == r2,
-                      (f,ds1) <- (IntMap.!) mapBox r1,
-                      (p,ds2) <- (IntMap.!) mapAcc r2     ]
+                      (f,ds1) <- (I.!) mapBox r1,
+                      (p,ds2) <- (I.!) mapAcc r2     ]
 
-addBoxConstraint :: Prefix -> Rel -> Formula -> DependencySet -> Params -> Branch -> BranchInfo
+addBoxConstraint :: Prefix -> Rel -> Formula -> DependencySet -> Params -> Branch
+                     -> BranchInfo
 addBoxConstraint pr_ r f ds p br
  | boxAlreadyDone br pr (r,f) = BranchOK br
  | isForward r
-    = let    newBr = br{boxConstrFwd = updateBoxConstr pr r f ds (boxConstrFwd br)}
-             accessiblePrDs   = IntMap.findWithDefault [] r $ successors (accStr br) pr
-             toAdd = symApplications ++ transApplications ++ boxApplications
-             transApplications = if isTransitive (relInfo br) r
-                                 then map (\(pr2,ds2) -> PrFormula pr2 (dsUnion ds ds2) (Box r f)) accessiblePrDs
-                                 else []
-             symApplications = [PrFormula pr ds $ Box (invRel r) f | isSymmetric (relInfo br) r]
-             boxApplications = map (\(pr2,ds2) -> PrFormula pr2 (dsUnion ds ds2) f) accessiblePrDs
+    = let newBr = br{boxFwd = updateBoxConstr pr r f ds (boxFwd br)}
+          succs  = get [] r $ successors (accStr br) pr
+          toAdd = fromTrans ++ fromBox
+          fromTrans
+           = if isTransitive (relInfo br) r
+              then map (\(pr2,ds2) -> PrFormula pr2 (dsUnion ds ds2) (Box r f)) succs
+              else []
+          fromBox = map (\(pr2,ds2) -> PrFormula pr2 (dsUnion ds ds2) f) succs
     -- todo check again with new pattern, create successor if new pattern not realized
       in
          addFormulas p toAdd newBr
 
- | otherwise
-   = let    newBr = br{boxConstrBwd = updateBoxConstr pr (atom r) f ds (boxConstrBwd br)}
-            accessiblePrDs          = IntMap.findWithDefault [] (atom r) $ predecessors (accStr br) pr
-            toAdd = transApplications ++ boxApplications -- no symApplications cause inv rewritten as forward during parsing
-            transApplications = if isTransitive (relInfo br) (atom r)
-                                then map (\(pr2,ds2) -> PrFormula pr2 (dsUnion ds ds2) (Box r f)) accessiblePrDs
-                                else []
-            boxApplications = map (\(pr2,ds2) -> PrFormula pr2 (dsUnion ds ds2) f) accessiblePrDs
-     in
-        addFormulas p toAdd newBr
+ | otherwise = error "backwards relation"
  where pr = getUrfather br (DS.Prefix pr_)
 
-updateBoxConstr :: Prefix -> Rel -> Formula -> DependencySet -> BoxConstraints -> BoxConstraints
-updateBoxConstr p1_ r_ f_ ds_ (DMap boxConstr_) =
-  case IntMap.lookup p1_ boxConstr_ of
-    Nothing       -> DMap $ IntMap.insert p1_ (IntMap.singleton r_ [(f_,ds_)]) boxConstr_
+updateBoxConstr :: Prefix -> Rel -> Formula -> DependencySet -> BoxConstraints
+                    -> BoxConstraints
+updateBoxConstr p1_ r_ f_ ds_ boxConstr_ =
+  case I.lookup p1_ boxConstr_ of
+    Nothing       -> I.insert p1_ (I.singleton r_ [(f_,ds_)]) boxConstr_
     Just innerMap ->
-       case IntMap.lookup r_ innerMap of
-        Nothing             -> DMap $ IntMap.insert p1_ (IntMap.insert r_ [(f_,ds_)] innerMap)                boxConstr_
-        Just innerInnerList -> DMap $ IntMap.insert p1_ (IntMap.insert r_ ((f_,ds_):innerInnerList) innerMap) boxConstr_
+       case I.lookup r_ innerMap of
+        Nothing
+         -> I.insert p1_ (I.insert r_ [(f_,ds_)] innerMap)                boxConstr_
+        Just innerInnerList
+         -> I.insert p1_ (I.insert r_ ((f_,ds_):innerInnerList) innerMap) boxConstr_
 
 boxAlreadyDone :: Branch -> Prefix -> (Rel,Formula) -> Bool
 boxAlreadyDone br ur (r,f)
- | isForward r  = case ( do inner <- IntMap.lookup ur (toMap $ boxConstrFwd br)
-                            boxes <- map fst <$> IntMap.lookup r inner
-                            return (f `elem` boxes) ) of
-                    Just True -> True
-                    _         -> False
- | otherwise    = case ( do inner <- IntMap.lookup ur (toMap $ boxConstrBwd br)
-                            boxes <- map fst <$> IntMap.lookup (atom r) inner
+ | isForward r  = case ( do inner <- I.lookup ur (boxFwd br)
+                            boxes <- map fst <$> I.lookup r inner
                             return (f `elem` boxes) ) of
                     Just True -> True
                     _         -> False
+ | otherwise    = error "backwards relation"
 
 -- accessibility Formulas
 
 addAccFormula :: Params -> (DependencySet,Rel,Prefix,Prefix) -> Branch -> BranchInfo
 addAccFormula p (ds, r, p1_, p2_) br
- | isBackwards r = addAccFormula p (ds, invRel r, p2_, p1_) br
+ | isBackwards r = error "backwards relation"
  | otherwise -- forward
    = addFormulas p toAdd newBr
-     where toAdd = transApplications ++ boxApplications
-           transApplications = if isTransitive (relInfo br) r
-                                then
-                                 (  ( map (\(f,ds2) -> PrFormula p2 (dsUnion ds ds2) (Box r f)) toSendFwd )
-                                 ++ ( map (\(f,ds2) -> PrFormula p1 (dsUnion ds ds2) (Box r f)) toSendBwd )  )
-                                else []
-           boxApplications =  (  ( map (\(f,ds2) -> PrFormula p2 (dsUnion ds ds2) f) toSendFwd )
-                              ++ ( map (\(f,ds2) -> PrFormula p1 (dsUnion ds ds2) f) toSendBwd )  )
-           p1 = getUrfather br (DS.Prefix p1_)
-           p2 = getUrfather br (DS.Prefix p2_)
-           toSendFwd = IntMap.findWithDefault [] r $ IntMap.findWithDefault IntMap.empty p1 (toMap $ boxConstrFwd br)
-           toSendBwd = IntMap.findWithDefault [] r $ IntMap.findWithDefault IntMap.empty p2 (toMap $ boxConstrBwd br)
-           newBr = scheduleInclusionRule p1 p2 r ds $ insertRelationBranch br p1 r p2 ds
+     where
+      toAdd = transApplications ++ boxApplications
+      transApplications =
+       if isTransitive (relInfo br) r
+        then map (\(f,ds2) -> PrFormula p2 (dsUnion ds ds2) (Box r f)) toSendFwd
+        else []
+      boxApplications = map (\(f,ds2) -> PrFormula p2 (dsUnion ds ds2) f) toSendFwd
+      p1 = getUrfather br (DS.Prefix p1_)
+      p2 = getUrfather br (DS.Prefix p2_)
+      toSendFwd = get [] r $ get I.empty p1 (boxFwd br)
+      newBr = scheduleInclusionRule p1 p2 r ds $ insertRelationBranch br p1 r p2 ds
 
 
 scheduleInclusionRule :: Prefix -> Prefix -> Rel -> DependencySet -> Branch -> Branch
@@ -609,104 +511,31 @@
    where parentss = case Map.lookup r (relInfo br) of
                       Nothing -> []
                       Just props -> [ rs | SubsetOf rs <- props]
-         toschedule = map (\parents -> (ds,p1,p2,parents)) $ filter (not . alreadyDone) parentss
+         toschedule = map (\parents -> (ds,p1,p2,parents)) $ filter (not . alreadyDone)
+                          parentss
          alreadyDone = any (`elem` linksFromTo (accStr br) p1 p2)
          utodo       = todoList br
-         newTodoList = utodo{roleIncTodo = Set.fromList toschedule `Set.union` roleIncTodo utodo}
+         newTodoList = utodo{roleIncTodo = Set.fromList toschedule
+                                           `Set.union` roleIncTodo utodo}
 
 insertRelationBranch :: Branch -> Prefix -> Rel -> Prefix -> DependencySet -> Branch
 insertRelationBranch br p1 r p2 ds
  = br{accStr = insertRelation (accStr br) p1 r p2 ds}
 
-
-{- blocking conditions -}
-
-isNotBlocked :: Branch -> PrFormula -> Bool
-isNotBlocked br pf@(PrFormula pr _ _)
- | pr <= unblockedPrefsLim br = True
- | otherwise =
- case blockMode br of
-   PatternBlocking    -> not $ patternBlocked br pf
-   AnywhereBlocking   -> not $ any isSubsumer labels
-                           where ur = getUrfather br (DS.Prefix pr)
-                                 fs = formulasOf br ur
-                                 isSubsumer fs_ = fs `Set.isSubsetOf` fs_
-                                 labels = map snd $ takeWhile ((< ur).fst) $  ascPrefToForm br
-   ChainTwinBlocking  -> isNotChainTwinBlocked br pr
-
-isNotChainTwinBlocked :: Branch -> Prefix -> Bool
-isNotChainTwinBlocked br pr = not $ test2equal $ map (formulasOf br) (getAllParents br pr)
-
-getAllParents :: Branch -> Prefix -> [Prefix]
--- getAllParents up to one that has an input nominal
-getAllParents br pr = getUrfather br (DS.Prefix pr):rest
- where rest = case IntMap.lookup pr (prefParent br) of
-                Nothing     -> []
-                Just parent -> if isNominalUrfather br parent
-                                then getAllParents br parent
-                                else [getUrfather br (DS.Prefix parent)]
-
-
-test2equal :: (Ord a) => [Set a] -> Bool -- inefficient
-test2equal (s:sets) = any (s ==) sets || test2equal sets
-test2equal [] = False
-
-
 {- model building -}
 
 isInTheModel :: Branch -> Prefix -> Bool
-isInTheModel br pr | isNominalUrfather br pr
- = case blockMode br of
-    PatternBlocking   ->  True
-    AnywhereBlocking  ->  True
-    ChainTwinBlocking ->  case findModelRepresentativeChainTwinBlocking br pr of
-                                 Nothing   -> False
-                                 Just repr -> repr == pr
+isInTheModel br pr | isNominalUrfather br pr = True
 isInTheModel _ _ = False
 
-relationIsInTheModel :: Branch -> (Prefix,Rel,Prefix) -> Bool
-relationIsInTheModel br (p1,_,p2)
- = case blockMode br of
-     PatternBlocking              -> True
-     AnywhereBlocking             -> True
-     ChainTwinBlocking            -> hasIdentityUrfather br p1 && hasIdentityUrfather br p2
-   where hasIdentityUrfather br_ pr_
-          = case findModelRepresentativeChainTwinBlocking br_ pr_ of {Nothing -> False ; _ -> True }
-
 getModelRepresentative :: Branch -> Prefix -> Prefix
 getModelRepresentative br pr
- = case blockMode br of
-    PatternBlocking -> ur
-    AnywhereBlocking-> ur
-    ChainTwinBlocking -> fromMaybe ( error $ "interesting counter example " ++ show pr)
-                                   $ findModelRepresentativeChainTwinBlocking br pr
-   where ur = getUrfather br (DS.Prefix pr)
-
-findModelRepresentativeChainTwinBlocking :: Branch -> Prefix -> Maybe Prefix
-findModelRepresentativeChainTwinBlocking br pr
- =  go br pr 0
-     where
-       go :: Branch -> Prefix -> Prefix -> Maybe Prefix
-       go br_ initial current =
-          let urCurrent =  getUrfather br (DS.Prefix current) in
-           if urCurrent == initial
-            then if isNotChainTwinBlocked br initial then Just initial else Nothing
-            else if areTwins br_ initial urCurrent && isNotChainTwinBlocked br urCurrent
-                   then Just urCurrent
-                   else go br_ initial (current+1)
-
-areTwins :: Branch -> Prefix -> Prefix -> Bool
-areTwins br p1 p2 = formulasOf br p1 == formulasOf br p2
-
-
-ascPrefToForm :: Branch -> [(Prefix,Set Formula)]
-ascPrefToForm br = [ (pr,formulasOf br pr) | pr <- prefixes br ]
-
+ = getUrfather br (DS.Prefix pr)
 
 -- <r>f is pattern blocked if its pattern is a subset
 -- of one pattern of the branch's pattern store
 patternBlocked :: Branch -> PrFormula -> Bool
-patternBlocked br f = not $ IntMap.null $ IntMap.filter lookForSuperset (individualPattern br) 
+patternBlocked br f = not $ I.null $ I.filter lookForSuperset (patterns br)
  where lookForSuperset = Set.isSubsetOf (patternOf br f)
 
 -- given a p:<r>f formula, return the pattern:
@@ -715,52 +544,22 @@
 patternOf :: Branch -> PrFormula -> Set Formula
 patternOf br (PrFormula pr _ (Dia r f))
  = Set.insert f boxes
-     where ur = getUrfather br (DS.Prefix pr)
-           boxes = if isTransitive (relInfo br) r
-                    then boxesOf br ur r `Set.union` (Set.map (Box r) $ boxesOf br ur r)
-                    else boxesOf br ur r
+    where ur = getUrfather br (DS.Prefix pr)
+          boxes = if isTransitive (relInfo br) r
+                   then boxesOf br ur r
+                          `Set.union` (Set.map (Box r) $ boxesOf br ur r)
+                   else boxesOf br ur r
 
 patternOf _ _ = error "patternOf called with a non diamond formula"
 
 boxesOf :: Branch -> Prefix -> Rel -> Set Formula
 boxesOf br p r
- = set $ map fst $ IntMap.findWithDefault [] r $ IntMap.findWithDefault IntMap.empty p (toMap $ boxConstrFwd br)
+ = set $ map fst $ get [] r $ get I.empty p (boxFwd br)
 
 findByPattern :: Branch -> Set Formula -> Prefix
-findByPattern br pattern
- | blockMode br == PatternBlocking  =
-       head $ map fst
-            $ filter (\(_,pat2) -> pattern `Set.isSubsetOf` pat2)
-            $ IntMap.toList $ individualPattern br
- | blockMode br == AnywhereBlocking =
-       head $ map fst
-            $ filter (\(_,pat2) -> pattern `Set.isSubsetOf` pat2)
-            $ IntMap.toList $ prefToForms br
- | otherwise = error "findByPattern called with ChainTwinBlocking"
-
--- maybe should get the urfather of given prefix, so that the caller functions won't have to do it
-formulasOf :: Branch -> Prefix -> Set Formula
-formulasOf br p = IntMap.findWithDefault Set.empty p (prefToForms br)
-
--- is the formula useful to calculate inclusion urfathers ?
-forInclusion :: Branch -> Formula -> Bool
-forInclusion br (Lit l)
-      | isProp l    = True
-      | isNominal l = Set.member (atom l) (relevantNominals br)
-      | otherwise   = False -- top, bottom
-forInclusion _ (Con _) = False
-forInclusion _ (Dis _) = False
-forInclusion _ (At _ _) = False
-forInclusion _ (Down _ _) = False
-forInclusion _ (Box _ _) = True
-forInclusion _ (Dia _ _) = True
-forInclusion _ (A _) = False
-forInclusion _ (E _) = False
-forInclusion _ (D _) = False
-forInclusion _ (B _) = False
-
-addParentPrefix :: Prefix -> Prefix -> Branch -> BranchInfo
-addParentPrefix son father br = BranchOK br{prefParent = IntMap.insert son father (prefParent br)}
+findByPattern br pattern =
+       head $ [ pr | (pr,pat2)  <- I.toList $ patterns br,
+                     pattern `Set.isSubsetOf` pat2 ]
 
 {-     modifications done by rule application     -}
 
@@ -768,75 +567,42 @@
 addDiaRuleCheck pr (r,f) newPr br =
   BranchOK br2
    where pattern = patternOf br (PrFormula ur dsEmpty (Dia r f))
-         br1 = case blockMode br of
-                 PatternBlocking -> br{individualPattern = IntMap.insert newPr pattern (individualPattern br)}
-                 _ -> br
-         br2 = br1{diaRlCh=IntMap.insertWith Set.union ur (Set.singleton (r,f)) (diaRlCh br1)}
+         br1 = br{patterns = I.insert newPr pattern (patterns br)}
+         br2 = br1{diaRlCh=I.insertWith Set.union ur (Set.singleton (r,f)) (diaRlCh br1)}
          ur = getUrfather br (DS.Prefix pr)
 
 diaAlreadyDone :: Branch -> PrFormula -> Bool
 diaAlreadyDone b (PrFormula p _ (Dia r f)) =
-  case IntMap.lookup ur (diaRlCh b) of
+  case I.lookup ur (diaRlCh b) of
      Nothing  -> False
      Just fset -> Set.member (r,f) fset
  where ur = getUrfather b (DS.Prefix p)
 
 diaAlreadyDone _ _ = error "dia already done : wrong formula kind"
---
 
 addDownRuleCheck :: Prefix -> Formula -> Branch -> BranchInfo
 addDownRuleCheck pr f br =
-  BranchOK br{downRlCh=IntMap.insertWith Set.union ur (Set.singleton f) (downRlCh br)}
+  BranchOK br{downRlCh=I.insertWith Set.union ur (Set.singleton f) (downRlCh br)}
    where ur = getUrfather br (DS.Prefix pr)
 
 downAlreadyDone :: Branch -> PrFormula -> Bool
 downAlreadyDone b (PrFormula p _ f@(Down _ _)) =
-  case IntMap.lookup ur (downRlCh b) of
+  case I.lookup ur (downRlCh b) of
      Nothing  -> False
      Just fset -> Set.member f fset
  where ur = getUrfather b (DS.Prefix p)
 
 downAlreadyDone _ _ = error "down already done : wrong formula kind"
 
---
-
-existAlreadyDone :: Branch -> Formula -> Bool
-existAlreadyDone b f@(E _) = Set.member f (existRlCh b)
-existAlreadyDone _ _ = error "exist already done : wrong formula kind"
-
---
-
-atAlreadyDone :: Branch -> Formula -> Bool
-atAlreadyDone b f@(At _ _) = Set.member f (atRlCh b)
-atAlreadyDone _ _ = error "at already done : wrong formula kind"
-
---
-
 addUnivConstraint :: Formula -> DependencySet -> Params -> Branch -> BranchInfo
 addUnivConstraint f ds p br
- = addFormulas p
-               ( map (\pr -> PrFormula pr ds f) urfathers )
-               newBr
+ = addFormulas p [PrFormula pr ds f | pr <- urfathers] newBr
    where newBr = br{univCons = (ds,f):(univCons br)}
          prefs = [0..(lastPref br)]
          urfathers = filter (isNominalUrfather br) prefs
 
---
-
-bRule :: Prefix -> Formula -> DependencySet -> Params -> Branch -> BranchInfo
-bRule  pr f ds p br
- = addFormula p br2 (PrFormula pr ds $ Down newNom $ A (Lit newNom `disj` f))
-    where newNom = nextNom br
-          br2 = br{nextNom = nextNom br + 4}
---
-
-addDiffRuleCheck :: Formula -> Maybe Prop -> Branch -> BranchInfo
-addDiffRuleCheck f mp br = BranchOK br{dDiaRlCh=Map.insert f mp (dDiaRlCh br)}
-
---
-
-createNewPref :: Params -> Branch -> BranchInfo
-createNewPref p br
+createNewNode :: Params -> Branch -> BranchInfo
+createNewNode p br
  = addFormulas p
                ( map (\(ds,f) -> PrFormula newPr ds f) univConstraints )
                newBrWithRefl
@@ -850,150 +616,61 @@
  = foldr (\rel_ br_ -> insertRelationBranch br_ pr rel_ pr dsEmpty) br reflRels
    where reflRels = Map.keys $ Map.filter (elem Reflexive) (relInfo br)
 
-
---
-
-createNewProp :: Branch -> BranchInfo
-createNewProp br = BranchOK br{nextProp = nextProp br + 4}
-
-createNewNomTestRelevance :: Formula -> Branch -> BranchInfo
-createNewNomTestRelevance f br
- = BranchOK
-    br{nextNom = nextNom br + 4,
-       relevantNominals = if relevant then Set.insert newNom (relevantNominals br) else relevantNominals br,
-       downVarRelevantCh = newDVRC
-      }
-   where (relevant, newDVRC) = doMemoize checkIfVariableNegatedOnce f (downVarRelevantCh br)
-         newNom = nextNom br
-
---
+createNewNom :: Branch -> BranchInfo
+createNewNom br
+ = BranchOK br{nextNom = nextNom br + 4}
 
 -- preparation of the branch at the beginning of the calculus:
 --  - add the input formula at prefix 0
 --  - add a nominal formula at a fresh prefix for each nominal of the input language
---    (even if the nominal was filtered out during lexical normalisation) -- <= TODO currently not the case. Get the nominals from the encoding 
+--    (even if the nominal was filtered out during lexical normalisation)
 --  - add reflexive links for prefixes 0 and nominal witnesses
-addFirstFormulas :: Params -> Branch -> LanguageInfo -> Formula -> BranchInfo
-addFirstFormulas p br_ fLang f
- = addFormulas p [pf] br4
-    where ns = languageNoms fLang
-          nbNs = length ns
-          nomWitnesses = [1..nbNs]
-          br =  foldr addReflexiveLinks (  br_{lastPref = nbNs} ) (0:nomWitnesses)
+initialBranch :: Params -> LanguageInfo -> RelInfo -> Encoding -> Formula
+                  -> BranchInfo
+initialBranch p fLang relInfo_ encoding_ f
+ = addFormulas p [pf] br
+    where
           pf = firstPrefixedFormula f
-          newClasses = foldr (\(pr,n) -> DS.union (DS.Prefix pr) (DS.Nominal n))
-                             (nomPrefClasses br)
-                             (zip [1..] ns)
-          newClashStr = foldr (\(pr,n) -> DMap.insert pr n dsEmpty)
-                              DMap.empty
+          ns = languageNoms fLang
+          nbNs = length ns
+          initPrefixes = 0:[1..nbNs]
+          br = foldr addReflexiveLinks emptyBr initPrefixes
+          initClasses = foldr (\(pr,n) -> DS.union (DS.Prefix pr) (DS.Nominal n))
+                              DS.mkDSet
                               (zip [1..] ns)
-          br2 = br{nomPrefClasses = newClasses,
-                         clashStr = newClashStr}
-          br3 = foldr (\(pr,n) -> bookKeepFormula p (PrFormula pr dsEmpty (Lit n)))
-                      br2
-                      (zip [1..] ns)
-          br4 = br3{unblockedPrefsLim = nbNs}
-
-{-     functions to handle the "clashable information", ie literals associated to prefixes     -}
-
-data UpdateResult = UpdateSuccess ClashableInfo | UpdateFailure DependencySet
+          initLiterals = foldr (\(pr,n) -> D.insert pr n dsEmpty)
+                               D.empty
+                               (zip [1..] ns)
+          emptyBr =
+           Branch{ literals          = initLiterals,
+                   accStr            = emptyRels,
+                   todoList          = emptyTodoList,
+                   boxFwd            = D.empty,
+                   diaRlCh           = I.empty,
+                   downRlCh          = I.empty,
+                   atRlCh            = Set.empty,
+                   existRlCh         = Set.empty,
+                   patterns          = I.empty,
+                   univCons          = [],
+                   lastPref          = nbNs,
+                   nextNom           = maxNom encoding_ + 4,
+                   prToDepSet        = I.empty,
+                   brWitnesses       = D.empty,
+                   nomPrefClasses    = initClasses,
+                   inputLanguage     = fLang,
+                   blockedDias       = I.empty,
+                   relInfo           = relInfo_,
+                   encoding          = encoding_
+                 }
 
-addToClashable :: Prefix -> DependencySet -> Literal -> Branch -> BranchInfo
-addToClashable pr_ ds1 l br
-  = case updateMap (clashStr br) pr ds l of
-     UpdateSuccess cs  -> BranchOK br{clashStr = cs}
+addToLiterals :: Prefix -> DependencySet -> Literal -> Branch -> BranchInfo
+addToLiterals pr_ ds1 l br
+  = case updateMap (literals br) pr ds l of
+     UpdateSuccess ls  -> BranchOK br{literals = ls}
      UpdateFailure dsf -> BranchClash br pr dsf (Lit l)
    where (pr,ds2,_) = getUrfatherAndDeps br (DS.Prefix pr_)
          ds = ds1 `dsUnion` ds2
 
-
--- Insert a piece of clashable information into all the clashable information of a branch
-
-updateMap :: ClashableInfo -> Prefix -> DependencySet -> Literal -> UpdateResult
-updateMap cs  _  ds l | isTop l    = UpdateSuccess cs
-                      | isBottom l = UpdateFailure ds
-updateMap (DMap cs) pre ds l
-  = case IntMap.lookup pre cs of
-       Nothing   -> UpdateSuccess $ DMap $ IntMap.insert pre (IntMap.singleton l ds) cs
-       Just slot -> case cisUpdate slot l ds of
-                     SlotUpdateSuccess updatedSlot -> UpdateSuccess $ DMap $ IntMap.insert pre updatedSlot cs
-                     SlotUpdateFailure failureDeps -> UpdateFailure failureDeps
-
-
-type ClashableInfoSlot = IntMap {- Literal -} DependencySet
-data SlotUpdateResult =   SlotUpdateSuccess ClashableInfoSlot
-                         | SlotUpdateFailure DependencySet
-
-
--- Union a list of clashable info slots
-cisUnions :: [ClashableInfoSlot] -> SlotUpdateResult
-cisUnions []              = SlotUpdateSuccess IntMap.empty
-cisUnions [cis]           = SlotUpdateSuccess cis
-cisUnions (cis1:cis2:tl)
- = case cisUnion cis1 cis2 of
-     failure@(SlotUpdateFailure _) -> failure
-     SlotUpdateSuccess newCis      -> cisUnions (newCis:tl)
-
--- Union two clashable info slots
-
--- if there is a clash, the result reports the set of dependencies whose earliest dependency is the earliest
--- among all dependencies sets that caused the clash
-cisUnion :: ClashableInfoSlot -> ClashableInfoSlot -> SlotUpdateResult
-cisUnion cis1 cis2
- = ucis_helper cis1 (IntMap.assocs cis2)
-    where ucis_helper :: ClashableInfoSlot -> [(Literal,DependencySet)] -> SlotUpdateResult
-          ucis_helper cis l_ds_s =
-             let (updateStatus,clashing_ds_s)
-                  = foldr (\(l,ds) (upResult,clashingBps_s)
-                           -> case upResult of
-                               SlotUpdateSuccess cis_ ->  (cisUpdate cis_ l ds,      clashingBps_s)
-                               SlotUpdateFailure ds_s ->  (cisUpdate cis  l ds, ds_s:clashingBps_s)
-                                                                 -- we reuse the input Clashabe Info Slot
-                          )
-                          (SlotUpdateSuccess cis,[])   l_ds_s
-                 result = case clashing_ds_s of
-                              []   -> updateStatus                                    -- is 'success'
-                              ds_s -> SlotUpdateFailure $ findEarliestSet ds_s
-                                         where findEarliestSet = minimumBy compareBPSets
-                                               compareBPSets ds1 ds2 = comparing dsMin ds1 ds2
-             in
-                result
-
-
--- Insert a piece of information in a clashable info slot
-
-cisUpdate :: ClashableInfoSlot -> Literal -> DependencySet -> SlotUpdateResult
-cisUpdate cis l ds  | isTop l     = SlotUpdateSuccess cis
-                    | isBottom l  = SlotUpdateFailure ds
-cisUpdate cis l ds  -- nominals, propositional symbols
- = case IntMap.lookup (negLit l) cis of
-    Just ds2         -> SlotUpdateFailure $ dsUnion ds ds2
-    Nothing          -> SlotUpdateSuccess $ IntMap.insertWith mergeDeps l ds cis
-                         where mergeDeps d1 d2  = if dsMin d1 < dsMin d2 then d1 else d2
-                                -- if the same information is caused by an earlier
-                                -- branching, only keep the information of the earliest set of dependencies
-
--- Other functions related to clashable information
-
-cisAddDeps :: DependencySet -> SlotUpdateResult -> SlotUpdateResult
-cisAddDeps ds res_cis =
- case res_cis of
-  SlotUpdateSuccess cis -> SlotUpdateSuccess $ IntMap.map (dsUnion ds) cis
-  failure                -> failure
-
-
-
-cisQuery :: Branch -> Prefix -> Literal -> Maybe (Bool,DependencySet)
--- Output : Nothing = nevermind ; Just True = already there ; Just False = contrary there
-cisQuery _ _ l | isTop l    = Just (True,dsEmpty)
-               | isBottom l = Just (False,dsEmpty)
-cisQuery br pr l
-  = case DMap.lookup pr l (clashStr br) of
-      Just ds    -> Just (True,ds)
-      Nothing    -> case DMap.lookup pr (negLit l) (clashStr br) of
-                      Just ds -> Just (False,ds)
-                      Nothing -> Nothing
-
 {-     function used for unit propagation     -}
 
 data ReducedDisjunct
@@ -1008,67 +685,62 @@
      Nothing -> Triviality
      Just (disjuncts,ds,proposed)
        | Set.null disjuncts -> Contradiction ds
-       | otherwise -> Reduced ds disjuncts proposed -- what if not reduced ? and no proposed witness ?
+       | otherwise -> Reduced ds disjuncts proposed
+            -- what if not reduced ? and no proposed witness ?
    where
       ur = getUrfather br (DS.Prefix pr)
       go _ Nothing = Nothing
       go l@(Lit current) (Just (disjuncts,ds_,proposed))
-       = case (cisQuery br ur current, proposed) of
+       = case (lsQuery (literals br) ur current, proposed) of
           (Just (True,_)    ,_) -> Nothing
           (Just (False,ds2) ,_) -> Just (disjuncts,dsUnion ds_ ds2, proposed)
           (Nothing, Nothing)
            -> if isPositiveNom current
-               then Just (Set.insert l disjuncts,ds_,Nothing) -- no lazy branching with positive nominals
-               else case DMap.lookup ur (negLit current) (brWitnesses br) of
-                      -- if current is a negated nominal, we know the "just" case is impossible
-                     Just _  -> Just (Set.insert l disjuncts,ds_,Nothing) -- there's an opposed witness
-                     Nothing -> Just (Set.insert l disjuncts,ds_, Just current) -- propose for witness
+               then Just (Set.insert l disjuncts,ds_,Nothing)
+                    -- no lazy branching with positive nominals
+               else case D.lookup ur (negLit current) (brWitnesses br) of
+                      -- if current is a negated nominal,
+                      -- we know the "just" case is impossible
+                     Just _  -> Just (Set.insert l disjuncts,ds_,Nothing)
+                      -- there's an opposed witness
+                     Nothing -> Just (Set.insert l disjuncts,ds_, Just current)
+                      -- propose for witness
           _ {- already a proposed witness -}
            -> Just (Set.insert l disjuncts,ds_,proposed)
-      go f               (Just (disjuncts,ds_,proposed)) = Just (Set.insert f disjuncts, ds_,proposed)
+      go f (Just (disjuncts,ds_,proposed)) = Just (Set.insert f disjuncts, ds_,proposed)
 
 
 {-     other functions     -}
 prefixes :: Branch -> [Prefix]
 prefixes br = [0..(lastPref br)]
 
-oneIs :: RelInfo -> RelProperty -> Bool
-oneIs relI p = any ( elem p . snd) $ Map.toList relI
-
 hasProperty :: RelProperty -> RelInfo -> Rel -> Bool
 hasProperty p relI r = case Map.lookup r relI of
                         Nothing         -> False
                         Just properties -> p `elem` properties
 
-isSymmetric :: RelInfo -> Rel -> Bool
-isSymmetric = hasProperty Symmetric
-
 isTransitive :: RelInfo -> Rel -> Bool
 isTransitive = hasProperty Transitive
 
-almostCartesianProduct :: [a] -> [b] -> [(a,b)]
-almostCartesianProduct [] _  = error "almostCartesianProduct: first list empty"
-almostCartesianProduct _  [] = error "almostCartesianProduct: second list empty"
-almostCartesianProduct as bs = [(a,b) | (idxA,a) <- zip [(0::Int)..] as,
-                                        (idxB,b) <- zip [(0::Int)..] bs,
-                                        idxA /= idxB]
+combine :: [a] -> [b] -> [(a,b)]
+combine [] _  = error "combine: first list empty"
+combine _  [] = error "combine: second list empty"
+combine as bs = [(a,b) | (idxA,a) <- zip [(0::Int)..] as,
+                         (idxB,b) <- zip [(0::Int)..] bs,
+                         idxA /= idxB]
 
 moveInMap :: IntMap b -> Int -> Int -> (b -> b -> b) -> IntMap b
 moveInMap m origKey destKey mergeF
- = result
-   where mOrigValue = IntMap.lookup origKey m
-         prunedM    = IntMap.delete origKey m
-         result = case mOrigValue of
-                   Nothing -> m
-                   Just origValue -> IntMap.insertWith mergeF destKey origValue prunedM
-
-doMemoize :: Ord a => (a -> b) -> a -> Map.Map a b -> (b, Map.Map a b)
-doMemoize f e m = case Map.lookup e m of
-                   Nothing     -> let result = f e in (result, Map.insert e result m)
-                   Just result -> (result, m)
+ = case I.lookup origKey m of
+    Nothing -> m
+    Just origValue
+     -> I.insertWith mergeF destKey origValue $ I.delete origKey m
 
 list :: Ord a => Set.Set a -> [a]
 list = Set.toList
 
 set :: Ord a => [a] -> Set.Set a
 set = Set.fromList
+
+get :: a -> Int -> IntMap a -> a
+get = I.findWithDefault
diff --git a/src/HTab/CommandLine.hs b/src/HTab/CommandLine.hs
--- a/src/HTab/CommandLine.hs
+++ b/src/HTab/CommandLine.hs
@@ -6,12 +6,10 @@
 
 import System.Console.CmdArgs
 import Data.List ( sort )
-import Data.Maybe ( isNothing )
 import HTab.Statistics( StatisticsState, setPrintOutInterval )
 
 data Params = Params {
-           filename        :: Maybe FilePath,
-           stdin           :: Bool,
+           filename        :: FilePath,
            genModel        :: Maybe FilePath,
            dotModel        :: Bool,
            timeout         :: Int,
@@ -20,12 +18,10 @@
            semBranch       :: Bool,
            backjumping     :: Bool,
            lazyBranching   :: Bool,
-           patternBlocking :: Bool,
            unitProp        :: UnitProp,
            showFormula     :: Bool,
            allTransitive   :: Bool,
-           allReflexive    :: Bool,
-           allSymmetric    :: Bool
+           allReflexive    :: Bool
          } deriving (Show, Data, Typeable)
 
 data UnitProp = Eager | UPYes | UPNo deriving (Data, Typeable, Eq, Show)
@@ -33,8 +29,7 @@
 defaultParams :: Annotate Ann
 defaultParams
  = record Params{}
-     [ filename       := Nothing += name "f" += typFile += help "input file",
-       stdin          := False   += help "use standard input instead of file",
+     [ filename       := "" += name "f" += typFile += help "input file",
        genModel       := Nothing += name "m" += typFile += help "output model file",
        dotModel       := False   += help "output model in dot format (otherwise: hylolib format)",
        timeout        := 0       += name "t" += help "timeout (in seconds, default=none)",
@@ -43,18 +38,16 @@
        semBranch      := True    += help "enable semantic branching (default)",
        backjumping    := True    += help "enable backjumping (default)",
        lazyBranching  := True    += help "enable lazy branching (default)" ,
-       patternBlocking := True    += help "use pattern blocking instead of anywhere blocking (default)" ,
        unitProp `enum_` [atom Eager += explicit += name "eager"        += help "unit propagation: eager (default)",
                          atom UPYes += explicit += name "unit-prop"    += help "unit propagation: enabled",
                          atom UPNo  += explicit += name "no-unit-prop" += help "unit propagation: disabled"] ,
        showFormula    := False   += help "display formula",
        allTransitive  := False   += help "make all relations transitive",
-       allReflexive   := False   += help "make all relations reflexive",
-       allSymmetric   := False   += help "make all relations symmetric"
+       allReflexive   := False   += help "make all relations reflexive"
       ] += verbosity
 
 strategyVal :: String
-strategyVal = "n@E<Db|r"
+strategyVal = "n@E<b|r"
 
 checkParams :: Params -> IO Bool
 checkParams p
@@ -64,14 +57,14 @@
                    "strategy should contain all of the following characters: ",
                    "  n = nominals               @ = satisfaction operator",
                    "  E = existential modality   < = diamond",
-                   "  D = difference modality    b = down-arrow binder",
-                   "  | = or                     r = role inclusion",
+                   "  b = down-arrow binder      | = or",
+                   "  r = role inclusion",
                    "",
                    "The default is `" ++ strategyVal ++ "'",
                    "The rules conjunction, box, universal modality and converse difference",
                    "modality are immediate, thus do not belong to the strategy."]
        return False
- | not (stdin p) && isNothing (filename p) =
+ | null (filename p) =
     do putStrLn $ unlines ["ERROR: No input specified.","Run with --help for usage options"]
        return False
  | otherwise = return True
diff --git a/src/HTab/DMap.hs b/src/HTab/DMap.hs
--- a/src/HTab/DMap.hs
+++ b/src/HTab/DMap.hs
@@ -1,5 +1,5 @@
 module HTab.DMap
-(DMap(..), empty, toMap, flatten,
+(DMap, empty, flatten,
  delete, insert, insertWith, (!),
  insert1, lookup, lookup1, lookupInter,
  moveInnerDataDMapPlusDeps )
@@ -7,7 +7,7 @@
 where
 
 import Data.IntMap ( IntMap )
-import qualified Data.IntMap as IM
+import qualified Data.IntMap as I
 
 import HTab.Formula(DependencySet, dsUnion)
 
@@ -15,72 +15,68 @@
 
 {- a DMap , or double map, is a nesting of two Maps -}
 
-newtype DMap c = DMap (IntMap (IntMap c))
-
-toMap :: DMap c -> IntMap (IntMap c)
-toMap (DMap m) = m
+type DMap c = IntMap (IntMap c)
 
 empty :: DMap c
-empty = DMap IM.empty
+empty = I.empty
 
 insert1 :: Int -> IntMap c -> DMap c -> DMap c
-insert1 k1 v (DMap m) = DMap $ IM.insert k1 v m
+insert1 k1 v m = I.insert k1 v m
 
 insert :: Int -> Int -> c -> DMap c -> DMap c
-insert k1 k2 v (DMap m)
- = case IM.lookup k1 m of
-    Nothing     -> DMap $ IM.insert k1 (IM.singleton k2 v) m
-    Just innerM -> DMap $ IM.insert k1 (IM.insert k2 v innerM) m
+insert k1 k2 v m
+ = case I.lookup k1 m of
+    Nothing     -> I.insert k1 (I.singleton k2 v) m
+    Just innerM -> I.insert k1 (I.insert k2 v innerM) m
 
 
 insertWith :: (c -> c -> c) -> Int -> Int -> c -> DMap c -> DMap c
-insertWith f k1 k2 v (DMap m)
- = case IM.lookup k1 m of
-    Nothing     -> DMap $ IM.insert k1 (IM.singleton k2 v) m
-    Just innerM -> DMap $ IM.insert k1 (IM.insertWith f k2 v innerM) m
+insertWith f k1 k2 v m
+ = case I.lookup k1 m of
+    Nothing     -> I.insert k1 (I.singleton k2 v) m
+    Just innerM -> I.insert k1 (I.insertWith f k2 v innerM) m
 
 flatten :: DMap c -> [((Int,Int),c)]
-flatten (DMap m)
- = let ambcs = IM.assocs m  in --  [(a,IntMap c)]
-    concatMap (\(a_,innerM_) ->  map  (\(b_,c_) -> ((a_,b_),c_))  (IM.assocs innerM_ )) ambcs
+flatten m
+ = let ambcs = I.assocs m  in --  [(a,IntMap c)]
+    concatMap (\(a_,innerM_) ->  map  (\(b_,c_) -> ((a_,b_),c_))  (I.assocs innerM_ )) ambcs
 
 infixl 9 !
 
 (!) :: DMap c -> Int -> Int -> c
-(!) (DMap m) k1 k2 = (IM.!) ( (IM.!) m k1 ) k2
+(!) m k1 k2 = (I.!) ( (I.!) m k1 ) k2
 
 
 lookup :: Int -> Int -> DMap c -> Maybe c
-lookup k1 k2 (DMap m) = do innerMap <- IM.lookup k1 m
-                           IM.lookup k2 innerMap
+lookup k1 k2 m = do innerMap <- I.lookup k1 m
+                    I.lookup k2 innerMap
 
 lookup1 :: Int -> DMap c -> Maybe (IntMap c)
-lookup1 k1 (DMap m) = IM.lookup k1 m
+lookup1 k1 m = I.lookup k1 m
 
 delete ::  Int -> DMap c -> DMap c
-delete k1 (DMap m) = DMap $ IM.delete k1 m
+delete k1 m = I.delete k1 m
 
 lookupInter :: Int -> DMap c -> [Int]
-lookupInter k1 (DMap m) = case IM.lookup k1 m of
-                           Nothing -> []
-                           Just innerMap -> IM.keys innerMap 
+lookupInter k1 m = case I.lookup k1 m of
+                    Nothing -> []
+                    Just innerMap -> I.keys innerMap
 
 -- provided two keys of the DMap and a merge function, merge the inner maps of
 -- both keys using the merge function when needed for inner values
 -- delete the first inner map
 -- and add the given dependencies
 moveInnerDataDMapPlusDeps :: DependencySet -> DMap [(c,DependencySet)] -> Int -> Int -> DMap [(c,DependencySet)]
-moveInnerDataDMapPlusDeps newDeps (DMap m) origKey destKey
- = DMap
-    $ case IM.lookup origKey m of
-        Nothing  -> m
-        Just origInnerMap
-            -> let origInnerMapPlusDeps = IM.map (addDeps newDeps) origInnerMap
-                   prunedM = IM.delete origKey m
-                   addDeps newBps = map (\(el,oldBps) -> (el,dsUnion newBps oldBps))
-               in case IM.lookup destKey m of
-                    Nothing -> IM.insert destKey origInnerMapPlusDeps prunedM
-                    Just destInnerMap
-                       -> let mergedInnerMap = IM.unionWith (++) origInnerMapPlusDeps destInnerMap
-                          in  IM.insert destKey mergedInnerMap prunedM
+moveInnerDataDMapPlusDeps newDeps m origKey destKey
+ = case I.lookup origKey m of
+     Nothing  -> m
+     Just origInnerMap
+        -> let origInnerMapPlusDeps = I.map (addDeps newDeps) origInnerMap
+               prunedM = I.delete origKey m
+               addDeps newBps = map (\(el,oldBps) -> (el,dsUnion newBps oldBps))
+           in case I.lookup destKey m of
+                Nothing -> I.insert destKey origInnerMapPlusDeps prunedM
+                Just destInnerMap
+                   -> let mergedInnerMap = I.unionWith (++) origInnerMapPlusDeps destInnerMap
+                      in  I.insert destKey mergedInnerMap prunedM
 
diff --git a/src/HTab/Formula.hs b/src/HTab/Formula.hs
--- a/src/HTab/Formula.hs
+++ b/src/HTab/Formula.hs
@@ -9,13 +9,15 @@
 LanguageInfo(..), neg,
 conj, disj, taut,
 prop, nom, formulaLanguageInfo, prefix, negPr,
-checkIfVariableNegatedOnce, replaceVar,
+replaceVar,
 firstPrefixedFormula,
 parse, simpleParse, Theory, RelInfo, Task,
 showRelInfo, showRel, showLit, negLit, isForward, isBackwards,
 encodeValidityTest, encodeSatTest, encodeRetrieveTask,
-HyLoFormula, RelProperty(..), Encoding(..), maxNom, maxProp, toPropSymbol, toNomSymbol, toRelSymbol,
-isTop, isBottom, isPositiveNom, isPositiveProp, isPositive, isNegative, isNominal, isProp, atom,
+HyLoFormula, RelProperty(..), Encoding(..), maxNom, maxProp,
+toPropSymbol, toNomSymbol, toRelSymbol,
+isTop, isBottom, isPositiveNom, isPositiveProp, isPositive, isNegative,
+isNominal, isProp, atom,
 invRel, int
 )
 
@@ -23,7 +25,7 @@
 
 import Data.Bits (complementBit, testBit, clearBit, (.|.) )
 import qualified Data.Set as Set
-import Data.Set ( Set )
+import Data.Set ( Set, unions )
 import qualified Data.Map as Map
 import Data.Map ( Map )
 import qualified Data.IntSet as IntSet
@@ -62,8 +64,6 @@
      | Down   Nom Formula
      | A      Formula
      | E      Formula
-     | D      Formula
-     | B      Formula
   deriving (Eq, Ord)
 
 -- convention : bit0 = OFF -> positive literal, negative otherwise
@@ -86,11 +86,11 @@
 type Nom = Int
 type Literal = Int
 
-isTop, isBottom, isPositiveNom, isNegativeNom, isNominal, isPositiveProp, isProp, isNegative, isPositive :: Int -> Bool
+isTop, isBottom, isPositiveNom, isNominal, isPositiveProp,
+ isProp, isNegative, isPositive :: Int -> Bool
 isTop            = (==0)
 isBottom         = (==1)
 isPositiveNom a  = ((a `mod` 4) == 0) && (a > 1)
-isNegativeNom a  = ((a `mod` 4) == 1) && (a > 1)
 isNominal a      = ((a `mod` 4) < 2)  && (a > 1)
 isPositiveProp a = (a `mod` 4) == 2
 isProp a         = (a `mod` 4) >= 2
@@ -126,8 +126,6 @@
  show (Dia r f)    = "<" ++ showRel r ++ ">"   ++ show f
  show (A f)      = "A" ++ show f
  show (E f)      = "E" ++ show f
- show (D f)      = "D" ++ show f
- show (B f)      = "B" ++ show f
  show (Down n f) = "down " ++ showLit n ++ "." ++ show f
 
 -- parsing of the input file
@@ -138,13 +136,9 @@
 
 type RelInfo = Map Rel [RelProperty]
 data RelProperty   =   Reflexive
-                     | Symmetric
                      | Transitive
                      | Universal
-                     | Difference
                      --
-                     | InverseOf Rel
-                     | TRClosureOf Rel
                      | SubsetOf [Rel]
                      deriving (Eq, Show, Ord)
 
@@ -157,7 +151,7 @@
     where parseOutput = InputFile.myparse s       -- direct parse from hylolib
           encoding    = getEncoding parseOutput
           pRelInfo    = P.relations parseOutput
-          relInfo     = forceProperties p encoding $ convertToOurType pRelInfo encoding -- TODO
+          relInfo     = forceProperties p encoding $ convertToOurType pRelInfo encoding
           theory      = convert relInfo encoding $ P.theory parseOutput
           tasks       = P.tasks parseOutput
 
@@ -177,19 +171,23 @@
               els -> maximum els
 
 toPropSymbol :: Encoding -> Int -> S.PropSymbol
-toPropSymbol e i = S.PropSymbol $ case Map.lookup (atom i) (invertMap $ propMap e) of
-                                    Nothing -> {- new prop symbol -} "new_prop_" ++ show i
-                                    Just x -> x
+toPropSymbol e i =
+ S.PropSymbol $ case Map.lookup (atom i) (invertMap $ propMap e) of
+                  Nothing -> {- new prop symbol -} "new_prop_" ++ show i
+                  Just x -> x
 
 toNomSymbol :: Encoding -> Int -> S.NomSymbol
-toNomSymbol e i = S.NomSymbol $  case Map.lookup (atom i) (invertMap $ nomMap e) of
-                                        Nothing -> error $ show e ++ " nom symbol " ++ show i
-                                        Just x -> x
+toNomSymbol e i =
+ S.NomSymbol $ case Map.lookup (atom i) (invertMap $ nomMap e) of
+                 Nothing -> error $ show e ++ " nom symbol " ++ show i
+                 Just x -> x
 
 toRelSymbol :: Encoding -> Int -> S.RelSymbol
-toRelSymbol e i = case Map.lookup (atom i) (invertMap $ relMap e) of
-                         Nothing -> error $ show e ++ " rel symbol " ++ show i
-                         Just x -> if isForward i then S.RelSymbol x else S.InvRelSymbol x
+toRelSymbol e i =
+ case Map.lookup (atom i) (invertMap $ relMap e) of
+   Nothing -> error $ show e ++ " rel symbol " ++ show i
+   Just x -> if isForward i then S.RelSymbol x
+              else error "backwards relations not supported"
 
 invertMap :: (Ord a, Ord b) => Map.Map a b -> Map.Map b a
 invertMap = Map.fromList . map (\(a,b) -> (b,a)) . Map.assocs
@@ -200,12 +198,15 @@
             propMap = Map.fromList $ zip props $ map (\p -> 2 + p*4) [0..],
              relMap = Map.fromList $ zip rels  $ map (\r ->     r*2) [0..] } 
  where
-   theory =  P.theory parseOutput
-   noms  = map (\(S.NomSymbol n)  -> n) $ Set.toList $ Set.unions $ map (nomSymbols . getSignature)  theory
-   props = map (\(S.PropSymbol p) -> p) $ Set.toList $ Set.unions $ map (propSymbols . getSignature) theory
-   rels1  = map fst $ P.relations parseOutput
-   rels2  = map (\(S.RelSymbol r) -> r) $ Set.toList $ Set.unions $ map (relSymbols . getSignature) theory
-   rels = nub $ rels1 ++ rels2
+  theory =  P.theory parseOutput
+  noms  =
+   map (\(S.NomSymbol n)  -> n) $ list $ unions $ map (nomSymbols . getSignature)  theory
+  props =
+   map (\(S.PropSymbol p) -> p) $ list $ unions $ map (propSymbols . getSignature) theory
+  rels1  = map fst $ P.relations parseOutput
+  rels2  =
+   map (\(S.RelSymbol r) -> r) $ list $ unions $ map (relSymbols . getSignature) theory
+  rels = nub $ rels1 ++ rels2
 
 nomsOfEncoding :: Encoding -> [Nom]
 nomsOfEncoding e = Map.elems (nomMap e)
@@ -221,33 +222,38 @@
          addToAll r = Map.insertWith (\c1 c2 -> nub $ c1 ++ c2) r conds
          conds = map snd $
                    filter fst   [(allTransitive p, Transitive),
-                                 (allReflexive  p, Reflexive ),
-                                 (allSymmetric  p, Symmetric )]
+                                 (allReflexive  p, Reflexive )]
 
-convertToOurType :: PRelInfo -> Encoding -> RelInfo -- and add for each relation in the formula, the relevant key
+convertToOurType :: PRelInfo -> Encoding -> RelInfo
+ -- and add for each relation in the formula, the relevant key
 convertToOurType prelI e = foldr insertRelProp Map.empty (concatMap convertOne prelI)
  where insertRelProp (rs,pr) = Map.insertWith (++) rs [pr]
        convertOne (r,props)  = concatMap (c r) props
        c r P.Reflexive       = [(int e r,Reflexive    )]
-       c r P.Symmetric       = [(int e r,Symmetric    )]
+       c _ P.Symmetric       = error "Symmetric not handled"
        c r P.Transitive      = [(int e r,Transitive   )]
        c r P.Universal       = [(int e r,Universal    )]
-       c r P.Difference      = [(int e r,Difference   )]
-       c r (P.InverseOf s)   = [(int e r,InverseOf   (int e s))]
+       c _ (P.InverseOf _)   = error "InverseOf not handled" 
        c r (P.SubsetOf ss)   = [(int e r,SubsetOf [ int e s | s <- ss])]
-       c r (P.Equals ss)     = [(int e r,SubsetOf [ int e s | s <- ss])] ++ [(int e s,SubsetOf [int e r]) | s <- ss]
+       c r (P.Equals ss)     = [(int e r,SubsetOf [ int e s | s <- ss])]
+                               ++ [(int e s,SubsetOf [int e r]) | s <- ss]
        c _ (P.TClosureOf _)  = error "TClosureOf not handled"
        c _ (P.TRClosureOf _) = error "TRClosureOf not handled"
        c _ P.Functional      = error "Functional not handled"
+       c _ P.Injective       = error "Injective not handled"
+       c _ P.Difference      = error "Difference not handled"
 
 simpleParse :: Params -> String -> (Theory,RelInfo,Encoding,[Task])
-simpleParse p s = parse p $ "signature { automatic } theory { " ++ removeBeginEnd s ++ "}"
+simpleParse p s =
+ parse p $ "signature { automatic } theory { " ++ removeBeginEnd s ++ "}"
  where removeBeginEnd = unwords . delete "begin" . delete "end" . words
 
-convert :: RelInfo -> Encoding -> [F.Formula S.NomSymbol S.PropSymbol S.RelSymbol] -> Formula
+convert :: RelInfo -> Encoding -> [F.Formula S.NomSymbol S.PropSymbol S.RelSymbol]
+             -> Formula
 convert relI e = conv_ relI e . foldr (F.:&:) F.Top
 
-conv_ :: RelInfo -> Encoding -> F.Formula S.NomSymbol S.PropSymbol S.RelSymbol -> Formula
+conv_ :: RelInfo -> Encoding -> F.Formula S.NomSymbol S.PropSymbol S.RelSymbol
+           -> Formula
 conv_  _   _ F.Top               = taut
 conv_  _   _ F.Bot               = neg taut
 conv_  _   e (F.Prop p)          = prop e p
@@ -263,31 +269,21 @@
 conv_ relI e (F.Down v f)        = downArrow e v (conv_ relI e f)
 conv_ relI e (F.A f)             = univMod     (conv_ relI e f)
 conv_ relI e (F.E f)             = existMod    (conv_ relI e f)
-conv_ relI e (F.D f)             = dExistMod   (conv_ relI e f)
-conv_ relI e (F.B f)             = dUnivMod    (conv_ relI e f)
+conv_ _    _ f                   = error (show f ++ "not supported")
 
 type Connector = Formula -> Formula
 
 specialiseDia :: S.RelSymbol -> RelInfo -> Encoding -> Connector
-specialiseDia r relI e = specialise r relI (diamond e, dExistMod, existMod) e
+specialiseDia r relI e = specialise r relI (diamond e, existMod) e
 
 specialiseBox :: S.RelSymbol -> RelInfo -> Encoding -> Connector
-specialiseBox r relI e = specialise r relI (box e, dUnivMod, univMod) e
-
-specialise :: S.RelSymbol -> RelInfo -> (S.RelSymbol -> Connector, Connector, Connector) -> Encoding -> Connector
-specialise (S.InvRelSymbol r) _ (relational, _ , _) _ -- happens only with simple input
- = relational $ S.InvRelSymbol r
+specialiseBox r relI e = specialise r relI (box e, univMod) e
 
--- below we don't attempt checking if r is an inverse of an inverse
-specialise (S.RelSymbol r) relI (relational, difference, global) e
- | Difference `elem` props = difference
+specialise :: S.RelSymbol -> RelInfo -> (S.RelSymbol -> Connector, Connector)
+                -> Encoding -> Connector
+specialise (S.RelSymbol r) relI (relational, global) e
  | Universal `elem` props  = global
- | otherwise = case [ r2 | InverseOf r2 <- props] of
-                 []     -> relational $ S.RelSymbol r
-                 (r2:_) -> relational $ invRS $ toRelSymbol e r2
-                   where
-                     invRS (S.RelSymbol s)       = S.InvRelSymbol s
-                     invRS (S.InvRelSymbol s)    = S.RelSymbol s
+ | otherwise = relational $ S.RelSymbol r
  where props = Map.findWithDefault [] (int e r) relI
 
 type HyLoFormula = F.Formula S.NomSymbol S.PropSymbol S.RelSymbol
@@ -300,7 +296,8 @@
 encodeSatTest relI e th fs
  = conj th (convert relI e fs)
 
-encodeRetrieveTask :: RelInfo -> Encoding -> LanguageInfo -> Formula -> [HyLoFormula] -> ([Int],[Formula])
+encodeRetrieveTask :: RelInfo -> Encoding -> LanguageInfo -> Formula -> [HyLoFormula]
+                        -> ([Int],[Formula])
 encodeRetrieveTask relI e fLang theory fs
  = (noms , map (\n -> conj theory (At n (neg $ convert relI e fs))) noms)
    where noms = languageNoms fLang
@@ -318,15 +315,11 @@
 
 {- Modalities -}
 box, diamond :: Encoding -> S.RelSymbol -> Formula -> Formula
-univMod, existMod, dUnivMod, dExistMod :: Formula -> Formula
+univMod, existMod :: Formula -> Formula
 box        e (S.RelSymbol r)    = Box   $ int e r
-box        e (S.InvRelSymbol r) = Box   $ invRel $ int e r
 diamond    e (S.RelSymbol r)    = Dia   $ int e r
-diamond    e (S.InvRelSymbol r) = Dia   $ invRel $ int e r
 univMod    = A
 existMod   = E
-dUnivMod   = B
-dExistMod  = D
 
 int :: Encoding -> String -> Int
 int e s = relMap e Map.! s
@@ -404,8 +397,6 @@
 neg (Dia r f)        = Box  r (neg f)
 neg (A f)            = E (neg f)
 neg (E f)            = A (neg f)
-neg (D f)            = B (neg f)
-neg (B f)            = D (neg f)
 neg (Lit n)          = Lit $ negLit n
 
 
@@ -421,7 +412,7 @@
 showLess (PrFormula pr _ f) = show pr ++ ":" ++ show f
 
 prefix :: Prefix -> DependencySet -> Set Formula -> [PrFormula]
-prefix p bps fs = [PrFormula p bps formula|formula <- Set.toList fs]
+prefix p bps fs = [PrFormula p bps formula|formula <- list fs]
 
 firstPrefixedFormula :: Formula -> PrFormula
 firstPrefixedFormula = PrFormula 0 dsEmpty
@@ -431,50 +422,21 @@
 
 -- formula language
 
-data LanguageInfo = LanguageInfo {   languageNoms :: [Int], -- ascending list
-                                     relevantNoms :: [Int],
-                                     languagePast :: Bool}
+data LanguageInfo = LanguageInfo { languageNoms :: [Int] } -- ascending
 
 instance Show LanguageInfo where
  show li =         "Input Language:"
            ++ "\n|" ++ yesnol "Noms" ( languageNoms li )
-           ++ "\n|" ++ yesnol "Relevant Noms" ( relevantNoms li ) ++ "\n"
-           ++ yesno "Past, " ( languagePast li )
-  where yesno :: String -> Bool -> String
-        yesno s b = ( if b then "" else "no " ) ++ s
-        yesnol s l | null l = "no " ++ s
+  where yesnol s l | null l = "no " ++ s
         yesnol s l = s ++ concatMap (\l_ -> ", " ++ showLit l_)  l
 
-formulaLanguageInfo :: Formula -> Encoding -> LanguageInfo
-formulaLanguageInfo f e
- = LanguageInfo {   languageNoms = noms,
-                    relevantNoms = relNoms,
-                    languagePast = hasPast f}
-
-    where allNoms_ = nomsOfEncoding e
-          relNoms_ = extractRelevantNominals f
-          noms     = sort allNoms_
-          relNoms  = Set.toAscList relNoms_
+formulaLanguageInfo :: Encoding -> LanguageInfo
+formulaLanguageInfo e
+ = LanguageInfo { languageNoms = noms }
+    where noms = sort $ nomsOfEncoding e
 
 -- composeXX functions follow the idea from
 -- "A pattern for almost compositional functions", Bringert and Ranta.
-composeFold :: b
-            -> (b -> b -> b)
-            -> (Formula -> b)
-            -> (Formula -> b)
-composeFold zero combine g e = case e of
-    Con fs     -> foldr1 combine $ map g $ list fs
-    Dis fs     -> foldr1 combine $ map g $ list fs
-    Dia _ f    -> g f
-    Box _ f    -> g f
-    At  _ f    -> g f
-    Down _ f   -> g f
-    A f        -> g f
-    E f        -> g f
-    D f        -> g f
-    B f        -> g f
-    _          -> zero
-
 composeMap :: (Formula -> Formula)
            -> (Formula -> Formula)
            -> (Formula -> Formula)
@@ -486,22 +448,9 @@
     At   i f   -> At  i (g f)
     A f        -> A (g f)
     E f        -> E (g f)
-    D f        -> D (g f)
-    B f        -> B (g f)
     Down x f   -> Down x (g f)
     f          -> baseCase f
 
-
-extractRelevantNominals :: Formula -> Set Nom
-extractRelevantNominals (Lit n)| isNegativeNom n = Set.singleton (atom n)
-extractRelevantNominals (At _ f)                 = extractRelevantNominals f
-extractRelevantNominals f                        = composeFold Set.empty Set.union extractRelevantNominals f
-
-hasPast :: Formula -> Bool
-hasPast (Dia r _)    = testBit r 0
-hasPast (Box r _)    = testBit r 0
-hasPast f            = composeFold False (||) hasPast f
-
 replaceVar :: Int -> Int -> Formula -> Formula
 replaceVar v n a@(Lit v2)
    | isNominal v2 = if atom v /= atom v2 then a
@@ -513,17 +462,6 @@
 replaceVar v n (At v2 f)     = if v == v2 then At n (replaceVar v n f)
                                           else At v2 (replaceVar v n f)
 replaceVar v n f = composeMap id (replaceVar v n) f
-
-checkIfVariableNegatedOnce :: Formula -> Bool
-checkIfVariableNegatedOnce (Down v_ f_)
- = go v_ f_
-   where go :: Int -> Formula -> Bool
-         go v (Down v2 f)           = if v == v2 then False {- variable capture -} else go v f
-         go v (Lit v2)              = (atom v == atom v2) && isNegative v2
-         go v f                     = composeFold False (||) (go v) f
-
-checkIfVariableNegatedOnce _ = error "checkIfVariableNegatedOnce : only down-arrow formulas"
-
 
 -- backjumping
 
diff --git a/src/HTab/Literals.hs b/src/HTab/Literals.hs
new file mode 100644
--- /dev/null
+++ b/src/HTab/Literals.hs
@@ -0,0 +1,114 @@
+module HTab.Literals (
+UpdateResult(..), Literals,
+SlotUpdateResult(..), LiteralSlot,
+updateMap, lsUnions, lsAddDeps, lsQuery
+) where
+
+import Data.IntMap ( IntMap)
+import qualified Data.IntMap as I
+
+import HTab.DMap ( DMap )
+import qualified HTab.DMap as D
+
+import Data.List(minimumBy)
+import Data.Ord ( comparing )
+
+import HTab.Formula
+
+type Literals           = DMap {- Prefix Literal -} DependencySet
+
+{- functions for literals associated to prefixes -}
+
+data UpdateResult = UpdateSuccess Literals | UpdateFailure DependencySet
+
+-- Insert a literal into a literal slot
+
+updateMap :: Literals -> Prefix -> DependencySet -> Literal -> UpdateResult
+updateMap ls  _  ds l | isTop l    = UpdateSuccess ls
+                      | isBottom l = UpdateFailure ds
+updateMap ls pre ds l
+  = case I.lookup pre ls of
+     Nothing   -> UpdateSuccess $ I.insert pre (I.singleton l ds) ls
+     Just slot ->
+       case lsUpdate slot l ds of
+        SlotUpdateSuccess updatedSlot -> UpdateSuccess $ I.insert pre updatedSlot ls
+        SlotUpdateFailure failureDeps -> UpdateFailure failureDeps
+
+
+type LiteralSlot = IntMap {- Literal -} DependencySet
+data SlotUpdateResult =   SlotUpdateSuccess LiteralSlot
+                        | SlotUpdateFailure DependencySet
+
+
+-- Union a list of literals slots
+lsUnions :: [LiteralSlot] -> SlotUpdateResult
+lsUnions []              = SlotUpdateSuccess I.empty
+lsUnions [ls]            = SlotUpdateSuccess ls
+lsUnions (ls1:ls2:tl)
+ = case lsUnion ls1 ls2 of
+     failure@(SlotUpdateFailure _) -> failure
+     SlotUpdateSuccess newLs       -> lsUnions (newLs:tl)
+
+-- Union two literals slots
+
+-- if there is a clash, the result reports the set of dependencies whose
+-- earliest dependency is the earliest among all dep. sets that caused the clash
+lsUnion :: LiteralSlot -> LiteralSlot -> SlotUpdateResult
+lsUnion ls1 ls2
+ = uls_helper ls1 (I.assocs ls2)
+    where uls_helper :: LiteralSlot -> [(Literal,DependencySet)]
+                           -> SlotUpdateResult
+          uls_helper ls l_ds_s =
+           let (updateStatus,clashing_ds_s)
+                = foldr
+                   (\(l,ds) (upResult,clashingBps_s)
+                    -> case upResult of
+                        SlotUpdateSuccess ls_  -> (lsUpdate ls_ l ds,      clashingBps_s)
+                        SlotUpdateFailure ds_s -> (lsUpdate ls  l ds, ds_s:clashingBps_s)
+                           -- we reuse the input LiteralSlot
+                   )
+                   (SlotUpdateSuccess ls,[])   l_ds_s
+           in
+            case clashing_ds_s of
+              []   -> updateStatus      -- is 'success'
+              ds_s -> SlotUpdateFailure $ findEarliestSet ds_s
+                       where findEarliestSet = minimumBy compareBPSets
+                             compareBPSets ds1 ds2 = comparing dsMin ds1 ds2
+
+
+-- Insert a piece of information in a literal slot
+
+lsUpdate :: LiteralSlot -> Literal -> DependencySet -> SlotUpdateResult
+lsUpdate ls l ds  | isTop l     = SlotUpdateSuccess ls
+                  | isBottom l  = SlotUpdateFailure ds
+lsUpdate ls l ds  -- nominals, propositional symbols
+ = case I.lookup (negLit l) ls of
+    Just ds2 -> SlotUpdateFailure $ dsUnion ds ds2
+    Nothing  -> SlotUpdateSuccess $ I.insertWith mergeDeps l ds ls
+                 where mergeDeps d1 d2  = if dsMin d1 < dsMin d2 then d1 else d2
+                  -- if the same information is caused by an earlier
+                  -- branching, only keep the information of the earliest
+                  -- set of dependencies
+
+-- Other functions related to literals slots
+
+lsAddDeps :: DependencySet -> SlotUpdateResult -> SlotUpdateResult
+lsAddDeps ds res_ls =
+ case res_ls of
+  SlotUpdateSuccess ls -> SlotUpdateSuccess $ I.map (dsUnion ds) ls
+  failure              -> failure
+
+lsQuery :: Literals -> Prefix -> Literal -> Maybe (Bool,DependencySet)
+-- Output : Nothing    = nevermind
+--          Just True  = already there
+--          Just False = contrary there
+lsQuery _ _ l | isTop l    = Just (True,dsEmpty)
+              | isBottom l = Just (False,dsEmpty)
+lsQuery lits pr l
+  = case D.lookup pr l lits of
+      Just ds    -> Just (True,ds)
+      Nothing    -> case D.lookup pr (negLit l) lits of
+                      Just ds -> Just (False,ds)
+                      Nothing -> Nothing
+
+
diff --git a/src/HTab/Main.hs b/src/HTab/Main.hs
--- a/src/HTab/Main.hs
+++ b/src/HTab/Main.hs
@@ -9,7 +9,6 @@
 
 import System.Console.CmdArgs ( whenNormal, whenLoud )
 
-import System.IO           ( hSetBuffering, stdin, BufferMode(LineBuffering)) 
 import System.CPUTime( getCPUTime )
 import qualified System.Timeout as T
 import System.IO.Strict ( readFile )
@@ -18,7 +17,7 @@
 import HyLo.InputFile.Parser ( QueryType(..) )
 
 import HTab.CommandLine( filename, timeout, Params, genModel, dotModel, showFormula )
-import HTab.Branch( BranchInfo(..), emptyBranch, addFirstFormulas)
+import HTab.Branch( BranchInfo(..), initialBranch)
 import HTab.Statistics( Statistics, initialStatisticsStateFor, printOutMetricsFinal )
 import HTab.Tableau( OpenFlag(..), tableauStart )
 import HTab.Formula( formulaLanguageInfo, Theory, RelInfo, Encoding, Task,
@@ -33,13 +32,9 @@
 runWithParams p =
  time "Total time: "
   $ do
-     let fromStdIn = do myPutStrLn "Reading from stdin."
-                        hSetBuffering stdin LineBuffering
-                        getContents
-
      let parse i = if head (words i)  == "begin"
                         then F.simpleParse p i else F.parse p i
-     allTasks <- parse <$> maybe fromStdIn readFile (filename p)
+     allTasks <- parse <$> readFile (filename p)
      --
      result <- if timeout p == 0
                 then Just <$> runTasks allTasks p
@@ -59,7 +54,8 @@
 runTasks allTasks@(theory,relInfo,encoding,tasks) p =
  do
     myPutStrLn "== Checking theory satisfiability =="
-    res <- runOneTask (Satisfiable, genModel p,[]) relInfo encoding theory p
+    res <- time "Task time:"
+            $ runTask (Satisfiable, genModel p,[]) relInfo encoding theory p
     case res of
      SUCCESS | null tasks -> return SUCCESS
              | otherwise  -> do myPutStrLn "\n==         Starting tasks         =="
@@ -73,7 +69,7 @@
 runTasks2 :: (Theory,RelInfo,Encoding,[Task]) -> Params -> IO TaskRunFlag
 runTasks2 (_,_,_,[]) _                  = error "runTasks2 empty list error"
 runTasks2 (theory,relInfo,encoding,(hd:tl)) p =
- do res <- runOneTask hd relInfo encoding theory p
+ do res <- time "Task time:" $ runTask hd relInfo encoding theory p
     case res of
       SUCCESS | null tl   -> return SUCCESS
               | otherwise -> runTasks2 (theory,relInfo,encoding,tl) p
@@ -82,75 +78,73 @@
 
 --
 
-runOneTask :: Task -> RelInfo -> Encoding -> Formula -> Params -> IO TaskRunFlag
-runOneTask (query,mOutFile,fs) relInfo encoding theory p =
- time "Task time:"
- $ do
-     myPutStrLn $ "\n* " ++ case query of {Valid       -> "Validity task";
-                                           Satisfiable -> "Satisfiability task";
-                                           Retrieve    -> "Instance retrieval task"}
-     --
-     result <-
-      case query of
-        Retrieve
-          ->
-            do let fLang = formulaLanguageInfo theory encoding
-               let initialBranch = emptyBranch fLang relInfo encoding p
-               let (noms,encfs) = encodeRetrieveTask relInfo encoding fLang theory fs
-               --
-               myPutStrLn $ "Instances making true: " ++ show fs
-               --
-               results <- mapM (tableauInit p . addFirstFormulas p initialBranch fLang) encfs
-               let goodnoms = [ toNomSymbol encoding n | (n,(CLOSED _ ,_))  <- zip noms results]
-               myPutStrLn $ show goodnoms
-               let doWrite f = do writeFile f (show goodnoms ++ "\n")
-                                  myPutStrLn ("Nominals saved as " ++ f)
-               maybe (return ()) doWrite mOutFile
-               return SUCCESS
+runTask :: Task -> RelInfo -> Encoding -> Formula -> Params -> IO TaskRunFlag
+runTask (Retrieve,mOutFile,fs) relInfo encoding theory p =
+ do myPutStrLn "\n* Instance retrieval task"
+    let fLang = formulaLanguageInfo encoding
+    let (noms,encfs) = encodeRetrieveTask relInfo encoding fLang theory fs
+    --
+    myPutStrLn $ "Instances making true: " ++ show fs
+    --
+    results <- mapM (tableauInit p . initialBranch p fLang relInfo encoding) encfs
+    let goods = [ toNomSymbol encoding n | (n,(CLOSED _ ,_)) <- zip noms results]
+    myPutStrLn $ show goods
+    let doWrite f = do writeFile f (show goods ++ "\n")
+                       myPutStrLn ("Nominals saved as " ++ f)
+    maybe (return ()) doWrite mOutFile
+    return SUCCESS
 
-        valOrSat
-          ->
-            do let f = case valOrSat of
-                        Valid       -> encodeValidityTest relInfo encoding theory fs
-                        Satisfiable -> encodeSatTest      relInfo encoding theory fs
-                        _           -> error "never happens"
-               --
-               when (showFormula p)
-                  $ myPutStrLn
-                         $ unlines ["Input for SAT test:",
-                                    "{ " ++ show f ++ " }",
-                                    "End of input",
-                                    "Relations properties :" ++ showRelInfo relInfo ]
-               --
-               let fLang         = formulaLanguageInfo f encoding
-               let initialBranch = emptyBranch fLang relInfo encoding p
-               let branchInfo    = addFirstFormulas p initialBranch fLang f
-               --
-               result <- tableauInit p branchInfo
-               --
-               case result of
-                  (OPEN m, stats)   -> do myPutStrLn $
-                                            case query of
-                                                Valid       -> "The formula is not valid."
-                                                Satisfiable -> "The formula is satisfiable."
-                                                _           -> error "never happens"
-                                          saveGenModel mOutFile p m
-                                          whenNormal $ printOutMetricsFinal stats
-                                          return SUCCESS
-                  (CLOSED _, stats) -> do myPutStrLn $
-                                            case query of
-                                                Valid       -> "The formula is valid."
-                                                Satisfiable -> "The formula is unsatisfiable."
-                                                _           -> error "never happens"
-                                          whenNormal $ printOutMetricsFinal stats
-                                          return FAILURE
-     --
-     return $ case (query, result) of
-               (Satisfiable, SUCCESS ) -> SUCCESS
-               (Satisfiable, FAILURE ) -> FAILURE
-               (Valid      , SUCCESS ) -> FAILURE
-               (Valid      , FAILURE ) -> SUCCESS
-               (Retrieve   , _       ) -> SUCCESS
+runTask (Satisfiable,mOutFile,fs) relInfo encoding theory p =
+ do myPutStrLn "\n* Satisfiability task"
+    let f = encodeSatTest relInfo encoding theory fs
+    --
+    when (showFormula p)
+       $ myPutStrLn
+              $ unlines ["Input for SAT test:",
+                         "{ " ++ show f ++ " }",
+                         "End of input",
+                         "Relations properties :" ++ showRelInfo relInfo ]
+    --
+    let fLang         = formulaLanguageInfo encoding
+    --
+    (result,stats) <- tableauInit p $ initialBranch p fLang relInfo encoding f
+    --
+    whenNormal $ printOutMetricsFinal stats
+    --
+    case result of
+       OPEN m   -> do myPutStrLn "The formula is satisfiable."
+                      saveGenModel mOutFile p m
+                      return SUCCESS
+       CLOSED _ -> do myPutStrLn "The formula is unsatisfiable."
+                      return FAILURE
+
+runTask (Valid,mOutFile,fs) relInfo encoding theory p =
+ do myPutStrLn "\n* Validity task"
+    let f = encodeValidityTest relInfo encoding theory fs
+    --
+    when (showFormula p)
+       $ myPutStrLn
+              $ unlines ["Input for SAT test:",
+                         "{ " ++ show f ++ " }",
+                         "End of input",
+                         "Relations properties :" ++ showRelInfo relInfo ]
+    --
+    let fLang         = formulaLanguageInfo encoding
+    --
+    (result,stats) <- tableauInit p $ initialBranch p fLang relInfo encoding f
+    --
+    whenNormal $ printOutMetricsFinal stats
+    --
+    case result of
+       OPEN m   -> do myPutStrLn "The formula is not valid."
+                      saveGenModel mOutFile p m
+                      return FAILURE
+       CLOSED _ -> do myPutStrLn "The formula is valid."
+                      return SUCCESS
+
+runTask (Counting,_,_) _ _ _ _ =
+ do myPutStrLn "\n* Counting task is NOT supported"
+    return FAILURE
 
 --
 
diff --git a/src/HTab/ModelGen.hs b/src/HTab/ModelGen.hs
--- a/src/HTab/ModelGen.hs
+++ b/src/HTab/ModelGen.hs
@@ -4,7 +4,7 @@
 
 import qualified Data.Set as Set
 import Data.Set (Set)
-import qualified Data.IntMap as IntMap
+import qualified Data.IntMap as I
 import HyLo.Model.Herbrand ( inducedModel )
 import HyLo.Model.PrettyPrint ( toDotStr )
 import qualified HyLo.Model.Herbrand as H
@@ -15,51 +15,44 @@
 import HTab.Formula( PrFormula(..), Formula(..),
                      Prefix, Rel, LanguageInfo(..), Encoding, int,
                      RelInfo, toPropSymbol, toNomSymbol, toRelSymbol, isPositiveProp )
-import HTab.Branch( Branch(..), prefixes, getUrfather, BlockingMode(..),
+import HTab.Branch( Branch(..), prefixes, getUrfather,
                     patternOf, findByPattern,
-                    isInTheModel, relationIsInTheModel, getModelRepresentative,
-                    isTransitive, isSymmetric )
+                    isInTheModel, getModelRepresentative,
+                    isTransitive )
 import qualified HTab.DisjSet as DS
-import HTab.DMap (flatten, DMap(..), toMap )
+import HTab.DMap (flatten)
 import HTab.Relations ( allRels )
 
 type Model = M.Model S.NomSymbol S.NomSymbol S.PropSymbol S.RelSymbol
 
 buildModel :: Branch -> Model
-buildModel branch =
-  completeModel e (relInfo branch) $ inducedModel $ H.herbrand es ps rs
+buildModel br =
+  completeTrans e (relInfo br) $ inducedModel $ H.herbrand es ps rs
  where
-       e = encoding branch
-       bias = if null $ languageNoms $ inputLanguage branch
-               then 0
-               else 1 + length ( languageNoms $ inputLanguage branch )
-       es = Set.union
-             (Set.fromList
-               [(S.NomSymbol $ show (getUrfather branch (DS.Nominal n) + bias), toNomSymbol e n)
-               | n <- languageNoms $ inputLanguage branch]
-             )
-             (Set.fromList
-               [(S.NomSymbol $ show (p + bias), S.NomSymbol $ show (p + bias))
-               | p <- prefixes branch, isInTheModel branch p]
-             )
-       ps = Set.fromList
-             [(S.NomSymbol $ show (pre + bias), pro)
-             | (pre,pro) <- prefixAndProps branch]
-       pbBlocked =
-          if blockMode branch `elem` [PatternBlocking,AnywhereBlocking]
-             then
-                  [ (pr, r, pr2) |
-                         pr <- prefixes branch,
-                         isInTheModel branch pr,
-                         blockedDia@(PrFormula _ _ (Dia r _)) <- IntMap.findWithDefault [] pr (blockedDias branch),
-                         let pat = patternOf branch blockedDia,
-                         let pr2 = findByPattern branch pat ]
-             else []
-       rels = (filter (relationIsInTheModel branch) $ allRels $ accStr branch) ++ pbBlocked
-       inModel = flip getModelRepresentative
-       rs =      Set.fromList $ map (toSimpSig e)
-                              $ map (\(p1,r,p2) -> ((p1 `inModel` branch) + bias , r,(p2 `inModel` branch) + bias))
-                                rels
+  e = encoding br
+  bias = if null $ languageNoms $ inputLanguage br
+          then 0
+          else 1 + length ( languageNoms $ inputLanguage br )
+  es = Set.fromList $
+        [(S.NomSymbol $ show (getUrfather br (DS.Nominal n) + bias), toNomSymbol e n)
+         | n <- languageNoms $ inputLanguage br]
+        ++ [(S.NomSymbol $ show (p + bias), S.NomSymbol $ show (p + bias))
+            | p <- prefixes br, isInTheModel br p]
+  ps = Set.fromList
+        [(S.NomSymbol $ show (pre + bias), pro) | (pre,pro) <- prefixAndProps br]
+  pbBlocked =
+         [ (pr, r, pr2) |
+             pr <- prefixes br,
+             isInTheModel br pr,
+             blockedDia@(PrFormula _ _ (Dia r _)) <- get [] pr (blockedDias br),
+             let pat = patternOf br blockedDia,
+             let pr2 = findByPattern br pat ]
+  rels = (allRels $ accStr br) ++ pbBlocked
+  inModel = flip getModelRepresentative
+  rs = Set.fromList
+        $ map (toSimpSig e)
+        $ map (\(p1,r,p2) -> ((p1 `inModel` br) + bias , r,(p2 `inModel` br) + bias))
+          rels
 
 toSimpSig :: Encoding -> (Prefix,Rel,Prefix) -> (S.NomSymbol,S.RelSymbol,S.NomSymbol)
 toSimpSig e (p1,r,p2) = (S.NomSymbol (show p1), toRelSymbol e r, S.NomSymbol (show p2))
@@ -67,45 +60,35 @@
 prefixAndProps :: Branch -> [(Prefix,S.PropSymbol)]
 prefixAndProps br =
   [(pr, toPropSymbol e p_) | (pr , p_) <- prPosLitProp ++ prefWitPositive]
- where clashable             = toMap $ clashStr br
-       clashableRelevant     = IntMap.filterWithKey (\k _ -> isInTheModel br k) clashable
-       prPosLitProp          = filter (isPositiveProp . snd) $ map fst $ flatten $ DMap clashableRelevant
-       --
-       witMap = toMap $ brWitnesses br
-       witMapRelevant = IntMap.filterWithKey (\k _ -> isInTheModel br k) witMap
-       prefWitPositive = filter (isPositiveProp . snd) $ map fst $ flatten $ DMap witMapRelevant
-       --
-       e = encoding br
-
-completeModel :: Encoding -> RelInfo -> Model -> Model
-completeModel e relI m = completeTransitivity e relI $ completeSymmetry e relI m
-
-completeTransitivity :: Encoding -> RelInfo -> Model -> Model
-completeTransitivity e relI m = m{M.succs = \rs@(S.RelSymbol r) w
-                                                 -> if isTransitive relI (int e r)
-                                                      then getTransClos (M.succs m) rs w
-                                                      else M.succs m rs w}
+ where
+  litsRelevant = I.filterWithKey (\k _ -> isInTheModel br k) (literals br)
+  prPosLitProp = filter (isPositiveProp . snd) $ map fst $ flatten $ litsRelevant
+  --
+  witMap = brWitnesses br
+  witMapRelevant = I.filterWithKey (\k _ -> isInTheModel br k) witMap
+  prefWitPositive = filter (isPositiveProp . snd) $ map fst $ flatten $ witMapRelevant
+  --
+  e = encoding br
 
-completeSymmetry :: Encoding -> RelInfo -> Model -> Model
-completeSymmetry e relI m = m{M.succs = \rs@(S.RelSymbol r) w
-                                             -> if isSymmetric relI (int e r)
-                                                  then getSymClos (M.worlds m) (M.succs m) rs w
-                                                  else M.succs m rs w}
+completeTrans :: Encoding -> RelInfo -> Model -> Model
+completeTrans e relI m
+ = m{M.succs = \rs@(S.RelSymbol r) w
+                 -> if isTransitive relI (int e r)
+                     then getTransClos (M.succs m) rs w
+                     else M.succs m rs w}
 
 getTransClos :: (Ord w) => (r -> w -> Set w) -> r -> w -> Set w
 getTransClos succs_ r_ w_
  = go Set.empty Set.empty succs_ r_ w_
- where go seen todo succs r w
-        = case Set.minView todo1 of
-           Nothing                -> seen
-           Just (nextWorld,todo2) -> go (Set.insert nextWorld seen) todo2 succs r nextWorld
-          where todo1  = (succs r w `Set.union` todo) `Set.difference` seen
-
-getSymClos :: (Ord w) => Set w -> (r -> w -> Set w) -> r -> w -> Set w
-getSymClos worlds succs_ r_ w_
- = succs_ r_ w_ `Set.union` syms
-    where syms = Set.filter (hasAsSuccessor r_ w_) worlds
-          hasAsSuccessor rel world2 world1 = Set.member world2 $ succs_ rel world1
+ where
+  go seen todo succs r w
+   = case Set.minView todo1 of
+      Nothing                -> seen
+      Just (nextWorld,todo2) -> go (Set.insert nextWorld seen) todo2 succs r nextWorld
+     where todo1  = (succs r w `Set.union` todo) `Set.difference` seen
 
 toDot :: Model -> String
 toDot = toDotStr
+
+get :: a -> Int -> I.IntMap a -> a
+get = I.findWithDefault
diff --git a/src/HTab/Relations.hs b/src/HTab/Relations.hs
--- a/src/HTab/Relations.hs
+++ b/src/HTab/Relations.hs
@@ -1,89 +1,68 @@
 module HTab.Relations
 
-( Relations(..), emptyRels, insertRelation, mergePrefixes,
-  successors, predecessors, allRels, null, linksFromTo )
+( OutRels, emptyRels, insertRelation, mergePrefixes,
+  successors, allRels, null, linksFromTo,
+  showRels )
 
 where
 
-import qualified Data.IntMap as IntMap
+import qualified Data.IntMap as I
 import Data.IntMap ( IntMap )
 
 import qualified Data.List as List
 
-import qualified HTab.DMap as DMap
-import HTab.DMap ( DMap(..) )
+import qualified HTab.DMap as D
+import HTab.DMap ( DMap )
 
 import HTab.Formula (Prefix, Rel, DependencySet, dsShow )
 import Prelude hiding (id, pred, succ, null)
 
-type InRel  = DMap {- Prefix Rel -} [(Prefix,DependencySet)]
-type OutRel = DMap {- Prefix Rel -} [(Prefix,DependencySet)]
-
-data Relations =  Relations {  inRel :: InRel ,
-                              outRel :: OutRel }
+type OutRels = DMap {- Prefix Rel -} [(Prefix,DependencySet)]
 
-emptyRels :: Relations
-emptyRels = Relations { inRel = DMap.empty, outRel = DMap.empty }
+emptyRels :: OutRels
+emptyRels = D.empty
 
-null :: Relations -> Bool
-null = IntMap.null . DMap.toMap . outRel
+null :: OutRels -> Bool
+null = I.null
 
-allRels :: Relations -> [(Prefix,Rel,Prefix)]
-allRels rels = [ (p1,r,p2) | ((p1,r),ds_out_s) <-  DMap.flatten $ outRel rels,
+allRels :: OutRels -> [(Prefix,Rel,Prefix)]
+allRels rels = [ (p1,r,p2) | ((p1,r),ds_out_s) <-  D.flatten rels,
                              (p2,_) <- ds_out_s ]
 
-
-successors :: Relations -> Prefix -> IntMap {- Rel -} [(Prefix,DependencySet)]
-successors rels p = IntMap.findWithDefault IntMap.empty p (DMap.toMap $ outRel rels)
-
-predecessors :: Relations -> Prefix -> IntMap {- Rel -} [(Prefix,DependencySet)]
-predecessors rels p = IntMap.findWithDefault IntMap.empty p (DMap.toMap $ inRel rels)
-
-linksFromTo :: Relations -> Prefix -> Prefix -> [Rel]
+linksFromTo :: OutRels -> Prefix -> Prefix -> [Rel]
 linksFromTo rels p1 p2
-  = map fst $ filter (\(_,p_d_s) -> p2 `elem` map fst p_d_s ) outs  where outs = IntMap.toList $ successors rels p1
+  = List.nub [ r | (pa,r,pb) <- allRels rels, pa == p1, pb == p2]
 
+successors :: OutRels -> Prefix -> IntMap {- Rel -} [(Prefix,DependencySet)]
+successors rels p = I.findWithDefault I.empty p rels
+
 -- assumes you never add twice the same relation
-insertRelation :: Relations -> Prefix -> Rel -> Prefix -> DependencySet -> Relations
+insertRelation :: OutRels -> Prefix -> Rel -> Prefix -> DependencySet -> OutRels
 insertRelation rels p1 r p2 ds =
- let
-  outRelMap = DMap.toMap $ outRel rels
-  inRelMap = DMap.toMap $ inRel rels
-  outRel_
-   = case IntMap.lookup p1 outRelMap of
-      Nothing       -> DMap $ IntMap.insert p1 (IntMap.singleton r [(p2,ds)]) outRelMap
-      Just innerMap
-        -> case IntMap.lookup r innerMap of
-             Nothing             -> DMap $ IntMap.insert p1 (IntMap.insert r [(p2,ds)] innerMap)                outRelMap
-             Just innerInnerList -> DMap $ IntMap.insert p1 (IntMap.insert r ((p2,ds):innerInnerList) innerMap) outRelMap
-  inRel_
-   = case IntMap.lookup p2 inRelMap of
-      Nothing       -> DMap $ IntMap.insert p2 (IntMap.singleton r [(p1,ds)]) inRelMap
-      Just innerMap
-        -> case IntMap.lookup r innerMap of
-            Nothing             -> DMap $ IntMap.insert p2 (IntMap.insert r [(p1,ds)] innerMap)                inRelMap
-            Just innerInnerList -> DMap $ IntMap.insert p2 (IntMap.insert r ((p1,ds):innerInnerList) innerMap) inRelMap
- in
-   Relations {outRel = outRel_ , inRel = inRel_ }
+  case I.lookup p1 rels of
+      Nothing       -> I.insert p1 (I.singleton r [(p2,ds)]) rels
+      Just inner
+        -> case I.lookup r inner of
+             Nothing        -> I.insert p1 (I.insert r [(p2,ds)] inner)           rels
+             Just innerList -> I.insert p1 (I.insert r ((p2,ds):innerList) inner) rels
 
 
-mergePrefixes :: Relations -> Prefix -> Prefix -> DependencySet -> Relations
+mergePrefixes :: OutRels -> Prefix -> Prefix -> DependencySet -> OutRels
 mergePrefixes r pr ur _ | pr == ur = r
-mergePrefixes r pr ur ds
- = let outRel_ = DMap.moveInnerDataDMapPlusDeps ds (outRel r) pr ur
-       inRel_  = DMap.moveInnerDataDMapPlusDeps ds (inRel  r) pr ur
-   in Relations { outRel = outRel_ , inRel = inRel_ }
+mergePrefixes r pr ur ds = D.moveInnerDataDMapPlusDeps ds r pr ur
 
-instance Show Relations where
- show r  = "\nAccesibility: " ++ prettyShowMap_ (DMap.toMap $ outRel r) (\v -> "(" ++ prettyShowMap_rel_bps_x v ++ ")") "\n "
+showRels :: OutRels -> String
+showRels r = "\nRelations: " ++
+              prettyShowMap_ r (\v -> "(" ++ prettyShowMap_rel_bps_x v ++ ")") "\n "
 
 prettyShowMap_ :: (Show y) => IntMap y -> (y -> String) -> String -> String
-prettyShowMap_ dasMap valueShow separator
+prettyShowMap_ m valueShow separator
  = List.intercalate separator $ map (\(k,v) -> show k ++ " -> " ++ valueShow v)
-          $ IntMap.toList dasMap
+          $ I.toList m
 
 prettyShowMap_rel_bps_x :: (Show a) => IntMap {- Rel -} [(a,DependencySet)] -> String
-prettyShowMap_rel_bps_x dasMap
- = List.intercalate ", " $ map (\(r,x_bp_s) -> (++) ("-" ++ show r ++ "-> ") $ List.intercalate ", "
-                                 $ map (\(x,bp) -> show x ++ " " ++ dsShow bp) x_bp_s )
-          $ IntMap.toList dasMap
+prettyShowMap_rel_bps_x m
+ = List.intercalate ", "
+      $ map (\(r,x_bp_s) -> (++) ("-" ++ show r ++ "-> ") $ List.intercalate ", "
+                  $ map (\(x,bp) -> show x ++ " " ++ dsShow bp) x_bp_s )
+      $ I.toList m
diff --git a/src/HTab/RuleId.hs b/src/HTab/RuleId.hs
--- a/src/HTab/RuleId.hs
+++ b/src/HTab/RuleId.hs
@@ -43,7 +43,6 @@
             | R_Down    -- Down-arrow rule
             | R_NegNom  -- Negation before nominal rule
             | R_Exist   -- Existential modality
-            | R_Diff    -- Difference modality
             | R_Discard -- Discarding a formula
             | R_DiscardDown
             | R_DiscardDiaDone
diff --git a/src/HTab/Rules.hs b/src/HTab/Rules.hs
--- a/src/HTab/Rules.hs
+++ b/src/HTab/Rules.hs
@@ -5,30 +5,30 @@
 ) where
 
 import qualified Data.Set as Set
-import qualified Data.Map as Map
 import Data.Maybe ( mapMaybe )
 
-import HTab.Formula( Formula(..), PrFormula(..), showLess, neg,
+import HTab.Formula( Formula(..), PrFormula(..), showLess,
                      Dependency, DependencySet, dsUnion, dsInsert,
                      prefix, Rel, negPr,
-                     Prefix,
+                     Prefix, Nom, showLit,
                      replaceVar, Literal )
-import HTab.Branch( Branch(..), BranchInfo(..), TodoList(..), BlockingMode(..),
+import HTab.Branch( Branch(..), BranchInfo(..), TodoList(..),
                     -- for rules
-                    createNewPref, createNewProp, createNewNomTestRelevance,
+                    createNewNode, createNewNom,
                     addFormulas, addAccFormula,
                     addDiaRuleCheck, addToBlockedDias,
-                    addDownRuleCheck, addDiffRuleCheck,
-                    addParentPrefix, doLazyBranching,
+                    addDownRuleCheck,
+                    doLazyBranching,
                     getUrfatherAndDeps, merge,
                     -- for choosing rule in todo list
-                    isNotBlocked,
+                    patternBlocked,
                     diaAlreadyDone, downAlreadyDone,
                     -- for rules and choosing rule in todo list
                     reduceDisjunctionProposeLazy, getUrfather,
                     ReducedDisjunct(..)
                     )
-import HTab.CommandLine(Params, UnitProp(..), lazyBranching, semBranch, unitProp, strategy)
+import HTab.CommandLine(Params, UnitProp(..),
+                        lazyBranching, semBranch, unitProp, strategy)
 import HTab.RuleId(RuleId(..))
 import qualified HTab.DisjSet as DS
 
@@ -37,29 +37,27 @@
 data Rule =  DiaRule    PrFormula                 -- creates a prefix
            | DisjRule   PrFormula [PrFormula]
            | SemBrRule  PrFormula [PrFormula]
-           | LazyBranchRule PrFormula Prefix Literal [PrFormula]
+           | LazyBrRule PrFormula Prefix Literal [PrFormula]
            | AtRule     PrFormula
            | DownRule   PrFormula
-           | DiffRule   PrFormula Dependency      -- creates a prefix
            | ExistRule  PrFormula                 -- creates a prefix
            | DiscardDownRule PrFormula
            | DiscardDiaDoneRule PrFormula
            | DiscardDiaBlockedRule PrFormula
            | DiscardDisjTrivialRule PrFormula
            | ClashDisjRule DependencySet PrFormula
-           | MergeRule Prefix DS.Pointer DependencySet
+           | MergeRule Prefix Nom DependencySet
            | RoleIncRule Prefix [Rel] Prefix DependencySet
 
 
 instance Show Rule where
-   show (MergeRule pr po _)               = "merge:              " ++ show (pr,po)
+   show (MergeRule pr n _)                = "merge:              " ++ show (pr, showLit n)
    show (DiaRule   todelete)              = "diamond:            " ++ showLess todelete
    show (DisjRule  todelete _ )           = "disjunction:        " ++ showLess todelete
    show (SemBrRule todelete _ )           = "semantic branching: " ++ showLess todelete
    show (AtRule    todelete )             = "at:                 " ++ showLess todelete
    show (DownRule  todelete )             = "down:               " ++ showLess todelete
    show (ExistRule todelete )             = "E:                  " ++ showLess todelete
-   show (DiffRule  todelete _)            = "D:                  " ++ showLess todelete
 
    show (DiscardDownRule todelete)        = "Discard:            " ++ showLess todelete
    show (DiscardDiaDoneRule todelete)     = "Discard done:       " ++ showLess todelete
@@ -68,8 +66,7 @@
 
    show (ClashDisjRule bprs f)     = "Clash:              " ++ show bprs ++ " " ++ show f
    show (RoleIncRule p1 rs p2 _)   = "Role inclusion      " ++ show (p1,rs,p2)
-   show (LazyBranchRule todelete _ _ _)
-                                   = "Lazy Branch "         ++ showLess todelete
+   show (LazyBrRule todelete _ _ _)= "Lazy Branch "         ++ showLess todelete
 
 --
 ruleToId :: Rule -> RuleId
@@ -81,14 +78,13 @@
               (AtRule _ )        -> R_At
               (DownRule _)       -> R_Down
               (ExistRule _)      -> R_Exist
-              (DiffRule _ _)     -> R_Diff
               (DiscardDownRule _)        -> R_DiscardDown
               (DiscardDiaDoneRule _)     -> R_DiscardDiaDone
               (DiscardDiaBlockedRule _)  -> R_DiscardDiaBlocked
               (DiscardDisjTrivialRule _) -> R_DiscardDisjTrivial
               (ClashDisjRule _ _)      -> R_ClashDisj
               (RoleIncRule _ _ _ _)    -> R_RoleInc
-              (LazyBranchRule _ _ _ _) -> R_LazyBranch
+              (LazyBrRule _ _ _ _)     -> R_LazyBranch
 
 -- the rules application strategy is defined here:
 -- the first rule is the one that will be applied at the next tableau step
@@ -106,7 +102,6 @@
   '<' -> applicableDiaRule
   '@' -> applicableAtRule
   'E' -> applicableExistRule
-  'D' -> applicableDiffRule
   'b' -> applicableDownRule
   'r' -> applicableRoleIncRule
   _   -> error "ruleByChar"
@@ -117,9 +112,9 @@
    = do (f,new) <- Set.minView $ diaTodo todos
         if diaAlreadyDone br f
           then       return ( DiscardDiaDoneRule f,    todos{diaTodo = new})
-          else if isNotBlocked br f
-                then return ( DiaRule f,               todos{diaTodo = new})
-                else return ( DiscardDiaBlockedRule f, todos{diaTodo = new})
+          else if patternBlocked br f
+                then return ( DiscardDiaBlockedRule f, todos{diaTodo = new})
+                else return ( DiaRule f,               todos{diaTodo = new})
   applicableAtRule    = do (f,new) <- Set.minView $ atTodo todos
                            return (AtRule f, todos{atTodo = new})
   applicableDownRule  = do (f,new) <- Set.minView $ downTodo todos
@@ -128,15 +123,15 @@
                             else return (DownRule f, todos{downTodo = new})
   applicableExistRule = do (f,new) <- Set.minView $ existTodo todos
                            return (ExistRule f, todos{existTodo = new})
-  applicableDiffRule  = do (f,new) <- Set.minView $ diffTodo todos
-                           return (DiffRule f d, todos{diffTodo = new})
-  applicableRoleIncRule = do ((ds, p1, p2, rs),new) <- Set.minView $ roleIncTodo todos
-                             return (RoleIncRule p1 rs p2 (dsInsert d ds), todos{roleIncTodo = new})
-  applicableMergeRule  = do ((ds,pr,po),new) <- Set.minView $ mergeTodo todos
-                            return (MergeRule pr po ds, todos{mergeTodo = new})
+  applicableRoleIncRule
+   = do ((ds, p1, p2, rs),new) <- Set.minView $ roleIncTodo todos
+        return (RoleIncRule p1 rs p2 (dsInsert d ds), todos{roleIncTodo = new})
+  applicableMergeRule  = do ((ds,pr,n),new) <- Set.minView $ mergeTodo todos
+                            return (MergeRule pr n ds, todos{mergeTodo = new})
   applicableDisjRule
    = case unitProp p of
-      Eager -> {- scan all disjuncts until one can be discarded, reduced to one disjunct or clashes -}
+      Eager -> {- scan all disjuncts until one can be discarded,
+                  reduced to one disjunct or clashes -}
           case mapMaybe (makeInteresting p br d) $ Set.toList $ disjTodo todos of
             ((r,pf):_) -> return (r, todos{disjTodo = Set.delete pf $ disjTodo todos})
             [] -> regularApplicableDisjRule
@@ -153,17 +148,20 @@
           Triviality               -> Just (DiscardDisjTrivialRule df,df)
           Contradiction ds_clash   -> Just (ClashDisjRule (dsUnion ds ds_clash) df,df)
           Reduced new_ds disjuncts mProposed
-            | Set.size disjuncts == 1 -> Just (DisjRule df ( prefix ur newDeps disjuncts ), df)
-            | lazyBranching p && blockMode br /= ChainTwinBlocking
-                         -> case mProposed of
-                             Nothing  -> Nothing
-                             Just lit -> Just (LazyBranchRule df ur lit [PrFormula ur newDeps (Dis disjuncts)], df)
-            | otherwise  -> Nothing
-              where newDeps = dsInsert d $ dsUnion ds new_ds
-                    ur = getUrfather br (DS.Prefix pr)
-            -- TODO should not insert d if the formula was actually not changed
-               -- --> reduceDisjunctionProposeLazy should return a boolean
-               -- -->  or have a constructor "Unchanged" ?
+           | Set.size disjuncts == 1
+              -> Just (DisjRule df ( prefix ur newDeps disjuncts ), df)
+           | lazyBranching p
+              -> case mProposed of
+                  Nothing  -> Nothing
+                  Just lit
+                   -> Just (LazyBrRule df ur lit [PrFormula ur newDeps (Dis disjuncts)],
+                            df)
+           | otherwise  -> Nothing
+             where newDeps = dsInsert d $ dsUnion ds new_ds
+                   ur = getUrfather br (DS.Prefix pr)
+           -- TODO should not insert d if the formula was actually not changed
+              -- --> reduceDisjunctionProposeLazy should return a boolean
+              -- -->  or have a constructor "Unchanged" ?
 
 makeInteresting _ _ _ _ = error "makeInteresting on a non disjunction"
 
@@ -176,12 +174,11 @@
 applyRule p rule br
  = case rule of
     DiaRule (PrFormula pr ds (Dia r f))
-     -> [ addParentPrefix newPr ur br >>?
-          addAccFormula p (dsUnion ds ds2, r, ur, newPr) >>?
+     -> [ addAccFormula p (dsUnion ds ds2, r, ur, newPr) br >>?
           addFormulas p [PrFormula newPr ds f] >>?
           addDiaRuleCheck pr (r,f) newPr >>?
-          createNewPref p ]
-          where newPr      = getNewPref br
+          createNewNode p ]
+          where newPr      = lastPref br + 1
                 (ur,ds2,_) = getUrfatherAndDeps br (DS.Prefix pr)
     DisjRule _ prFormulas ->
             [ addFormulas p [toadd] br |  toadd <- prFormulas ]
@@ -189,61 +186,33 @@
             [ addFormulas p toadds br |  toadds <- go prFormulas [] ]
              where go (hd:tl) negs = (hd:negs):(go tl (negPr hd:negs))
                    go [] _ = []
-    LazyBranchRule _ pr lit prFormulas ->
+    LazyBrRule _ pr lit prFormulas ->
             [ doLazyBranching pr lit prFormulas br ]
     AtRule  (PrFormula _ ds (At n f)) ->
             [ addFormulas p [toadd] br{ nomPrefClasses = equiv }]
             where (ur,ds2,equiv) = getUrfatherAndDeps br (DS.Nominal n)
                   toadd = PrFormula ur (dsUnion ds ds2) f
     DownRule (PrFormula pr ds f@(Down v f2)) ->
-                 [ createNewNomTestRelevance f br >>?
+                 [ createNewNom br >>?
                    addFormulas p [toadd1, toadd2] >>?
                    addDownRuleCheck pr f ]
                   where toadd1 = PrFormula pr ds (replaceVar v newNom f2)
                         toadd2 = PrFormula pr ds $ Lit newNom
                         newNom = nextNom br
-    DiffRule   (PrFormula pr ds_ (D f2)) d ->
-      case Map.lookup f2 (dDiaRlCh br) of
-           Nothing -> [ addDiffRuleCheck f2 Nothing br >>?
-                        createNewPref p >>?
-                        createNewPref p >>?
-                        createNewProp >>?
-                        addFormulas p [ PrFormula newPref1 ds f2,
-                                        PrFormula newPref2 ds f2,
-                                        PrFormula newPref1 ds (      Lit newProp),
-                                        PrFormula newPref2 ds (neg $ Lit newProp) ]
-                        ,
-                        addDiffRuleCheck f2 (Just newProp) br >>?
-                        createNewPref p >>?
-                        createNewProp >>?
-                        addFormulas p [ PrFormula newPref1 ds f2,
-                                        PrFormula newPref1 ds (      Lit newProp),
-                                        PrFormula pr       ds (neg $ Lit newProp) ]
-                      ]
-                       where newPref1 = getNewPref br
-                             newPref2 = newPref1 + 1
-                             newProp  = nextProp br
-           Just (Just diffProp)  -> [addFormulas p [PrFormula pr ds (neg $ Lit diffProp)] br]
-           Just Nothing          -> [BranchOK br]
-           where ds = d `dsInsert` ds_
     ExistRule (PrFormula _ ds (E f2)) ->
-       [addFormulas p [toadd] br >>? createNewPref p]   -- this createNewPref  / getNewPref thing needs to stop
+       [addFormulas p [toadd] br >>? createNewNode p]
        where toadd = PrFormula newPr ds f2
-             newPr = getNewPref br
+             newPr = lastPref br + 1
     DiscardDownRule _         -> [BranchOK br]
     DiscardDiaDoneRule _      -> [BranchOK br]
     DiscardDisjTrivialRule _  -> [BranchOK br]
     DiscardDiaBlockedRule f   -> [addToBlockedDias f br]
 
     ClashDisjRule ds (PrFormula pr ds2 f) -> [BranchClash br pr (dsUnion ds ds2) f]
-    MergeRule pr po ds -> [merge p pr ds po br]
+    MergeRule pr n ds -> [merge p pr ds n br]
     RoleIncRule p1 rs p2 ds ->
      [addAccFormula p (ds, r, p1, p2) br | r <- rs]
     _ -> error $ "applyRule with bad argument: " ++ show rule
-
-
-getNewPref :: Branch -> Prefix
-getNewPref br = lastPref br + 1
 
 disjRule :: Params -> PrFormula -> Branch -> Dependency -> Rule
 disjRule p df@(PrFormula pr ds (Dis fs)) br d
diff --git a/src/HTab/Statistics.hs b/src/HTab/Statistics.hs
--- a/src/HTab/Statistics.hs
+++ b/src/HTab/Statistics.hs
@@ -72,10 +72,11 @@
 defaultStats = Stat{metrics=[closedBranches, ruleApplicationCount],
                     count=0, step=0}
 
---------------------------- Monadic Statistics functions follow ------------------------------
+---------- Monadic Statistics functions follow -------------
 
 
-initialStatisticsStateFor :: (MonadState Statistics m) => (m a -> Statistics -> b) -> m a -> b
+initialStatisticsStateFor :: (MonadState Statistics m) => (m a -> Statistics -> b)
+                                                             -> m a -> b
 initialStatisticsStateFor f = flip f defaultStats
 
 setPrintOutInterval :: Int -> StatisticsState ()
@@ -90,7 +91,6 @@
 
 printOutMetricsFinal :: Statistics -> IO ()
 printOutMetricsFinal stats =
-        do liftIO $ putStrLn "(final statistics)"
            liftIO $ printOutList (metrics stats)
 
 printOutMetrics :: StatisticsStateIO ()
diff --git a/src/HTab/Tableau.hs b/src/HTab/Tableau.hs
--- a/src/HTab/Tableau.hs
+++ b/src/HTab/Tableau.hs
@@ -5,7 +5,8 @@
 import System.Console.CmdArgs ( whenLoud )
 
 import Control.Monad.State(StateT,lift,modify)
-import HTab.Statistics(Statistics,updateStep,printOutMetrics,recordClosedBranch, recordFiredRule)
+import HTab.Statistics(Statistics,updateStep,printOutMetrics,
+                       recordClosedBranch,recordFiredRule)
 import HTab.Branch(BranchInfo(..))
 import HTab.CommandLine(backjumping,Params,configureStats)
 import HTab.Rules(applyRule,applicableRule,ruleToId)
diff --git a/tests/test-example-formulas.hs b/tests/test-example-formulas.hs
--- a/tests/test-example-formulas.hs
+++ b/tests/test-example-formulas.hs
@@ -22,10 +22,9 @@
 
 main :: IO ()
 main =
-  do (sat_dir, sat_no_mod_dir, unsat_dir) <- parseArgs
+  do (sat_dir, unsat_dir) <- parseArgs
      --
      sat_tests        <- map (runExpecting Sat)      <$> frmFiles sat_dir
-     sat_no_mod_tests <- map (runExpecting SatNoMod) <$> frmFiles sat_no_mod_dir
      unsat_tests      <- map (runExpecting Unsat)    <$> frmFiles unsat_dir
      --
      success <- and <$> sequenceUntil not (sat_tests ++ sat_no_mod_tests ++ unsat_tests)
@@ -33,12 +32,12 @@
        then putStrLn "SUCCESS"
        else putStrLn "FAILURE" >> exitFailure
 
-data Expected = Sat | SatNoMod | Unsat deriving (Eq, Show)
+data Expected = Sat | Unsat deriving (Eq, Show)
 
 parseArgs :: IO (FilePath, FilePath, FilePath)
 parseArgs = go =<< getArgs
-    where go [sd, snmd, ud] = return (sd, snmd, ud)
-          go _              = fail "Required args: <sat dir> <sat no model dir> <unsat dir>"
+    where go [sd, ud] = return (sd, ud)
+          go _        = fail "Required args: <sat dir> <unsat dir>"
 
 frmFiles :: FilePath -> IO [FilePath]
 frmFiles dir = map (dir </>) . filter (endsWith ".frm") <$>
@@ -64,7 +63,6 @@
        case (r, exp_result) of
          (FAILURE, Unsat)    -> putStrLn "OK!" >> return True
          (FAILURE, _)        -> putStrLn "FAILED! (unsat)" >> return False
-         (SUCCESS, SatNoMod) -> putStrLn "OK!" >> return True
          (SUCCESS, Sat)      -> do b <- isASatisfyingModel
                                    if b
                                      then do putStrLn "OK!"
