module TC = CicTypeChecker
module D = Deannotate
module UM = UriManager
+module Rd = CicReduction
module P = ProceduralPreprocess
module T = ProceduralTypes
| hd :: tl when length > 0 -> hd :: list_sub start (pred length) tl
| _ -> []
-
(* proof construction *******************************************************)
let lift k n =
let clear_absts m =
let rec aux k n = function
+ | C.AImplicit (_, None) as t -> t
| C.ALambda (id, s, v, t) when k > 0 ->
C.ALambda (id, s, v, aux (pred k) n t)
- | C.ALambda (_, _, _, t) when n > 0 ->
+ | C.ALambda (_, _, _, t) when n > 0 ->
aux 0 (pred n) (lift 1 (-1) t)
- | t when n > 0 -> assert false
- | t -> t
+ | t when n > 0 ->
+ Printf.eprintf "CLEAR: %u %s\n" n (CicPp.ppterm (cic t));
+ assert false
+ | t -> t
in
aux m
in
let lpsno, (_, _, _, constructors) = get_ind_type uri tyno in
let inty, _ = TC.type_of_aux' [] context (cic arg) Un.empty_ugraph in
- let ps = match inty with
+ let ps = match Rd.whd ~delta:true context inty with
| C.MutInd _ -> []
| C.Appl (C.MutInd _ :: args) -> List.map (fake_annotate context) args
| _ -> assert false
| C.AMutConstruct (id, _, _, _, _)
| C.AMeta (id, _, _) -> meta id
| C.ARel (id, _, m, _) ->
- if m = succ (n - k) then hole id else meta id
+ if m = succ (k - n) then hole id else meta id
| C.AAppl (id, ts) ->
let ts = List.map (gen_term k) ts in
if is_meta ts then meta id else C.AAppl (id, ts)