diff options
| author | msozeau | 2009-09-14 16:57:14 +0000 |
|---|---|---|
| committer | msozeau | 2009-09-14 16:57:14 +0000 |
| commit | a3645985be17e9fa8a8a5c4221aea40e189682c2 (patch) | |
| tree | 8f7f99638e715861976c69bb4df0b9bdeda120e2 /library/lib.ml | |
| parent | a764cfdbdfaecaa02f2fff0234fe1a198e0e34b5 (diff) | |
Backtrack on the forced discharge of type class variables introduced
by Context. Now Context has exactly the same semantics as Variables.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12329 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'library/lib.ml')
| -rw-r--r-- | library/lib.ml | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/library/lib.ml b/library/lib.ml index 1a3a07e013..197e4c3f1e 100644 --- a/library/lib.ml +++ b/library/lib.ml @@ -438,24 +438,20 @@ type variable_context = variable_info list type abstr_list = variable_context Names.Cmap.t * variable_context Names.KNmap.t let sectab = - ref ([] : ((Names.identifier * binding_kind * (Term.types * Names.identifier list) option) list * Cooking.work_list * abstr_list) list) + ref ([] : ((Names.identifier * binding_kind) list * Cooking.work_list * abstr_list) list) let add_section () = sectab := ([],(Names.Cmap.empty,Names.KNmap.empty),(Names.Cmap.empty,Names.KNmap.empty)) :: !sectab -let add_section_variable id impl keep = +let add_section_variable id impl = match !sectab with | [] -> () (* because (Co-)Fixpoint temporarily uses local vars *) | (vars,repl,abs)::sl -> - sectab := ((id,impl,keep)::vars,repl,abs)::sl + sectab := ((id,impl)::vars,repl,abs)::sl let extract_hyps (secs,ohyps) = let rec aux = function - | ((id,impl,keep)::idl,(id',b,t)::hyps) when id=id' -> (id',impl,b,t) :: aux (idl,hyps) - | ((id,impl,Some (ty,keep))::idl,hyps) -> - if List.exists (fun (id,_,_) -> List.mem id keep) ohyps then - (id,impl,None,ty) :: aux (idl,hyps) - else aux (idl,hyps) + | ((id,impl)::idl,(id',b,t)::hyps) when id=id' -> (id',impl,b,t) :: aux (idl,hyps) | (id::idl,hyps) -> aux (idl,hyps) | [], _ -> [] in aux (secs,ohyps) @@ -495,13 +491,13 @@ let section_segment_of_constant con = let section_segment_of_mutual_inductive kn = Names.KNmap.find kn (snd (pi3 (List.hd !sectab))) -let rec list_mem_assoc_in_triple x = function +let rec list_mem_assoc x = function | [] -> raise Not_found - | (a,_,_)::l -> compare a x = 0 or list_mem_assoc_in_triple x l + | (a,_)::l -> compare a x = 0 or list_mem_assoc x l let section_instance = function | VarRef id -> - if list_mem_assoc_in_triple id (pi1 (List.hd !sectab)) then [||] + if list_mem_assoc id (pi1 (List.hd !sectab)) then [||] else raise Not_found | ConstRef con -> Names.Cmap.find con (fst (pi2 (List.hd !sectab))) |
