+ | GrafiteAst.NDiscriminator (_,_) -> assert false (*(loc, indty) ->
+ if status#ng_mode <> `CommandMode then
+ raise (GrafiteTypes.Command_error "Not in command mode")
+ else
+ let status = status#set_ng_mode `ProofMode in
+ let metasenv,subst,status,indty =
+ GrafiteDisambiguate.disambiguate_nterm None status [] [] [] (text,prefix_len,indty) in
+ let indtyno, (_,_,tys,_,_) = match indty with
+ NCic.Const ((NReference.Ref (_,NReference.Ind (_,indtyno,_))) as r) ->
+ indtyno, NCicEnvironment.get_checked_indtys r
+ | _ -> prerr_endline ("engine: indty expected... (fix this error message)"); assert false in
+ let it = List.nth tys indtyno in
+ let status,obj = NDestructTac.mk_discriminator it status in
+ let _,_,menv,_,_ = obj in
+ (match menv with
+ [] -> eval_ncommand opts status ("",0,GrafiteAst.NQed Stdpp.dummy_loc)
+ | _ -> prerr_endline ("Discriminator: non empty metasenv");
+ status, `New []) *)
+ | GrafiteAst.NInverter (loc, name, indty, selection, sort) ->
+ if status#ng_mode <> `CommandMode then
+ raise (GrafiteTypes.Command_error "Not in command mode")
+ else
+ let metasenv,subst,status,sort = match sort with
+ | None -> [],[],status,NCic.Sort NCic.Prop
+ | Some s -> GrafiteDisambiguate.disambiguate_nterm None status [] [] []
+ (text,prefix_len,s)
+ in
+ assert (metasenv = []);
+ let sort = NCicReduction.whd ~subst [] sort in
+ let sort = match sort with
+ NCic.Sort s -> s
+ | _ -> raise (Invalid_argument (Printf.sprintf "ninverter: found target %s, which is not a sort"
+ (NCicPp.ppterm ~metasenv ~subst ~context:[] sort)))
+ in
+ let status = status#set_ng_mode `ProofMode in
+ let metasenv,subst,status,indty =
+ GrafiteDisambiguate.disambiguate_nterm None status [] [] subst (text,prefix_len,indty) in
+ let indtyno,(_,leftno,tys,_,_) = match indty with
+ NCic.Const ((NReference.Ref (_,NReference.Ind (_,indtyno,_))) as r) ->
+ indtyno, NCicEnvironment.get_checked_indtys r
+ | _ -> prerr_endline ("engine: indty =" ^ NCicPp.ppterm ~metasenv:[] ~subst:[] ~context:[] indty) ; assert false in
+ let it = List.nth tys indtyno in
+ let status,obj = NInversion.mk_inverter name true it leftno ?selection sort
+ status status#baseuri in
+ let _,_,menv,_,_ = obj in
+ (match menv with
+ [] ->
+ eval_ncommand opts status ("",0,GrafiteAst.NQed Stdpp.dummy_loc)
+ | _ -> assert false)
+ | GrafiteAst.NUnivConstraint (loc,u1,u2) ->
+ eval_add_constraint status [`Type,u1] [`Type,u2]