File: DIMINDEX_CONV.doc

package info (click to toggle)
hol-light 20230128-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 45,636 kB
  • sloc: ml: 688,681; cpp: 439; makefile: 302; lisp: 286; java: 279; sh: 251; yacc: 108; perl: 78; ansic: 57; sed: 39; python: 13
file content (32 lines) | stat: -rw-r--r-- 836 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
\DOC DIMINDEX_CONV

\TYPE {DIMINDEX_CONV : conv}

\SYNOPSIS
Computes the {dimindex} for a standard finite type.

\DESCRIBE
Finite types parsed and printed as numerals are provided, and this conversion
when applied to a term of the form {`dimindex (:n)`} returns the theorem
{|- dimindex(:n) = n} where the {n} on the right is a numeral term.

\FAILURE
Fails if the term is not of the form {`dimindex (:n)`} for a standard finite
type.

\EXAMPLE
Here we use a 32-element type, perhaps useful for indexing the bits of a
word:
{
  # DIMINDEX_CONV `dimindex(:32)`;;
  val it : thm = |- dimindex (:32) = 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
dest_finty, DIMINDEX_TAC, HAS_SIZE_DIMINDEX_RULE, mk_finty.

\ENDDOC