let analyze_type context t =
let rec aux =
function
- Cic.Sort _ -> `Sort
+ Cic.Sort s -> `Sort s
| Cic.Prod (_,_,t) -> aux t
| _ -> `SomethingElse
in
match aux t with
- `Sort -> `Sort
+ `Sort _ as res -> res
| `SomethingElse ->
match
fst(CicTypeChecker.type_of_aux' [] context t CicUniv.oblivion_ugraph)
| C.Cast (v,t) -> pp v context
| C.Lambda (b,s,t) ->
(match analyze_type context s with
- `Sort
+ `Sort _
| `Statement -> pp t ((Some (b,Cic.Decl s))::context)
| `Type -> "(function " ^ ppname b ^ " -> " ^ pp t ((Some (b,Cic.Decl s))::context) ^ ")")
| C.LetIn (b,s,t) ->
function
Cic.Prod (n,s,t) ->
(match analyze_type context s with
- `Statement
- | `Sort ->
+ `Sort Cic.Prop -> args ((Some (n,Cic.Decl s))::context) t
+ | `Statement
+ | `Sort _ ->
let n =
match n with
Cic.Anonymous -> Cic.Anonymous
match obj with
C.Constant (name, Some t1, t2, params, _) ->
(match analyze_type [] t2 with
- `Statement -> ""
+ `Sort Cic.Prop
+ | `Statement -> ""
| `Type
- | `Sort -> "let " ^ ppid name ^ " =\n" ^ pp t1 [] ^ "\n")
+ | `Sort _ -> "let " ^ ppid name ^ " =\n" ^ pp t1 [] ^ "\n")
| C.Constant (name, None, ty, params, _) ->
(match analyze_type [] ty with
- `Statement -> ""
- | `Sort -> "type " ^ ppid name ^ "\n"
+ `Sort Cic.Prop
+ | `Statement -> ""
+ | `Sort _ -> "type " ^ ppid name ^ "\n"
| `Type -> "let " ^ ppid name ^ " = assert false\n")
| C.Variable (name, bo, ty, params, _) ->
"Variable " ^ name ^