function
(k, e, _, C.Rel n, s) as config ->
let config' =
- try
- Some (RS.from_env (List.nth e (n-1)))
- with
- Failure _ ->
- try
- begin
- match List.nth context (n - 1 - k) with
- None -> assert false
- | Some (_,C.Decl _) -> None
- | Some (_,C.Def (x,_)) -> Some (0,[],[],S.lift (n - k) x,[])
- end
- with
- Failure _ -> None
+ if not delta then None
+ else
+ try
+ Some (RS.from_env (List.nth e (n-1)))
+ with
+ Failure _ ->
+ try
+ begin
+ match List.nth context (n - 1 - k) with
+ None -> assert false
+ | Some (_,C.Decl _) -> None
+ | Some (_,C.Def (x,_)) -> Some (0,[],[],S.lift (n - k) x,[])
+ end
+ with
+ Failure _ -> None
in
(match config' with
Some (k',e',ens',t',s') -> reduce (k',e',ens',t',s'@s)