let _,_,body,_,_,_ = NCicEnvironment.get_checked_def refer in
aux (0, [], body, s)
| (_, _, C.Const (Ref.Ref (_,
let _,_,body,_,_,_ = NCicEnvironment.get_checked_def refer in
aux (0, [], body, s)
| (_, _, C.Const (Ref.Ref (_,
- (match decofix (fst (reduce ~delta:0 ~subst context (k,e,term,[]))) with
+ let match_head = k,e,term,[] in
+ let reduced,_ = reduce ~delta:0 ~subst context match_head in
+ (match decofix reduced with
| (_, _, C.Const (Ref.Ref (_,Ref.Con (_,j,_))),[]) ->
aux (k, e, List.nth pl (j-1), s)
| (_, _, C.Const (Ref.Ref (_,Ref.Con (_,j,lno))), s')->
let _,params = HExtlib.split_nth lno s' in
aux (k, e, List.nth pl (j-1), params@s)
| (_, _, C.Const (Ref.Ref (_,Ref.Con (_,j,_))),[]) ->
aux (k, e, List.nth pl (j-1), s)
| (_, _, C.Const (Ref.Ref (_,Ref.Con (_,j,lno))), s')->
let _,params = HExtlib.split_nth lno s' in
aux (k, e, List.nth pl (j-1), params@s)
unwind (fst (reduce ~delta ~subst context (0, [], t, [])))
;;
unwind (fst (reduce ~delta ~subst context (0, [], t, [])))
;;
let set_get_relevance f = get_relevance := f;;
(* t1, t2 must be well-typed *)
let set_get_relevance f = get_relevance := f;;
(* t1, t2 must be well-typed *)
- with Invalid_argument _ -> assert false) -> true
+ with Invalid_argument "List.for_all2" ->
+ prerr_endline ("Meta " ^ string_of_int n1 ^
+ " occurrs with local contexts of different lenght\n"^
+ NCicPp.ppterm ~metasenv ~subst ~context t1 ^ " === " ^
+ NCicPp.ppterm ~metasenv ~subst ~context t2);
+ assert false) -> true
let _,relevance = HExtlib.split_nth fail relevance in
let b,relevance = (match relevance with
| [] -> assert false
let _,relevance = HExtlib.split_nth fail relevance in
let b,relevance = (match relevance with
| [] -> assert false
let _,tl2 = HExtlib.split_nth (fail+1) tl2 in
try
HExtlib.list_forall_default3
let _,tl2 = HExtlib.split_nth (fail+1) tl2 in
try
HExtlib.list_forall_default3
tl1 tl2 true relevance
with Invalid_argument _ -> false
else false)
| (C.Appl (hd1::tl1), C.Appl (hd2::tl2)) ->
aux test_eq_only context hd1 hd2 &&
tl1 tl2 true relevance
with Invalid_argument _ -> false
else false)
| (C.Appl (hd1::tl1), C.Appl (hd2::tl2)) ->
aux test_eq_only context hd1 hd2 &&
R.reduce ~delta ~subst context m1,
R.reduce ~delta ~subst context m2
in
R.reduce ~delta ~subst context m1,
R.reduce ~delta ~subst context m2
in
((k1,e1,t1,s1),norm1 as m1),((k2,e2,t2,s2), norm2 as m2)
=
(alpha_eq test_eq_only
((k1,e1,t1,s1),norm1 as m1),((k2,e2,t2,s2), norm2 as m2)
=
(alpha_eq test_eq_only
- convert_machines (put_in_whd (0,[],t1,[]) (0,[],t2,[]))
+ convert_machines test_eq_only (put_in_whd (0,[],t1,[]) (0,[],t2,[]))
match upto, t, l with
| 0, C.Appl l1, _ -> C.Appl (l1 @ l)
| 0, t, [] -> t
| 0, t, _ -> C.Appl (t::l)
match upto, t, l with
| 0, C.Appl l1, _ -> C.Appl (l1 @ l)
| 0, t, [] -> t
| 0, t, _ -> C.Appl (t::l)
- | _, C.Appl (hd::tl), _ -> head_beta_reduce ~delta ~upto hd (tl @ l)
+ | _, C.Meta (n,ctx), _ ->
+ (try
+ let _,_, term,_ = NCicUtils.lookup_subst n subst in
+ head_beta_reduce ~delta ~upto ~subst
+ (NCicSubstitution.subst_meta ctx term) l
+ with NCicUtils.Subst_not_found _ -> if l = [] then t else C.Appl (t::l))
+ | _, C.Appl (hd::tl), _ -> head_beta_reduce ~delta ~upto ~subst hd (tl @ l)
| _, C.Lambda(_,_,bo), arg::tl ->
let bo = NCicSubstitution.subst arg bo in
| _, C.Lambda(_,_,bo), arg::tl ->
let bo = NCicSubstitution.subst arg bo in
| _, C.Const (Ref.Ref (_, Ref.Def height) as re), _
when delta <= height ->
let _, _, bo, _, _, _ = NCicEnvironment.get_checked_def re in
| _, C.Const (Ref.Ref (_, Ref.Def height) as re), _
when delta <= height ->
let _, _, bo, _, _, _ = NCicEnvironment.get_checked_def re in