summaryrefslogtreecommitdiff
path: root/plugins/firstorder
diff options
context:
space:
mode:
authorGravatar Enrico Tassi <gareuselesinge@debian.org>2015-07-15 10:36:12 +0200
committerGravatar Enrico Tassi <gareuselesinge@debian.org>2015-07-15 10:36:12 +0200
commit0aa2544d04dbd4b6ee665b551ed165e4fb02d2fa (patch)
tree12e8931a4a56da1a1bdfb89d670f4ba38fe08e1f /plugins/firstorder
parentcec4741afacd2e80894232850eaf9f9c0e45d6d7 (diff)
Imported Upstream version 8.5~beta2+dfsgupstream/8.5_beta2+dfsg
Diffstat (limited to 'plugins/firstorder')
-rw-r--r--plugins/firstorder/formula.mli1
-rw-r--r--plugins/firstorder/instances.ml32
-rw-r--r--plugins/firstorder/sequent.ml2
3 files changed, 14 insertions, 21 deletions
diff --git a/plugins/firstorder/formula.mli b/plugins/firstorder/formula.mli
index 29ea1e77..6c7b0938 100644
--- a/plugins/firstorder/formula.mli
+++ b/plugins/firstorder/formula.mli
@@ -6,7 +6,6 @@
(* * GNU Lesser General Public License Version 2.1 *)
(************************************************************************)
-open Names
open Term
open Context
open Globnames
diff --git a/plugins/firstorder/instances.ml b/plugins/firstorder/instances.ml
index a88778c7..5912f0a0 100644
--- a/plugins/firstorder/instances.ml
+++ b/plugins/firstorder/instances.ml
@@ -113,24 +113,14 @@ let mk_open_instance id idc gl m t=
Name id -> id
| Anonymous -> dummy_bvid in
let revt=substl (List.init m (fun i->mkRel (m-i))) t in
- let rec aux n avoid=
- if Int.equal n 0 then [] else
+ let rec aux n avoid env evmap decls =
+ if Int.equal n 0 then evmap, decls else
let nid=(fresh_id avoid var_id gl) in
- (Name nid,None,dummy_constr)::(aux (n-1) (nid::avoid)) in
- let nt=it_mkLambda_or_LetIn revt (aux m []) in
- let rawt=Detyping.detype false [] env evmap nt in
- let rec raux n t=
- if Int.equal n 0 then t else
- match t with
- GLambda(loc,name,k,_,t0)->
- let t1=raux (n-1) t0 in
- GLambda(loc,name,k,GHole (Loc.ghost,Evar_kinds.BinderType name,Misctypes.IntroAnonymous,None),t1)
- | _-> anomaly (Pp.str "can't happen") in
- let ntt=try
- fst (Pretyping.understand env evmap (raux m rawt))(*FIXME*)
- with e when Errors.noncritical e ->
- error "Untypable instance, maybe higher-order non-prenex quantification" in
- decompose_lam_n_assum m ntt
+ let evmap, (c, _) = Evarutil.new_type_evar env evmap Evd.univ_flexible in
+ let decl = (Name nid,None,c) in
+ aux (n-1) (nid::avoid) (Environ.push_rel decl env) evmap (decl::decls) in
+ let evmap, decls = aux m [] env evmap [] in
+ evmap, decls, revt
(* tactics *)
@@ -159,11 +149,15 @@ let left_instance_tac (inst,id) continue seq=
if m>0 then
pf_constr_of_global id (fun idc ->
fun gl->
- let (rc,ot) = mk_open_instance id idc gl m t in
+ let evmap,rc,ot = mk_open_instance id idc gl m t in
let gt=
it_mkLambda_or_LetIn
(mkApp(idc,[|ot|])) rc in
- generalize [gt] gl)
+ let evmap, _ =
+ try Typing.e_type_of (pf_env gl) evmap gt
+ with e when Errors.noncritical e ->
+ error "Untypable instance, maybe higher-order non-prenex quantification" in
+ tclTHEN (Refiner.tclEVARS evmap) (generalize [gt]) gl)
else
pf_constr_of_global id (fun idc ->
generalize [mkApp(idc,[|t|])])
diff --git a/plugins/firstorder/sequent.ml b/plugins/firstorder/sequent.ml
index 2f7f21e4..7d034db5 100644
--- a/plugins/firstorder/sequent.ml
+++ b/plugins/firstorder/sequent.ml
@@ -209,7 +209,7 @@ open Hints
let extend_with_auto_hints l seq gl=
let seqref=ref seq in
let f p_a_t =
- match p_a_t.code with
+ match repr_auto_tactic p_a_t.code with
Res_pf (c,_) | Give_exact (c,_)
| Res_pf_THEN_trivial_fail (c,_) ->
(try