Wrap Module

The primitive inference rules and theory commands have minimal, stripped- down functionality, to make the language and inference kernels as concise as possible and their correctness as easy as possible to justify. This module adds basic wrappers around these primitives, giving the rules step counting and the theory commands benign redefinition and slightly enhanced functionality.

Functions and values

Function or value Description

assume_rule tm

Full Usage: 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. `p` -------- {p} |- p

tm : term
Returns: thm

beta_conv tm

Full Usage: beta_conv tm

Parameters:
Returns: thm

This is the beta reduction conversion. 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. `(\x. t) s` --------------------- |- (\x. t) s = t[s/x]

tm : term
Returns: thm

big_int_of_int x

Full Usage: big_int_of_int x

Parameters:
    x : int

Returns: bigint
x : int
Returns: bigint

disch_rule tm th

Full Usage: disch_rule tm th

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 succeed. `p` A |- q ---------------- A\{p} |- p ==> q See also: undisch_rule, mp_rule.

tm : term
th : thm
Returns: thm

eq_mp_rule th1 th2

Full Usage: eq_mp_rule th1 th2

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. A1 |- p <=> q A2 |- p ------------------------ A1 u A2 |- q See also: mp_rule, eq_imp_rule1, eq_imp_rule2, imp_antisym_rule.

th1 : thm
th2 : thm
Returns: thm

get_all_tyconsts ()

Full Usage: get_all_tyconsts ()

Parameters:
    () : unit

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

get_tyconst_arity x

Full Usage: get_tyconst_arity x

Parameters:
    x : string

Returns: int
x : string
Returns: int

inc_step_total ()

Full Usage: inc_step_total ()

Parameters:
    () : unit

() : unit

inst_rule theta th

Full Usage: inst_rule theta th

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. Binding variables in the resulting theorem are renamed as necessary to avoid variable capture. Note that instantiation list entries that do not apply are simply ignored, as are repeated entries for a given variable (beyond its first entry). If no instantiation list entries apply, then the returned theorem is the same as the input. [(x1,t1);(x2,t2);..] A |- p -------------------------------------- A[t1/x1,t2/x2,..] |- p[t1/x1,t2/x2,..] See also: inst_type_rule, subs_rule, subst_rule.

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

inst_type_rule tytheta th

Full Usage: inst_type_rule tytheta th

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. Binding variables in the resulting theorem are renamed as necessary to avoid variable capture. Note that instantiation list entries that do not apply are simply ignored, as are repeated entries for a given type variable (beyond its first entry). If no instantiation list entries apply, then the returned theorem is the same as the input. [(tv1,ty1);(tv2,ty2);..] A |- p ---------------------------------------------- A[ty1/tv1,ty2/tv2,..] |- p[ty1/tv1,ty2/tv2,..] See also: inst_rule.

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

int_of_big_int x

Full Usage: int_of_big_int x

Parameters:
Returns: int
x : BigInteger
Returns: int

is_int_big_int x

Full Usage: is_int_big_int x

Parameters:
Returns: bool
x : BigInteger
Returns: bool

mk_abs_rule v th

Full Usage: mk_abs_rule v th

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. `x` A |- t1 = t2 [ "x" not free in 'A' ] ------------------------ A |- (\x. t1) = (\x. t2) See also: mk_comb_rule.

v : term
th : thm
Returns: thm

mk_comb_rule th1 th2

Full Usage: mk_comb_rule th1 th2

Parameters:
Returns: thm

mk_comb_rule : thm -> thm -> thm [ Primitive ] 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. A1 |- f1 = f2 A2 |- t1 = t2 ------------------------------ A1 u A2 |- f1 t1 = f2 t2 See also: mk_comb1_rule, mk_comb2_rule, mk_bin_rule, mk_abs_rule.

th1 : thm
th2 : thm
Returns: thm

mp_rule th1 th2

Full Usage: mp_rule th1 th2

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. A1 |- p ==> q A2 |- p ------------------------ A1 u A2 |- q See also: eq_mp_rule, disch_rule, undisch_rule, prove_asm_rule.

th1 : thm
th2 : thm
Returns: thm

new_axiom (x, tm)

Full Usage: new_axiom (x, tm)

Parameters:
    x : string
    tm : term

Returns: thm
x : string
tm : term
Returns: thm

new_const (x, ty)

Full Usage: new_const (x, ty)

Parameters:
Returns: term
x : string
ty : hol_type
Returns: term

new_const_definition tm

Full Usage: new_const_definition tm

Parameters:
Returns: thm
tm : term
Returns: thm

new_const_specification (xs, th)

Full Usage: new_const_specification (xs, th)

Parameters:
    xs : string list
    th : thm

Returns: thm
xs : string list
th : thm
Returns: thm

new_tyconst (x, n)

Full Usage: new_tyconst (x, n)

Parameters:
    x : string
    n : int

Returns: hol_type
x : string
n : int
Returns: hol_type

new_tyconst_definition (x, th)

Full Usage: new_tyconst_definition (x, th)

Parameters:
    x : string
    th : thm

Returns: thm
x : string
th : thm
Returns: thm

ntyvars n

Full Usage: ntyvars n

Parameters:
    n : int

Returns: hol_type list
n : int
Returns: hol_type list

refl_conv tm

Full Usage: refl_conv tm

Parameters:
Returns: thm

This is the reflexivity rule for equality. It takes a term, and returns a theorem stating that this term is equal to itself, under no assumptions. There are no restrictions on the supplied term. `t` -------- |- t = t See also: eq_sym_conv, eq_sym_rule, eq_trans_rule.

tm : term
Returns: thm

reset_step_counter ()

Full Usage: reset_step_counter ()

Parameters:
    () : unit

() : unit

step_counter ()

Full Usage: step_counter ()

Parameters:
    () : unit

Returns: int
() : unit
Returns: int

step_total ()

Full Usage: step_total ()

Parameters:
    () : unit

Returns: int
() : unit
Returns: int

the_absolute_step_total

Full Usage: the_absolute_step_total

Returns: int ref
Returns: int ref

the_relative_step_start

Full Usage: the_relative_step_start

Returns: int ref
Returns: int ref