let c1 = current_size + (String.length name) in
countsubst subst c1
| CE.LocalVar (_,name) -> current_size + (String.length name)
- | CE.Meta (_,name) -> current_size + (String.length name)
+ | CE.Meta (_,name,l) ->
+ List.fold_left
+ (fun i t ->
+ match t with
+ None -> i
+ | Some t' -> aux i t'
+ ) (current_size + String.length name) l
| CE.Num (_,value) -> current_size + (String.length value)
| CE.Appl (_,l) ->
List.fold_left aux current_size l
if tail = [] then
P.Mi (attr,name)
else P.Mrow([],P.Mi (attr,name)::tail)
- | CE.Meta (xref,name) ->
+ | CE.Meta (xref,name,l) ->
let attr = make_attributes [Some "helm","xref"] [xref] in
- if tail = [] then
- P.Mi (attr,name)
- else P.Mrow([],P.Mi (attr,name)::tail)
+ let l' =
+ List.map
+ (function
+ None -> P.Mo [] "_"
+ | Some t -> cexpr2pres t
+ ) l
+ in
+ if tail = [] then
+ P.Mrow ([],P.Mi (attr,name) :: P.Mo ([],"[") :: l' @ [P.Mo ([],"]")])
+ else
+ P.Mrow
+ ([],P.Mi (attr,name):: P.Mo ([],"[") :: l' @ [P.Mo ([],"]")] @ tail)
| CE.Num (xref,value) ->
let attr = make_attributes [Some "helm","xref"] [xref] in
if tail = [] then
if tail = [] then
P.Mi (attr,name)
else P.Mrow ([],P.Mi (attr,name)::tail)
- | CE.Meta (xref,name) ->
+ | CE.Meta (xref,name,l) ->
let attr = make_attributes [Some "helm","xref"] [xref] in
- if tail = [] then
- P.Mi (attr,name)
- else P.Mrow ([],P.Mi (attr,name)::tail)
+ let l' =
+ List.map
+ (function
+ None -> P.Mo [] "_"
+ | Some t -> cexpr2pres t
+ ) l
+ in
+ if tail = [] then
+ P.Mrow ([],P.Mi (attr,name) :: P.Mo ([],"[") :: l' @ [P.Mo ([],"]")])
+ else
+ P.Mrow
+ ([],P.Mi (attr,name):: P.Mo ([],"[") :: l' @ [P.Mo ([],"]")] @ tail)
| CE.Num (xref,value) ->
let attr = make_attributes [Some "helm","xref"] [xref] in
if tail = [] then
let body = conclude2pres p.Con.proof_conclude true false in
let presacontext =
P.Maction([None,"actiontype","toggle" ; None,"selection","1"],
- [P.indented (P.Mtext([None,"mathcolor","Red"],"Proof"));
+ [P.indented
+ (P.Mtext
+ ([None,"mathcolor","Red" ;
+ Some "helm", "xref", p.Con.proof_id],"Proof")) ;
acontext2pres p.Con.proof_apply_context body true]) in
P.Mtable ([None,"align","baseline 1"; None,"equalrows","false";
None,"columnalign","left"],
| Some n -> n) ;
P.Mo [] ":=" ;
proof2pres term2pres p]
- ) context @
+ ) (List.rev context) @
[ P.Mo [] "|-" ] @
[ P.Mi [] (string_of_int n) ;
P.Mo [] ":" ;
Symbol of string option * string * subst option * string option
(* h:xref, name, subst, definitionURL *)
| LocalVar of (string option) * string (* h:xref, name *)
- | Meta of string option * string (* h:xref, name *)
+ | Meta of string option * string * meta_subst (* h:xref, name, meta_subst *)
| Num of string option * string (* h:xref, value *)
| Appl of string option * cexpr list (* h:xref, args *)
| Binder of string option * string * decl * cexpr
def = string * cexpr (* name, body *)
and
subst = (UriManager.uri * cexpr) list
+and
+ meta_subst = cexpr option list
;;
(* NOTATION *)
| C.AVar (id,uri,subst) ->
Symbol (Some id, UriManager.name_of_uri uri,
make_subst subst, Some (UriManager.string_of_uri uri))
- | C.AMeta (id,n,l) -> Meta (Some id,("?" ^ (string_of_int n)))
+ | C.AMeta (id,n,l) ->
+ let l' =
+ List.rev_map
+ (function
+ None -> None
+ | Some t -> Some (acic2cexpr t)
+ ) l
+ in
+ Meta (Some id,("?" ^ (string_of_int n)),l')
| C.ASort (id,s) -> Symbol (Some id,string_of_sort s,None,None)
| C.AImplicit _ -> raise NotImplemented
| C.AProd (id,n,s,t) ->
Symbol of string option * string * (subst option) * string option
(* h:xref, name, subst, definitionURL *)
| LocalVar of string option * string (* h:xref, name *)
- | Meta of string option * string (* h:xref, name *)
+ | Meta of string option * string * meta_subst (* h:xref, name, meta_subst *)
| Num of string option * string (* h:xref, value *)
| Appl of string option * cexpr list (* h:xref, args *)
| Binder of string option *string * decl * cexpr
def = string * cexpr (* name, body *)
and
subst = (UriManager.uri * cexpr) list
+and
+ meta_subst = cexpr option list
;;