Skip to content

Commit

Permalink
Fix constant order in heads.ml
Browse files Browse the repository at this point in the history
As per the OCaml documentation, the order for maps should be total.
I also remove some circumvolutions that were added around eliminators
and canonical names because of this incorrect order.
  • Loading branch information
maximedenes committed Apr 10, 2019
1 parent dcf6560 commit 8fe3213
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pretyping/indrec.ml
Original file line number Diff line number Diff line change
Expand Up @@ -612,13 +612,17 @@ let make_elimination_ident id s = add_suffix id (elimination_suffix s)

let lookup_eliminator ind_sp s =
let kn,i = ind_sp in
let mp,l = KerName.repr (MutInd.canonical kn) in
let mpu = KerName.modpath @@ MutInd.user kn in
let mpc = KerName.modpath @@ MutInd.canonical kn in
let ind_id = (Global.lookup_mind kn).mind_packets.(i).mind_typename in
let id = add_suffix ind_id (elimination_suffix s) in
let l = Label.of_id id in
let knu = KerName.make mpu l in
let knc = KerName.make mpc l in
(* Try first to get an eliminator defined in the same section as the *)
(* inductive type *)
try
let cst =Global.constant_of_delta_kn (KerName.make mp (Label.of_id id)) in
let cst = Constant.make knu knc in
let _ = Global.lookup_constant cst in
ConstRef cst
with Not_found ->
Expand Down

0 comments on commit 8fe3213

Please sign in to comment.