let u = OCic2NCic.nuri_of_ouri u in
indent := 0;
match NCicLibrary.get_obj u with
- | _,_,_,_,NCic.Constant (_,_,Some bo, ty, _) ->
+ | _,_,_,_,NCic.Constant (_,_,_, ty, _) ->
let rec intros = function
| NCic.Prod (name, s, t) ->
let ctx, t = intros t in
ctx @ [(name, (NCic.Decl s))] , t
| t -> [], t
in
+ let rec perforate ctx menv = function
+ | NCic.Appl (NCic.Const (NReference.Ref (u,_))::ty::_)
+ when NUri.string_of_uri u = "cic:/matita/tests/hole.con" ->
+ NCicMetaSubst.mk_meta menv ctx ty
+ | t ->
+ NCicUntrusted.map_term_fold_a
+ (fun e ctx -> e::ctx) ctx perforate menv t
+ in
let ctx, ity = intros ty in
+ let menv, pty = perforate [] [] ty in
+(*
let sty, menv, _ =
NCicMetaSubst.saturate ~delta:max_int [] ctx ty 0
in
+*)
let ctx, ty = intros ty in
let whd ty =
match ty with
let metasenv, subst =
try
(* prerr_endline ("INIZIO: " ^ NUri.string_of_uri u); *)
- NCicUnification.unify menv [] ctx ity (whd sty)
+ NCicUnification.unify menv [] ctx ity sty
with
| NCicUnification.Uncertain msg
| NCicUnification.UnificationFailure msg
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "nat/plus.ma".
+
+definition hole : ∀A:Type.A → A ≝ λA.λx.x.
+
+inductive pippo (T:Type) (x:T) : Prop ≝ .
+
+axiom A: Type.
+axiom B:A.
+
+axiom foo : \forall x: (hole ? A).pippo (hole ? A) x.
+
+axiom foo: (λx,y:A. pippo (hole ? A) x y)
+ (hole ? B) (hole ? B).
+
+axiom foo: λx:(hole ? Type).λy:(hole ? Type). pippo (hole ? Type) x y.
+
+axiom foo: (λx,y.(λz. z x + z (x+y)) (λw:nat.hole ? w)) = λx,y.x. (* KO, delift rels only *)
+axiom foo: (λx,y.(λz. z (x+y) + z x) (λw:nat.hole ? w)) = λx,y.x. (* OK *)
+
+
+axiom foo: (λx,y.(λz. z x + z y) (λw:nat.hole ? w)) = λx,y.x. (* OK *)
+
let inside c = indent := !indent ^ String.make 1 c;;
let outside () = indent := String.sub !indent 0 (String.length !indent -1);;
-(*
let pp s =
prerr_endline (Printf.sprintf "%-20s" !indent ^ " " ^ s);;
-*)
-let pp _ = ();;
+(* let pp _ = ();; *)
let rec beta_expand num test_eq_only swap metasenv subst context t arg =
let rec aux (n,context,test_eq_only as k) (metasenv, subst as acc) t' =
(* by cumulativity when unify(?,Type_i)
* we could ? := Type_j with j <= i... *)
let subst = (n, (name, ctx, t, ty)) :: subst in
+ pp ("?"^string_of_int n^" := "^NCicPp.ppterm
+ ~metasenv ~subst ~context:ctx t);
let metasenv =
List.filter (fun (m,_) -> not (n = m)) metasenv
in