type command = CicAst.term CommandAst.command
type script = CicAst.term CommandAst.Script.script
+let fresh_num_instance =
+ let n = ref 0 in
+ function () ->
+ incr n;
+ !n
+;;
+
let choice_of_uri (uri: string) =
let cic = HelmLibraryObjects.term_of_uri (UriManager.uri_of_string uri) in
(uri, (fun _ _ _ -> cic))
PAREN "]" ->
substs
] ->
- (match subst with
- | Some l -> CicAst.Ident (s, l)
- | None -> CicAst.Ident (s, []))
+ CicAst.Ident (s, subst)
]
];
name: [ (* as substituted_name with no explicit substitution *)
]
| "add" LEFTA [ (* nothing here by default *) ]
| "mult" LEFTA [ (* nothing here by default *) ]
+ | "power" LEFTA [ (* nothing here by default *) ]
| "inv" NONA [ (* nothing here by default *) ]
| "simple" NONA
[ sort = sort -> CicAst.Sort sort
| n = substituted_name -> return_term loc n
| PAREN "("; head = term; args = LIST1 term; PAREN ")" ->
return_term loc (CicAst.Appl (head :: args))
- | i = NUM -> return_term loc (CicAst.Num (i, 0))
+ | i = NUM -> return_term loc (CicAst.Num (i, (fresh_num_instance ())))
| IMPLICIT -> return_term loc CicAst.Implicit
| m = META;
substs = [
PAREN "]" ->
return_term loc
(CicAst.Case (t, indty_ident, outtyp, patterns))
+ | PAREN "("; t1 = term; SYMBOL ":"; t2 = term; PAREN ")" ->
+ return_term loc (CicAst.Appl [CicAst.Symbol ("cast", 0); t1; t2])
| PAREN "("; t = term; PAREN ")" -> return_term loc t
]
];