Thm Module

This module defines the basic mechanisms for logical deduction and theory assertion. As is characteristic of LCF-style theorem provers, this is done by defining an abstract datatype for the internal representation of HOL theorems. The primitive constructors for this datatype are limited to the primitive inference rules and the primitive assertion commands. Any subsequent theorem-creating functions must ultimately be implemented in terms of these constructors. This module is a trusted component of the system.

Types

Type Description

thm

This is the datatype for internal HOL theorems. A theorem consists of a list of assumptions and a conclusion, all of which are boolean terms.

Functions and values

Function or value Description

asms th

Full Usage: asms th

Parameters:
Returns: term list

Returns the hypotheses of a theorem.

th : thm
Returns: term list

concl th

Full Usage: concl th

Parameters:
Returns: term
th : thm
Returns: term

dest_thm arg1

Full Usage: dest_thm arg1

Parameters:
Returns: term list * term

Breaks a theorem into assumption list and conclusion.

arg0 : thm
Returns: term list * term

get_all_axioms ()

Full Usage: get_all_axioms ()

Parameters:
    () : unit

Returns: (string * thm) list

Returns the name and assertion theorem for each asserted axiom.

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

get_all_const_definitions ()

Full Usage: get_all_const_definitions ()

Parameters:
    () : unit

Returns: (string * thm) list

Returns the name and assertion theorem for each defined constant.

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

get_all_const_specification_info ()

Full Usage: get_all_const_specification_info ()

Parameters:
    () : unit

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

get_all_const_specifications ()

Full Usage: get_all_const_specifications ()

Parameters:
    () : unit

Returns: (string list * thm) list

Returns the constant names and assertion theorem for each group of specified constants.

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

get_all_tyconst_definition_info ()

Full Usage: get_all_tyconst_definition_info ()

Parameters:
    () : unit

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

get_all_tyconst_definitions ()

Full Usage: get_all_tyconst_definitions ()

Parameters:
    () : unit

Returns: (string * thm) list

Returns the name and assertion theorem for each defined type constant.

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

get_axiom x

Full Usage: get_axiom x

Parameters:
    x : string

Returns: thm

Returns the assertion theorem for the axiom with the supplied name.

x : string
Returns: thm

get_const_definition x

Full Usage: get_const_definition x

Parameters:
    x : string

Returns: thm

Returns the assertion theorem for the defined constant with the supplied name.

x : string
Returns: thm

get_const_specification x

Full Usage: get_const_specification x

Parameters:
    x : string

Returns: thm

Returns the assertion theorem for the specified constant with the supplied name.

x : string
Returns: thm

get_const_specification_info x

Full Usage: get_const_specification_info x

Parameters:
    x : string

Returns: (string list * thm) * thm
x : string
Returns: (string list * thm) * thm

get_tyconst_definition x

Full Usage: get_tyconst_definition x

Parameters:
    x : string

Returns: thm

Returns the assertion theorem for the defined type constant with the supplied name.

x : string
Returns: thm

get_tyconst_definition_info x

Full Usage: get_tyconst_definition_info x

Parameters:
    x : string

Returns: thm * thm
x : string
Returns: thm * thm

get_tyconst_definition_info0 func x

Full Usage: get_tyconst_definition_info0 func x

Parameters:
    func : string
    x : string

Returns: thm * thm
func : string
x : string
Returns: thm * thm

prim_assume_rule tm

Full Usage: prim_assume_rule tm

Parameters:
Returns: thm

This is the assumption rule. It takes a boolean term, and returns a theorem stating that the term holds under the single assumption of the term itself.

tm : term
Returns: thm

prim_beta_conv tm

Full Usage: prim_beta_conv tm

Parameters:
Returns: thm

This is the beta reduction rule. It takes a lambda abstraction application term, and returns a theorem stating that the application is equal to the lambda abstraction body but with all occurrences of the binding variable replaced with the application's argument, under no assumptions.

tm : term
Returns: thm

prim_disch_rule tm arg2

Full Usage: prim_disch_rule tm arg2

Parameters:
Returns: thm

This is the implication introduction rule. It takes a boolean term and a theorem, and removes the term from the theorem's assumptions (if present) and adds it as an antecedent of the conclusion. Note that the term does not have to be in the assumptions of the supplied theorem for the rule to

tm : term
arg1 : thm
Returns: thm

prim_eq_mp_rule arg1 arg2

Full Usage: prim_eq_mp_rule arg1 arg2

Parameters:
Returns: thm

This is the equality modus ponens rule. It takes an equality theorem and a second theorem, where the equality theorem's LHS is alpha-equivalent to the conclusion of the second theorem. It returns a theorem stating that the equality theorem's RHS holds, under the unioned assumptions of the supplied theorems.

arg0 : thm
arg1 : thm
Returns: thm

prim_inst_rule theta arg2

Full Usage: prim_inst_rule theta arg2

Parameters:
Returns: thm

This is the variable instantiation rule. It takes a variable instantiation list and a theorem, and performs a single parallel instantiation of the free variables in the theorem's assumptions and conclusion, according to the instantiation list. All free occurrences of instantiation list domain elements in the theorem get replaced. Each instantiation list domain element must be a variable, and each range element must have the same type as its corresponding domain element.

theta : (term * term) list
arg1 : thm
Returns: thm

prim_inst_type_rule tytheta arg2

Full Usage: prim_inst_type_rule tytheta arg2

Parameters:
Returns: thm

This is the type variable instantiation rule. It takes a type variable instantiation list and a theorem, and performs a single parallel instantiation of the type variables in the theorem's assumptions and conclusion, according to the instantiation list. All occurrences of instantiation list domain elements in the theorem get replaced. Each instantiation list domain element must be a type variable.

tytheta : (hol_type * hol_type) list
arg1 : thm
Returns: thm

prim_mk_abs_rule v arg2

Full Usage: prim_mk_abs_rule v arg2

Parameters:
Returns: thm

This is the equality congruence rule for lambda abstraction. It takes a variable and an equality theorem, and abstracts the variable from both sides of the theorem. The variable must not occur free in the assumptions of the supplied theorem.

v : term
arg1 : thm
Returns: thm

prim_mk_comb_rule arg1 arg2

Full Usage: prim_mk_comb_rule arg1 arg2

Parameters:
Returns: thm

This is the equality congruence rule for function application. It takes two equality theorems, and applies corresponding sides of the first theorem to the second, unioning the assumptions. The first theorem's LHS/ RHS must be functions with domain type equal to the type of the second theorem's LHS/RHS.

arg0 : thm
arg1 : thm
Returns: thm

prim_mp_rule arg1 arg2

Full Usage: prim_mp_rule arg1 arg2

Parameters:
Returns: thm

This is the modus ponens rule. It takes an implication theorem and a second theorem, where the implication theorem's antecedent is alpha- equivalent to the conclusion of the second theorem. It returns a theorem stating that the implication theorem's consequent holds, under the unioned assumptions of the supplied theorems.

arg0 : thm
arg1 : thm
Returns: thm

prim_new_axiom (x, tm)

Full Usage: prim_new_axiom (x, tm)

Parameters:
    x : string
    tm : term

Returns: thm

This is the primitive axiom assertion command. It takes a string and a term. The string becomes the name of a new axiom in the theory, and must not be an existing axiom name. The term becomes the asserted axiom, and must be of boolean type and must not contain free variables. The resulting assertion theorem states that the supplied boolean term holds, under no assumptions. A note of the axiom is reported, and the assertion theorem is returned.

x : string
tm : term
Returns: thm

prim_new_const_definition (x, tm)

Full Usage: prim_new_const_definition (x, tm)

Parameters:
    x : string
    tm : term

Returns: thm

This is the primitive definition command for constants. It takes a string and a term. The string becomes the name of a new constant in the theory, and must not be the name of an existing constant. The term becomes the definition term for the new constant, and must not contain free vars, and must not contain tyvars that are not in its top-level type. The resulting definition theorem asserts that the new constant equals the supplied term, under no assumptions. A note of the definition is reported, and the definition theorem is returned.

x : string
tm : term
Returns: thm

prim_new_const_specification (xs, th)

Full Usage: prim_new_const_specification (xs, th)

Parameters:
    xs : string list
    th : thm

Returns: thm

This is the primitive specification command for constants. It takes a non-empty string list and an existentially quantified theorem. The strings correspond one-to-one to the names of the new constants to be added to the theory, and must not include any existing constant names. They also correspond one-to-one to the outer-quantified variables of the supplied existential theorem, in the same order, although they potentially have different names. The supplied existential theorem must have no free variables and no assumptions. Furthermore, its outer-quantified variables must each have the same type variables, and the body of the existential must not involve any other type variables.

xs : string list
th : thm
Returns: thm

prim_new_tyconst_definition (x, th0)

Full Usage: prim_new_tyconst_definition (x, th0)

Parameters:
    x : string
    th0 : thm

Returns: thm

This is the primitive definition command for type constants. It takes a string and a theorem. The string becomes the name of a new type constant in the theory, and must not be the name of an existing type constant. The theorem argument must have no assumptions and a conclusion of the form `?v. P v`, where `P` is the characteristic function (prescribing the subset of the representation type that is in bijection with a general instance of the new type constant), and the theorem itself establishes that the subset is non-empty. The predicate `P` must not contain free variables, and its number of type variables becomes the arity of the new type constant.

x : string
th0 : thm
Returns: thm

prim_refl_conv tm

Full Usage: prim_refl_conv tm

Parameters:
Returns: thm

This is the reflexivity rule for equality. It takes a term, and returns a There are no restrictions on the supplied term. `t` -------- |- t = t

tm : term
Returns: thm

the_axioms

Full Usage: the_axioms

Returns: dltree<string, thm> ref

Axioms are stored in a dynamic lookup tree, indexed by axiom name.

Returns: dltree<string, thm> ref

the_const_defs

Full Usage: the_const_defs

Returns: dltree<string, thm> ref

Constant definitions are stored in a dynamic lookup tree, indexed by the name of the constant defined.

Returns: dltree<string, thm> ref

the_const_specs

Full Usage: the_const_specs

Returns: (string list * (thm * thm)) list ref

Constant specifications are stored in an association list, indexed by the list of names of the constants defined.

Returns: (string list * (thm * thm)) list ref

the_tyconst_defs

Full Usage: the_tyconst_defs

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

thm_eq x y

Full Usage: thm_eq x y

Parameters:
Returns: bool
x : thm
y : thm
Returns: bool