This module implements the type, term and theorem pretty printers, for outputting quotation representations of internal types/terms/theorems. The printers take into account identifier fixity status and enumeration bracket settings (see 'Names' module), certain special-case theory objects (whose declarations in later modules are anticipated here), and the display modes (see 'DModes' module). This module is a trusted component of the system, since the user will normally rely on it to determine what has been proved and what has been asserted.
Function or value | Description |
|
This gives a preterm for the supplied term, annotated with any types that are needed for printing. If 'fl' is set, then the type of the overall term is taken as given when decided type annotations. Note that the use of 'check_preterm_annotations' on the result removes the need to trust the relatively complicated type annotation routine.
|
|
|
|
|
Full Usage:
need_prec_brkts fl0 (l0, n0) (l1, n1)
Parameters:
bool
l0 : 'a
n0 : 'b
l1 : 'a
n1 : 'b
Returns: bool
|
This is for determining whether precedence brackets are needed for a subexpression. Returns "true" if brackets are needed when going from a construct at parse-level 'l0', precedence 'n0' and extra flag 'fl0' to a construct at parse-level 'l1', precedence 'n1'. If going to a higher parse-level or the same parse-level but higher precedence then no brackets are needed. Flag 'fl0' being set means that brackets are needed if the parse level and precedence are the same.
|
Full Usage:
need_separation ss0 s1
Parameters:
int list
s1 : int
Returns: bool
|
This is for determining whether separation (be it brackets or spacing) is required between juxtaposed tokens, given the boundary classes of their names. The following classification is used: alphanumerics 1 symbolics 2 quoted/other 0 Separation is never required with something of class 0 or with something of a different class. The 'ss0' arg is a list of boundary classes that could juxtapose - in some cases it's easier to consider the list of possibilities rather than work out which one it is, and over-use of separation is always safe.
|
|
|
Full Usage:
print_close_brkt ()
Parameters:
unit
Returns: string
|
|
Full Usage:
print_close_brkt_if b
Parameters:
bool
Returns: string
|
|
|
|
Full Usage:
print_full_preterm0 (fl0, pr0) ptm
Parameters:
bool
pr0 : int * int
ptm : preterm
Returns: string
|
|
Full Usage:
print_open_brkt ()
Parameters:
unit
Returns: string
|
|
Full Usage:
print_open_brkt_if b
Parameters:
bool
Returns: string
|
|
|
|
|
|
Full Usage:
print_pretype0 (ss0, fl0, pr0) pty
Parameters:
int list
fl0 : bool
pr0 : int * int
pty : pretype
Returns: string
|
|
|
|
Full Usage:
print_prim_preterm0 (fl0, pr0) ptm
Parameters:
bool
pr0 : int * int
ptm : preterm
Returns: string
|
|
|
|
|
|
Full Usage:
print_sep x ()
Parameters:
'a
() : unit
Returns: 'a
|
|
Full Usage:
print_seplist print_fn print_sep_fn xs
Parameters:
'a -> string
print_sep_fn : unit -> string
xs : 'a list
Returns: string
|
|
Full Usage:
print_sp_seplist sp print_fn print_sep_fn xs
Parameters:
bool
print_fn : 'a -> string
print_sep_fn : unit -> string
xs : 'a list
Returns: string
|
|
Full Usage:
print_space ()
Parameters:
unit
Returns: string
|
|
Full Usage:
print_space_if b
Parameters:
bool
Returns: string
|
|
Full Usage:
print_splist print_fn xs
Parameters:
'a -> string
xs : 'a list
Returns: string
|
|
|
|
|
|
|
|
|
|
Full Usage:
term_name_form x
Parameters:
string
Returns: int
|
|
Full Usage:
term_printable_name x
Parameters:
string
Returns: string
|
|
|
|
Full Usage:
type_name_form x
Parameters:
string
Returns: int
|
|
Full Usage:
type_printable_name x
Parameters:
string
Returns: string
|
|
Full Usage:
tyvar_printable_name x
Parameters:
string
Returns: string
|
|
Full Usage:
var_printable_name x
Parameters:
string
Returns: string
|
|