From b06d3badbf5a8aa95e5150c2dc0b3fd44e1269ab Mon Sep 17 00:00:00 2001 From: mlasson Date: Wed, 15 Jul 2015 16:19:01 +0200 Subject: Implementing Herbelin's fix for the "NonPar" bug Hugo Herbelin proposed to modify directly the function "check_correct_par" to simplify commit c12b430 (see the pullrequest's discussion). Note that the constructor "LocalNonPar" has now three arguments (instead of two). In LocalNonPar (n,i,l) n denotes the position among real arguments (ie. ignoring letins), i is the rel index of the expecting argument in the context of parameters and l is the index of the inductive. --- kernel/indtypes.ml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'kernel') diff --git a/kernel/indtypes.ml b/kernel/indtypes.ml index 9c79009dba..8c89abe940 100644 --- a/kernel/indtypes.ml +++ b/kernel/indtypes.ml @@ -339,7 +339,7 @@ type ill_formed_ind = | LocalNonPos of int | LocalNotEnoughArgs of int | LocalNotConstructor - | LocalNonPar of int * int + | LocalNonPar of int * int * int exception IllFormedInd of ill_formed_ind @@ -360,9 +360,9 @@ let explain_ind_err id ntyp env nbpar c nargs err = | LocalNotConstructor -> raise (InductiveError (NotConstructor (env,id,c',mkRel (ntyp+nbpar),nbpar,nargs))) - | LocalNonPar (n,l) -> + | LocalNonPar (n,i,l) -> raise (InductiveError - (NonPar (env,c',n,mkRel (nbpar-n+1), mkRel (l+nbpar)))) + (NonPar (env,c',n,mkRel i, mkRel (l+nbpar)))) let failwith_non_pos n ntypes c = for k = n to n + ntypes - 1 do @@ -391,7 +391,7 @@ let check_correct_par (env,n,ntypes,_) hyps l largs = | _::hyps -> match kind_of_term (whd_betadeltaiota env lpar.(k)) with | Rel w when Int.equal w index -> check (k-1) (index+1) hyps - | _ -> raise (IllFormedInd (LocalNonPar (k+1,l))) + | _ -> raise (IllFormedInd (LocalNonPar (k+1, index, l))) in check (nparams-1) (n-nhyps) hyps; if not (Array.for_all (noccur_between n ntypes) largs') then failwith_non_pos_vect n ntypes largs' -- cgit v1.2.3 From 6000ddffed48b804669a5eae9be7c536bf5e19c5 Mon Sep 17 00:00:00 2001 From: Gregory Malecha Date: Wed, 2 Sep 2015 18:50:09 -0700 Subject: print universes when dumping bytecode. --- kernel/cbytecodes.ml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'kernel') diff --git a/kernel/cbytecodes.ml b/kernel/cbytecodes.ml index 940b5528d3..891d95378b 100644 --- a/kernel/cbytecodes.ml +++ b/kernel/cbytecodes.ml @@ -207,7 +207,8 @@ let rec pp_instr i = prlist_with_sep spc pp_lbl (Array.to_list lblt) ++ str " bodies = " ++ prlist_with_sep spc pp_lbl (Array.to_list lblb)) - | Kgetglobal (id,_u) -> str "getglobal " ++ pr_con id + | Kgetglobal (id,u) -> + str "getglobal " ++ pr_con id ++ str "@{" ++ Univ.Instance.pr Univ.Level.pr u ++ str "}" | Kconst sc -> str "const " ++ pp_struct_const sc | Kmakeblock(n, m) -> -- cgit v1.2.3