File: extend_basic_convs.doc

package info (click to toggle)
hol-light 20190729-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 42,676 kB
  • sloc: ml: 637,078; cpp: 439; makefile: 301; lisp: 286; java: 279; sh: 239; yacc: 108; perl: 78; ansic: 57; sed: 39; python: 13
file content (44 lines) | stat: -rw-r--r-- 1,341 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
\DOC extend_basic_convs

\TYPE {extend_basic_convs : string * (term * conv) -> unit}

\SYNOPSIS
Extend the set of default conversions used by rewriting and simplification.

\DESCRIBE
The HOL Light rewriter ({REWRITE_TAC} etc.) and simplifier ({SIMP_TAC} etc.) 
have default sets of (conditional) equations and other conversions that are 
applied by default, except in the {PURE_} variants. The latter are normally
term transformations that cannot be expressed as single (conditional or
unconditional) rewrite rules. A call to 
{
  extend_basic_convs("name",(`pat`,conv))
}
will add the conversion {conv} into the default set, using the name {name} to
refer to it and restricting it to subterms encountered that match {pat}.

\FAILURE
Never fails.

\EXAMPLE
By default, no arithmetic is done in rewriting, though rewriting with the 
theorem {ARITH} gives that effect. 
{
  # REWRITE_CONV[] `x = 1 + 2 + 3 + 4`;;
  val it : thm = |- x = 1 + 2 + 3 + 4 <=> x = 1 + 2 + 3 + 4
}
You can add {NUM_ADD_CONV} to the set of default conversions by
{
  # extend_basic_convs("addition on nat",(`m + n:num`,NUM_ADD_CONV));; 
  val it : unit = ()
}
\noindent and now it happens by default:
{
  # REWRITE_CONV[] `x = 1 + 2 + 3 + 4`;;
  val it : thm = |- x = 1 + 2 + 3 + 4 <=> x = 10
}

\SEEALSO
basic_convs, extend_basic_rewrites, set_basic_convs.

\ENDDOC