let get_types uri =
let o,_ = CicEnvironment.get_obj CicUniv.empty_ugraph uri in
match o with
- | Cic.Constant _ -> assert false
- | Cic.Variable _ -> assert false
- | Cic.CurrentProof _ -> assert false
- | Cic.InductiveDefinition (l,_,_) -> l
+ | Cic.InductiveDefinition (l,_,_,_) -> l
+ | _ -> assert false
let name_of_inductive_type uri i =
let types = get_types uri in
in
idref id (Ast.Binder (binder_kind, (n, Some (aux s)), aux t))
| Cic.ACast (id,v,t) ->
- idref id (Ast.Appl [idref id (Ast.Symbol ("cast", -1)); aux v; aux t])
+ idref id (Ast.Appl [idref id (Ast.Symbol ("cast", 0)); aux v; aux t])
| Cic.ALambda (id,n,s,t) ->
idref id (Ast.Binder (`Lambda, (n, Some (aux s)), aux t))
| Cic.ALetIn (id,n,s,t) -> idref id (Ast.LetIn ((n, None), aux s, aux t))
Hashtbl.add symbol_table uri
(fun aid sid args acic2ast ->
Ast.AttributedTerm (`IdRef aid,
- Ast.Appl (Ast.AttributedTerm (`IdRef sid, Ast.Symbol (name, -1)) ::
+ Ast.Appl (Ast.AttributedTerm (`IdRef sid, Ast.Symbol (name, 0)) ::
List.map acic2ast args)))
in
(* eq *)
(fun aid sid args acic2ast ->
Ast.AttributedTerm (`IdRef aid,
Ast.Appl (
- Ast.AttributedTerm (`IdRef sid, Ast.Symbol ("eq", -1)) ::
+ Ast.AttributedTerm (`IdRef sid, Ast.Symbol ("eq", 0)) ::
List.map acic2ast (List.tl args))));
(* exists *)
Hashtbl.add symbol_table HelmLibraryObjects.Logic.ex_XURI
add_symbol "div" HelmLibraryObjects.Reals.rdiv_SURI;
Hashtbl.add symbol_table HelmLibraryObjects.Reals.r0_SURI
(fun aid sid args acic2ast ->
- Ast.AttributedTerm (`IdRef sid, Ast.Num ("0", -1)));
+ Ast.AttributedTerm (`IdRef sid, Ast.Num ("0", 0)));
Hashtbl.add symbol_table HelmLibraryObjects.Reals.r1_SURI
(fun aid sid args acic2ast ->
- Ast.AttributedTerm (`IdRef sid, Ast.Num ("1", -1)));
+ Ast.AttributedTerm (`IdRef sid, Ast.Num ("1", 0)));
(* plus *)
Hashtbl.add symbol_table HelmLibraryObjects.Reals.rplus_SURI
(fun aid sid args acic2ast ->
let appl () =
Ast.AttributedTerm (`IdRef aid,
Ast.Appl (
- Ast.AttributedTerm (`IdRef sid, Ast.Symbol ("plus", -1)) ::
+ Ast.AttributedTerm (`IdRef sid, Ast.Symbol ("plus", 0)) ::
List.map acic2ast args))
in
let rec aux acc = function
| Cic.AConst (_, uri, []) when
UriManager.eq uri HelmLibraryObjects.Reals.r1_URI ->
Ast.AttributedTerm (`IdRef aid,
- Ast.Num (string_of_int (acc + 2), -1))
+ Ast.Num (string_of_int (acc + 2), 0))
| Cic.AAppl (_, Cic.AConst (_, uri, []) :: args) when
UriManager.eq uri HelmLibraryObjects.Reals.rplus_URI ->
aux (acc + 1) args