File: define_finite_type.doc

package info (click to toggle)
hol-light 20131026-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 26,264 kB
  • ctags: 4,620
  • sloc: ml: 400,325; cpp: 438; java: 279; lisp: 261; makefile: 256; sh: 190; yacc: 108; perl: 78; ansic: 57; sed: 39
file content (43 lines) | stat: -rw-r--r-- 1,169 bytes parent folder | download | duplicates (3)
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
\DOC define_finite_type

\TYPE {define_finite_type : int -> thm}

\SYNOPSIS
Defines a new type of a specified finite size.

\DESCRIBE
The call {define_finite_type n} where {n} is a positive integer defines a new 
type also called simply `{n}', and returns a theorem asserting that its 
universe has size {n}, in the form:
{
  |- (:n) HAS_SIZE n
}
\noindent where {(:n)} is the customary HOL Light printing of the universe set 
{UNIV:n->bool}.

\FAILURE
Fails if {n} is zero or negative, or if there is a type of the same name
(unless it was also defined by the same call for {define_finite_type}, which is 
perfectly permissible), or if the names of the type constructor and destructor
functions are already in use:
{
  mk_auto_define_finite_type_n:num->n
  dest_auto_define_finite_type_n:32->num
}

\EXAMPLE
Here we define a 32-element type, perhaps useful for indexing the bits of a 
word:
{
  # define_finite_type 32;;
  val it : thm = |- (:32) HAS_SIZE 32
}

\USES
In conjunction with Cartesian powers such as {real^3}, where only the size of 
the indexing type is relevant and the simple name {n} is intuitive.

\SEEALSO
define_type, new_type_definition.

\ENDDOC