X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Focaml%2Fcic_transformations%2FcicAstPp.ml;h=bb365d73ccf70f14bf38e5c4e166d2bdcfd9396d;hb=de9a83f286eee12117fb478ea2db18f7faebac9a;hp=b1e6588766beeeb2b9b3fa1414cdfb2e06ec5871;hpb=97790db29ad0dc3d31e61acc69894aa5e6109a9e;p=helm.git diff --git a/helm/ocaml/cic_transformations/cicAstPp.ml b/helm/ocaml/cic_transformations/cicAstPp.ml index b1e658876..bb365d73c 100644 --- a/helm/ocaml/cic_transformations/cicAstPp.ml +++ b/helm/ocaml/cic_transformations/cicAstPp.ml @@ -27,7 +27,7 @@ open Printf let pp_binder = function | `Lambda -> "lambda" - | `Pi -> "pi" + | `Pi -> "Pi" | `Exists -> "exists" | `Forall -> "forall" @@ -38,6 +38,11 @@ let rec pp_term = function | CicAst.Appl terms -> sprintf "(%s)" (String.concat " " (List.map pp_term terms)) + | CicAst.Binder (`Forall, (Cic.Anonymous, typ), body) + | CicAst.Binder (`Pi, (Cic.Anonymous, typ), body) -> + sprintf "(%s \\to %s)" + (match typ with None -> "?" | Some typ -> pp_term typ) + (pp_term body) | CicAst.Binder (kind, var, body) -> sprintf "\\%s %s.%s" (pp_binder kind) (pp_capture_variable var) (pp_term body) @@ -57,8 +62,12 @@ let rec pp_term = function sprintf "%s = %s" (pp_capture_variable var) (pp_term body)) definitions)) (pp_term term) - | CicAst.Ident (name, []) -> name - | CicAst.Ident (name, substs) -> sprintf "%s[%s]" name (pp_substs substs) + | CicAst.Ident (name, Some []) | CicAst.Ident (name, None) + | CicAst.Uri (name, Some []) | CicAst.Uri (name, None) -> + name + | CicAst.Ident (name, Some substs) + | CicAst.Uri (name, Some substs) -> + sprintf "%s \\subst [%s]" name (pp_substs substs) | CicAst.Implicit -> "?" | CicAst.Meta (index, substs) -> sprintf "%d[%s]" index @@ -71,11 +80,13 @@ let rec pp_term = function | CicAst.Sort `CProp -> "CProp" | CicAst.Symbol (name, _) -> name -and pp_subst (name, term) = sprintf "%s := %s" name (pp_term term) + | CicAst.UserInput -> "" + +and pp_subst (name, term) = sprintf "%s \\Assign %s" name (pp_term term) and pp_substs substs = String.concat "; " (List.map pp_subst substs) and pp_pattern ((head, vars), term) = - sprintf "%s -> %s" + sprintf "%s \\Rightarrow %s" (match vars with | [] -> head | _ ->