let cargs_and_recursive_args =
List.rev_map
(function
- name,NCic.Def _ -> assert false
- | name,NCic.Decl (NCic.Const nref)
- | name,NCic.Decl (NCic.Appl (NCic.Const nref::_))
- when
- let NReference.Ref (uri',_) = nref in
- NUri.eq uri uri'
- ->
- let name = mk_id name in
- name, Some (
- CicNotationPt.Appl
- (rec_name ::
- params @
- [p_name] @
- k_names @
- List.map (fun _ -> CicNotationPt.Implicit) (List.tl args) @
- [name]))
- | name,_ -> mk_id name,None
+ _,NCic.Def _ -> assert false
+ | name,NCic.Decl ty ->
+ let context,ty = my_split_prods ~subst:[] [] (-1) ty in
+ match ty with
+ | NCic.Const nref
+ | NCic.Appl (NCic.Const nref::_)
+ when
+ let NReference.Ref (uri',_) = nref in
+ NUri.eq uri uri'
+ ->
+ let abs = List.rev_map (fun id,_ -> mk_id id) context in
+ let name = mk_id name in
+ name, Some (
+ List.fold_right
+ (fun id res ->
+ CicNotationPt.Binder (`Lambda,(id,None),res))
+ abs
+ (CicNotationPt.Appl
+ (rec_name ::
+ params @
+ [p_name] @
+ k_names @
+ List.map (fun _ -> CicNotationPt.Implicit)
+ (List.tl args) @
+ [CicNotationPt.Appl (name::abs)])))
+ | _ -> mk_id name,None
) cargs in
let cargs,recursive_args = List.split cargs_and_recursive_args in
let recursive_args = HExtlib.filter_map (fun x -> x) recursive_args in
| S x_2 ⇒ H_S x_2 (nat_rec Q H_O H_S x_2)
].
+
+ninductive ord: Type ≝
+ OO: ord
+ | OS: ord → ord
+ | OLim: (nat → ord) → ord.
+
+nlet rec ord_rect (Q_: (∀ (x_3: (ord)).Type)) H_OO H_OS H_OLim x_3 on x_3: (Q_ x_3) ≝
+ (match x_3 with [OO ⇒ (H_OO) | (OS x_4) ⇒ (H_OS x_4 (ord_rect Q_ H_OO H_OS H_OLim (x_4))) | (OLim x_6) ⇒ (H_OLim x_6 (λx_5.(ord_rect Q_ H_OO H_OS H_OLim (x_6 x_5))))]).
+
+
+
naxiom P: nat → Prop.
naxiom p: ∀m. P m.