Names Module

This module provides support for classifying HOL names for the purposes of parsing and printing. This consists of tests for basic classes of name and commands for setting identifier fixity and enumeration brackets. This module is a trusted component of the system, since it is used in the implementation of the pretty printer.

Functions and values

Function or value Description

check_bracket_name br

Full Usage: check_bracket_name br

Parameters:
    br : string

br : string

get_all_enum_info ()

Full Usage: get_all_enum_info ()

Parameters:
    () : unit

Returns: ((string * string) * (string * string)) list
() : unit
Returns: ((string * string) * (string * string)) list

get_all_fixities ()

Full Usage: get_all_fixities ()

Parameters:
    () : unit

Returns: (string * fixity) list
() : unit
Returns: (string * fixity) list

get_all_type_fixities ()

Full Usage: get_all_type_fixities ()

Parameters:
    () : unit

Returns: (string * fixity) list
() : unit
Returns: (string * fixity) list

get_enum_bracket_zero br

Full Usage: get_enum_bracket_zero br

Parameters:
    br : string

Returns: string

Gets the closing bracket given the opning one

br : string
Returns: string

get_enum_zero_brackets zero

Full Usage: get_enum_zero_brackets zero

Parameters:
    zero : string

Returns: string * string
zero : string
Returns: string * string

get_enum_zero_op zero

Full Usage: get_enum_zero_op zero

Parameters:
    zero : string

Returns: string
zero : string
Returns: string

get_fixity x

Full Usage: get_fixity x

Parameters:
    x : string

Returns: fixity
x : string
Returns: fixity

get_infix_info x

Full Usage: get_infix_info x

Parameters:
    x : string

Returns: int * assochand
x : string
Returns: int * assochand

get_infix_type_info x

Full Usage: get_infix_type_info x

Parameters:
    x : string

Returns: int * assochand
x : string
Returns: int * assochand

get_type_fixity x

Full Usage: get_type_fixity x

Parameters:
    x : string

Returns: fixity
x : string
Returns: fixity

has_binder_fixity x

Full Usage: has_binder_fixity x

Parameters:
    x : string

Returns: bool
x : string
Returns: bool

has_infix_fixity x

Full Usage: has_infix_fixity x

Parameters:
    x : string

Returns: bool
x : string
Returns: bool

has_infix_type_fixity x

Full Usage: has_infix_type_fixity x

Parameters:
    x : string

Returns: bool
x : string
Returns: bool

has_nonfix_fixity x

Full Usage: has_nonfix_fixity x

Parameters:
    x : string

Returns: bool
x : string
Returns: bool

has_nonfix_type_fixity x

Full Usage: has_nonfix_type_fixity x

Parameters:
    x : string

Returns: bool
x : string
Returns: bool

has_postfix_fixity x

Full Usage: has_postfix_fixity x

Parameters:
    x : string

Returns: bool
x : string
Returns: bool

has_prefix_fixity x

Full Usage: has_prefix_fixity x

Parameters:
    x : string

Returns: bool
x : string
Returns: bool

infix_info fxty

Full Usage: infix_info fxty

Parameters:
Returns: int * assochand
fxty : fixity
Returns: int * assochand

is_alphanum x

Full Usage: is_alphanum x

Parameters:
    x : string

Returns: bool
x : string
Returns: bool

is_alphanum_char1 c

Full Usage: is_alphanum_char1 c

Parameters:
    c : char

Returns: bool
c : char
Returns: bool

is_alphanum_char2 c

Full Usage: is_alphanum_char2 c

Parameters:
    c : char

Returns: bool
c : char
Returns: bool

is_binder_fixity fxty

Full Usage: is_binder_fixity fxty

Parameters:
Returns: bool
fxty : fixity
Returns: bool

is_digit c

Full Usage: is_digit c

Parameters:
    c : char

Returns: bool
c : char
Returns: bool

is_enum_bracket x

Full Usage: is_enum_bracket x

Parameters:
    x : string

Returns: bool
x : string
Returns: bool

is_enum_close x

Full Usage: is_enum_close x

Parameters:
    x : string

Returns: bool
x : string
Returns: bool

is_enum_open x

Full Usage: is_enum_open x

Parameters:
    x : string

Returns: bool
x : string
Returns: bool

is_enum_openclose x

Full Usage: is_enum_openclose x

Parameters:
    x : string

Returns: bool
x : string
Returns: bool

is_infix_fixity fxty

Full Usage: is_infix_fixity fxty

Parameters:
Returns: bool
fxty : fixity
Returns: bool

is_keyword x

Full Usage: is_keyword x

Parameters:
    x : string

Returns: bool
x : string
Returns: bool

is_letter c

Full Usage: is_letter c

Parameters:
    c : char

Returns: bool
c : char
Returns: bool

is_lowercase c

Full Usage: is_lowercase c

Parameters:
    c : char

Returns: bool
c : char
Returns: bool

is_nonfix_fixity fxty

Full Usage: is_nonfix_fixity fxty

Parameters:
Returns: bool
fxty : fixity
Returns: bool

is_numeric x

Full Usage: is_numeric x

Parameters:
    x : string

Returns: bool
x : string
Returns: bool

is_postfix_fixity fxty

Full Usage: is_postfix_fixity fxty

Parameters:
Returns: bool
fxty : fixity
Returns: bool

is_prefix_fixity fxty

Full Usage: is_prefix_fixity fxty

Parameters:
Returns: bool
fxty : fixity
Returns: bool

is_punctuation_char c

Full Usage: is_punctuation_char c

Parameters:
    c : char

Returns: bool
c : char
Returns: bool

is_symbolic x

Full Usage: is_symbolic x

Parameters:
    x : string

Returns: bool
x : string
Returns: bool

is_symbolic_char c

Full Usage: is_symbolic_char c

Parameters:
    c : char

Returns: bool
c : char
Returns: bool

is_unprintable_char c

Full Usage: is_unprintable_char c

Parameters:
    c : char

Returns: bool
c : char
Returns: bool

is_uppercase c

Full Usage: is_uppercase c

Parameters:
    c : char

Returns: bool
c : char
Returns: bool

is_whitespace_char c

Full Usage: is_whitespace_char c

Parameters:
    c : char

Returns: bool
c : char
Returns: bool

precedence_ok fxty

Full Usage: precedence_ok fxty

Parameters:
Returns: bool
fxty : fixity
Returns: bool

reset_fixity x

Full Usage: reset_fixity x

Parameters:
    x : string

This is the term fixity resetting command for variable/constant names. It takes a string, and removes the registered term fixity of the string name, so that any variables or constants with that name get written with nonfix fixity. A note of the fixity change is reported, and unit is returned.

x : string

reset_type_fixity x

Full Usage: reset_type_fixity x

Parameters:
    x : string

This is the type fixity resetting command for type constant names. It takes a string, and removes the registered type fixity of the string name, so that any type constants with that name get written with nonfix fixity. A note of the fixity change is reported, and unit is returned.

x : string

set_enum_brackets (f, zero) (br1, br2)

Full Usage: set_enum_brackets (f, zero) (br1, br2)

Parameters:
    f : string
    zero : string
    br1 : string
    br2 : string

This is the enumeration bracket setting command. It takes two pairs of strings, where the first pair is the name of an enumeration insertion operator constant and the name of an enumeration empty structure constant, and the second pair is the name of the opening and closing enumeration brackets to be associated with these constants. The brackets are registered as the enumeration brackets corresponding to the supplied constants, and become reserved words of the HOL language. A note of the bracket declaration is reported, and unit is returned.

f : string
zero : string
br1 : string
br2 : string

set_fixity (x, fxty)

Full Usage: set_fixity (x, fxty)

Parameters:

This is the term fixity setting command for variable/constant names. It takes a string and a fixity, and registers the term fixity of the string name as the supplied fixity, so that any variables or constants with that name get written with that fixity. Supplying a name that is currently registered with a fixity that is not nonfix will cause failure (except in benign resetting to the same fixity). A note of the fixity change is reported, and unit is returned.

x : string
fxty : fixity

set_type_fixity (x, fxty)

Full Usage: set_type_fixity (x, fxty)

Parameters:

This is the type fixity setting command for type constant names. It takes a string and a fixity, and registers the type fixity of the string name as the supplied fixity, so that any type constants with that name get written with that fixity. Supplying a name that is currently registered with a fixity that is not nonfix will cause failure (except in benign resetting to the same fixity). A note of the fixity change is reported, and unit is returned.

x : string
fxty : fixity

the_enum_brackets

Full Usage: the_enum_brackets

Returns: dltree<string, string> ref

The enumeration bracket database is a secondary database, used during parsing for looking up the empty structure constant name for a given enumeration bracket. This is implemented as a dynamic lookup tree, indexed by enumeration bracket. There are entries for each opening bracket, each closing bracket and for each pair of concatenated corresponding opening and closing brackets. These concatenated pair entries are used by the term quotation parser, to allow empty enumerations appearing in term quotations to have no space between the opening and closing enumeration brackets.

Returns: dltree<string, string> ref

the_enum_db

Full Usage: the_enum_db

Returns: dltree<string, (string * (string * string))> ref

The main enumeration database registers the associations between insertion operator and empty structure constants and opening and closing enumeration brackets. It is implemented as a dynamic lookup tree, indexed by empty structure constant name.

Returns: dltree<string, (string * (string * string))> ref

the_fixities

Full Usage: the_fixities

Returns: dltree<string, fixity> ref

The term fixity database registers the fixity of var/const identifiers. It is implemented as a dynamic lookup tree, indexed by identifier name. Identifiers not occurring in the database have default nonfix fixity.

Returns: dltree<string, fixity> ref

the_type_fixities

Full Usage: the_type_fixities

Returns: dltree<string, fixity> ref

The type fixity database registers the fixity of type constant identifiers. It is implemented as a dynamic lookup tree, indexed by type constant name. Identifiers not occurring in the database have default nonfix fixity.

Returns: dltree<string, fixity> ref