(if Sys.file_exists report_fname then Sys.remove report_fname) ;
let och = lazy (open_out report_fname) in
let print_endline s = print_endline_to_channel (Lazy.force och) s in
+ let print_interpretation test =
+ print_endline "## Interpretation dump ##";
+ print_endline "# Disambiguation environment:";
+ print_endline test.eenv;
+ print_endline "# Metasenv:";
+ print_endline test.emetasenv;
+ print_endline "# Term:";
+ print_endline test.eterm;
+ print_endline "# Type:";
+ print_endline test.etype;
+ print_endline "# Reduced term:";
+ print_endline test.ereduced;
+ in
let rec aux =
function
[],[] -> true
| ex::extl, fo::fotl ->
- as_expected_one och ex fo &&
- aux (extl,fotl)
+ let outcome1 = as_expected_one och ex fo in
+ let outcome2 = aux (extl,fotl) in
+ outcome1 && outcome2
| [],found ->
- print_endline "### Too many interpretations found" ;
+ print_endline "### Too many interpretations found:" ;
+ List.iter print_interpretation found;
false
| expected,[] ->
- print_endline "### Too few interpretations found" ;
+ print_endline "### Too few interpretations found:" ;
+ List.iter print_interpretation expected;
false
in
let outcome = aux (expected,found) in
| (S (x: nat)) \Rightarrow (mult (S x) (fact x)) ]
in
(fact 4)
+###### INTERPRETATION NUMBER 1 ######
+### (* disambiguation environment *)
+alias id S = cic:/Coq/Init/Datatypes/nat.ind#1/1/2
+alias id mult = cic:/Coq/Init/Peano/mult.con
+alias id nat = cic:/Coq/Init/Datatypes/nat.ind#1/1
+alias num (instance 0) = "natural number"
### (* METASENV after disambiguation *)
### (* TERM after disambiguation *)
### (* REDUCED disambiguated term *)
(S (
Fix plus {
-plus / 0 : (n:nat)(nat->nat) :=
+plus / 0 : (n:nat)(m:nat)nat :=
[n:nat][m:nat]
<[n0:nat]nat>Cases n of
O => m
end}
(S (
Fix plus {
-plus / 0 : (n:nat)(nat->nat) :=
+plus / 0 : (n:nat)(m:nat)nat :=
[n:nat][m:nat]
<[n0:nat]nat>Cases n of
O => m
end}
O (S (
Fix plus {
-plus / 0 : (n:nat)(nat->nat) :=
+plus / 0 : (n:nat)(m:nat)nat :=
[n:nat][m:nat]
<[n0:nat]nat>Cases n of
O => m
end}
(S (
Fix plus {
-plus / 0 : (n:nat)(nat->nat) :=
+plus / 0 : (n:nat)(m:nat)nat :=
[n:nat][m:nat]
<[n0:nat]nat>Cases n of
O => m
end}
O O)) (S (
Fix plus {
-plus / 0 : (n:nat)(nat->nat) :=
+plus / 0 : (n:nat)(m:nat)nat :=
[n:nat][m:nat]
<[n0:nat]nat>Cases n of
O => m
end}
(S (
Fix plus {
-plus / 0 : (n:nat)(nat->nat) :=
+plus / 0 : (n:nat)(m:nat)nat :=
[n:nat][m:nat]
<[n0:nat]nat>Cases n of
O => m
end}
O O)) O)))))) (S (
Fix plus {
-plus / 0 : (n:nat)(nat->nat) :=
+plus / 0 : (n:nat)(m:nat)nat :=
[n:nat][m:nat]
<[n0:nat]nat>Cases n of
O => m
end}
(S (
Fix plus {
-plus / 0 : (n:nat)(nat->nat) :=
+plus / 0 : (n:nat)(m:nat)nat :=
[n:nat][m:nat]
<[n0:nat]nat>Cases n of
O => m
end}
O (S (
Fix plus {
-plus / 0 : (n:nat)(nat->nat) :=
+plus / 0 : (n:nat)(m:nat)nat :=
[n:nat][m:nat]
<[n0:nat]nat>Cases n of
O => m
end}
(S (
Fix plus {
-plus / 0 : (n:nat)(nat->nat) :=
+plus / 0 : (n:nat)(m:nat)nat :=
[n:nat][m:nat]
<[n0:nat]nat>Cases n of
O => m
end}
O O)) (S (
Fix plus {
-plus / 0 : (n:nat)(nat->nat) :=
+plus / 0 : (n:nat)(m:nat)nat :=
[n:nat][m:nat]
<[n0:nat]nat>Cases n of
O => m
end}
(S (
Fix plus {
-plus / 0 : (n:nat)(nat->nat) :=
+plus / 0 : (n:nat)(m:nat)nat :=
[n:nat][m:nat]
<[n0:nat]nat>Cases n of
O => m
end}
O O)) O)))))) (S (
Fix plus {
-plus / 0 : (n:nat)(nat->nat) :=
+plus / 0 : (n:nat)(m:nat)nat :=
[n:nat][m:nat]
<[n0:nat]nat>Cases n of
O => m
end}
(S (
Fix plus {
-plus / 0 : (n:nat)(nat->nat) :=
+plus / 0 : (n:nat)(m:nat)nat :=
[n:nat][m:nat]
<[n0:nat]nat>Cases n of
O => m
end}
O (S (
Fix plus {
-plus / 0 : (n:nat)(nat->nat) :=
+plus / 0 : (n:nat)(m:nat)nat :=
[n:nat][m:nat]
<[n0:nat]nat>Cases n of
O => m
end}
(S (
Fix plus {
-plus / 0 : (n:nat)(nat->nat) :=
+plus / 0 : (n:nat)(m:nat)nat :=
[n:nat][m:nat]
<[n0:nat]nat>Cases n of
O => m
end}
O O)) (S (
Fix plus {
-plus / 0 : (n:nat)(nat->nat) :=
+plus / 0 : (n:nat)(m:nat)nat :=
[n:nat][m:nat]
<[n0:nat]nat>Cases n of
O => m
end}
(S (
Fix plus {
-plus / 0 : (n:nat)(nat->nat) :=
+plus / 0 : (n:nat)(m:nat)nat :=
[n:nat][m:nat]
<[n0:nat]nat>Cases n of
O => m
end}
O O)) O)))))) (S (
Fix plus {
-plus / 0 : (n:nat)(nat->nat) :=
+plus / 0 : (n:nat)(m:nat)nat :=
[n:nat][m:nat]
<[n0:nat]nat>Cases n of
O => m
end}
(S (
Fix plus {
-plus / 0 : (n:nat)(nat->nat) :=
+plus / 0 : (n:nat)(m:nat)nat :=
[n:nat][m:nat]
<[n0:nat]nat>Cases n of
O => m
end}
O (S (
Fix plus {
-plus / 0 : (n:nat)(nat->nat) :=
+plus / 0 : (n:nat)(m:nat)nat :=
[n:nat][m:nat]
<[n0:nat]nat>Cases n of
O => m
end}
(S (
Fix plus {
-plus / 0 : (n:nat)(nat->nat) :=
+plus / 0 : (n:nat)(m:nat)nat :=
[n:nat][m:nat]
<[n0:nat]nat>Cases n of
O => m
end}
O O)) (S (
Fix plus {
-plus / 0 : (n:nat)(nat->nat) :=
+plus / 0 : (n:nat)(m:nat)nat :=
[n:nat][m:nat]
<[n0:nat]nat>Cases n of
O => m
end}
(S (
Fix plus {
-plus / 0 : (n:nat)(nat->nat) :=
+plus / 0 : (n:nat)(m:nat)nat :=
[n:nat][m:nat]
<[n0:nat]nat>Cases n of
O => m
\forall n:nat. \forall m. n + m = n
+###### INTERPRETATION NUMBER 1 ######
+### (* disambiguation environment *)
+alias id nat = cic:/Coq/Init/Datatypes/nat.ind#1/1
+alias symbol "eq" (instance 0) = "leibnitz's equality"
+alias symbol "plus" (instance 0) = "natural plus"
### (* METASENV after disambiguation *)
### (* TERM after disambiguation *)
(\lambda f. (f 0 (le_n 0))
\lambda n. \lambda H. (refl_equal nat 0))
+###### INTERPRETATION NUMBER 1 ######
+### (* disambiguation environment *)
+alias id le_n = cic:/Coq/Init/Peano/le.ind#1/1/1
+alias id nat = cic:/Coq/Init/Datatypes/nat.ind#1/1
+alias id refl_equal = cic:/Coq/Init/Logic/eq.ind#1/1/1
+alias num (instance 0) = "natural number"
### (* METASENV after disambiguation *)
### (* TERM after disambiguation *)
\lambda f:(\forall n:nat. (\forall H:(le 0 n). (n=n))). (f 0 (le_n 0))
+###### INTERPRETATION NUMBER 1 ######
+### (* disambiguation environment *)
+alias id le = cic:/Coq/Init/Peano/le.ind#1/1
+alias id le_n = cic:/Coq/Init/Peano/le.ind#1/1/1
+alias id nat = cic:/Coq/Init/Datatypes/nat.ind#1/1
+alias num (instance 0) = "natural number"
+alias symbol "eq" (instance 0) = "leibnitz's equality"
### (* METASENV after disambiguation *)
### (* TERM after disambiguation *)
\lambda n:nat.
\lambda H:n=n.\lambda g:(?\to (le n 0))\to True.(g \lambda f.(f n H))
+###### INTERPRETATION NUMBER 1 ######
+### (* disambiguation environment *)
+alias id True = cic:/Coq/Init/Logic/True.ind#1/1
+alias id le = cic:/Coq/Init/Peano/le.ind#1/1
+alias id nat = cic:/Coq/Init/Datatypes/nat.ind#1/1
+alias num (instance 0) = "natural number"
+alias symbol "eq" (instance 0) = "leibnitz's equality"
### (* METASENV after disambiguation *)
### (* TERM after disambiguation *)
match (S O):nat with
[ O \Rightarrow O
| (S x) \Rightarrow false ]
+###### INTERPRETATION NUMBER 1 ######
+### (* disambiguation environment *)
+alias id O = cic:/Coq/Init/Datatypes/nat.ind#1/1/1
+alias id S = cic:/Coq/Init/Datatypes/nat.ind#1/1/2
+alias id bool = cic:/Coq/Init/Datatypes/bool.ind#1/1
+alias id false = cic:/Coq/Init/Datatypes/bool.ind#1/1/2
+alias id nat = cic:/Coq/Init/Datatypes/nat.ind#1/1
### (* METASENV after disambiguation *)
### (* TERM after disambiguation *)
match (le_n O): le with
[ le_n \Rightarrow (refl_equal nat O)
| (le_S x y) \Rightarrow (refl_equal nat O) ]
+###### INTERPRETATION NUMBER 1 ######
+### (* disambiguation environment *)
+alias id O = cic:/Coq/Init/Datatypes/nat.ind#1/1/1
+alias id eq = cic:/Coq/Init/Logic/eq.ind#1/1
+alias id le = cic:/Coq/Init/Peano/le.ind#1/1
+alias id le_n = cic:/Coq/Init/Peano/le.ind#1/1/1
+alias id nat = cic:/Coq/Init/Datatypes/nat.ind#1/1
+alias id refl_equal = cic:/Coq/Init/Logic/eq.ind#1/1/1
### (* METASENV after disambiguation *)
### (* TERM after disambiguation *)
match (le_S 0 0 (le_n 0)): le with
[ le_n \Rightarrow (le_S 0 0 (le_n 0))
| (le_S x y) \Rightarrow (le_S 0 (S x) (le_S 0 x y)) ]
+###### INTERPRETATION NUMBER 1 ######
+### (* disambiguation environment *)
+alias id S = cic:/Coq/Init/Datatypes/nat.ind#1/1/2
+alias id le = cic:/Coq/Init/Peano/le.ind#1/1
+alias id le_S = cic:/Coq/Init/Peano/le.ind#1/1/2
+alias id le_n = cic:/Coq/Init/Peano/le.ind#1/1/1
+alias id nat = cic:/Coq/Init/Datatypes/nat.ind#1/1
+alias num (instance 0) = "natural number"
### (* METASENV after disambiguation *)
### (* TERM after disambiguation *)
match true:bool with
[ true \Rightarrow O
| false \Rightarrow (S O) ]
+###### INTERPRETATION NUMBER 1 ######
+### (* disambiguation environment *)
+alias id O = cic:/Coq/Init/Datatypes/nat.ind#1/1/1
+alias id S = cic:/Coq/Init/Datatypes/nat.ind#1/1/2
+alias id bool = cic:/Coq/Init/Datatypes/bool.ind#1/1
+alias id nat = cic:/Coq/Init/Datatypes/nat.ind#1/1
+alias id true = cic:/Coq/Init/Datatypes/bool.ind#1/1/1
### (* METASENV after disambiguation *)
### (* TERM after disambiguation *)
match O:nat with
[ O \Rightarrow O
| (S x) \Rightarrow (S (S x)) ]
+###### INTERPRETATION NUMBER 1 ######
+### (* disambiguation environment *)
+alias id O = cic:/Coq/Init/Datatypes/nat.ind#1/1/1
+alias id S = cic:/Coq/Init/Datatypes/nat.ind#1/1/2
+alias id nat = cic:/Coq/Init/Datatypes/nat.ind#1/1
### (* METASENV after disambiguation *)
### (* TERM after disambiguation *)
match nil:list with
[ nil \Rightarrow nil
| (cons x y) \Rightarrow (cons x y) ]
+###### INTERPRETATION NUMBER 1 ######
+### (* disambiguation environment *)
+alias id cons = cic:/Algebra/algebra/ListType/list.ind#1/1/2
+alias id list = cic:/Algebra/algebra/ListType/list.ind#1/1
+alias id nil = cic:/Algebra/algebra/ListType/list.ind#1/1/1
+### (* METASENV after disambiguation *)
+_ :? _; _ :? _ |- ?25: Type
+### (* TERM after disambiguation *)
+
+<[x:list{A:=?25[_ ; _]}]list{A:=?25[_ ; _]}>Cases nil{A:=?25[_ ; _]} of
+ nil => nil{A:=?25[_ ; _]}
+ cons => [x:?25[_ ; _]][y:list{A:=?25[x ; _]}](cons{A:=?25[x ; y]} x y)
+end
+### (* TYPE_OF the disambiguated term *)
+([x:list{A:=?25[_ ; _]}]list{A:=?25[_ ; _]} nil{A:=?25[_ ; _]})
+### (* REDUCED disambiguated term *)
+nil{A:=?25[_ ; _]}
+###### INTERPRETATION NUMBER 2 ######
+### (* disambiguation environment *)
+alias id cons = cic:/Coq/Lists/List/list.ind#1/1/2
+alias id list = cic:/Coq/Lists/List/list.ind#1/1
+alias id nil = cic:/Coq/Lists/List/list.ind#1/1/1
+### (* METASENV after disambiguation *)
+_ :? _; _ :? _ |- ?25: Set
+### (* TERM after disambiguation *)
+
+<[x:list{A:=?25[_ ; _]}]list{A:=?25[_ ; _]}>Cases nil{A:=?25[_ ; _]} of
+ nil => nil{A:=?25[_ ; _]}
+ cons => [x:?25[_ ; _]][y:list{A:=?25[x ; _]}](cons{A:=?25[x ; y]} x y)
+end
+### (* TYPE_OF the disambiguated term *)
+([x:list{A:=?25[_ ; _]}]list{A:=?25[_ ; _]} nil{A:=?25[_ ; _]})
+### (* REDUCED disambiguated term *)
+nil{A:=?25[_ ; _]}
+###### INTERPRETATION NUMBER 3 ######
+### (* disambiguation environment *)
+alias id cons = cic:/Coq/Lists/MonoList/list.ind#1/1/2
+alias id list = cic:/Coq/Lists/MonoList/list.ind#1/1
+alias id nil = cic:/Coq/Lists/MonoList/list.ind#1/1/1
### (* METASENV after disambiguation *)
### (* TERM after disambiguation *)
([x:list]list nil)
### (* REDUCED disambiguated term *)
nil
+###### INTERPRETATION NUMBER 4 ######
+### (* disambiguation environment *)
+alias id cons = cic:/Lannion/continuations/weight/specif/list.ind#1/1/2
+alias id list = cic:/Lannion/continuations/weight/specif/list.ind#1/1
+alias id nil = cic:/Lannion/continuations/weight/specif/list.ind#1/1/1
+### (* METASENV after disambiguation *)
+_ :? _; _ :? _ |- ?25: Set
+### (* TERM after disambiguation *)
+
+<[x:list{A:=?25[_ ; _]}]list{A:=?25[_ ; _]}>Cases nil{A:=?25[_ ; _]} of
+ nil => nil{A:=?25[_ ; _]}
+ cons => [x:?25[_ ; _]][y:list{A:=?25[x ; _]}](cons{A:=?25[x ; y]} x y)
+end
+### (* TYPE_OF the disambiguated term *)
+([x:list{A:=?25[_ ; _]}]list{A:=?25[_ ; _]} nil{A:=?25[_ ; _]})
+### (* REDUCED disambiguated term *)
+nil{A:=?25[_ ; _]}
\lambda x:False.
[\lambda h:False. True]
match x:False with []
+###### INTERPRETATION NUMBER 1 ######
+### (* disambiguation environment *)
+alias id False = cic:/Coq/Init/Logic/False.ind#1/1
+alias id True = cic:/Coq/Init/Logic/True.ind#1/1
### (* METASENV after disambiguation *)
### (* TERM after disambiguation *)
match true with
[ true \Rightarrow O
| false \Rightarrow (S O) ]
+###### INTERPRETATION NUMBER 1 ######
+### (* disambiguation environment *)
+alias id O = cic:/Coq/Init/Datatypes/nat.ind#1/1/1
+alias id S = cic:/Coq/Init/Datatypes/nat.ind#1/1/2
+alias id bool = cic:/Coq/Init/Datatypes/bool.ind#1/1
+alias id nat = cic:/Coq/Init/Datatypes/nat.ind#1/1
+alias id true = cic:/Coq/Init/Datatypes/bool.ind#1/1/1
### (* METASENV after disambiguation *)
### (* TERM after disambiguation *)