forked from jrh13/hol-light
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a complete replacement, from Andrea Gabrielli and Marco Maggesi,
of the previous arrangements for the definition of finite types of specified size. In place of the former case-by-case approach via "define_finite_type", there is now a pair of type constructors "tybit0" and "tybit1" allowing finite types to be represented schematically in binary, keeping the old scheme only for the base type `:1` defined in "trivia.ml". The parser and printer are modified so that this representation is parsed and printed as before (e.g. what is written `:6` is actually `:(1 tybit1) tybit0`). A conversion "DIMINDEX_CONV", rule "HAS_SIZE_DIMINDEX_RULE" and corresponding tactic "DIMINDEX_TAC" are also provided to compute the `dimindex` function for such types, while syntax constructors and destructors "mk_finty" and "dest_finty" convert between such types and nums. The old "define_finite_type" has been deleted, since it could just be confusing. The same final theorem (without the side-effects) from the call "define_finite_type k" can be obtained using the new setup by "HAS_SIZE_DIMINDEX_RULE(mk_finty(Num.num_of_int k))". In addition, a useful conversion "BITS_ELIM_CONV" is provided for eliminating some stray instances of numeral-constructing constants. Also added two trivial theorems MOD_LT_EQ and MOD_LT_EQ_LT, a new conversional BINOP2_CONV, and missing documentation files for EXPAND_NSUM_CONV and EXPAND_SUM_CONV. Overall new theorems: DIMINDEX_CLAUSES DIMINDEX_TYBIT0 DIMINDEX_TYBIT1 FINITE_1 FINITE_CLAUSES FINITE_TYBIT0 FINITE_TYBIT1 HAS_SIZE_TYBIT0 HAS_SIZE_TYBIT1 MOD_LT_EQ MOD_LT_EQ_LT UNIV_HAS_SIZE_DIMINDEX tybit0_INDUCT tybit0_RECURSION tybit1_INDUCT tybit1_RECURSION
- Loading branch information
Showing
26 changed files
with
673 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
\DOC BINOP2_CONV | ||
|
||
\TYPE {BINOP2_CONV : conv -> conv -> conv} | ||
|
||
\SYNOPSIS | ||
Applies conversions to the two arguments of a binary operator. | ||
|
||
\DESCRIBE | ||
If {c1} is a conversion where {c1 `l`} returns {|- l = l'} and {c2} is a | ||
conversion where {c2 `r`} returns {|- r = r'}, then | ||
{BINOP2_CONV c1 c2 `op l r`} returns {|- op l r = op l' r'}. The | ||
term {op} is arbitrary, but is often a constant such as addition or | ||
conjunction. | ||
|
||
\FAILURE | ||
Never fails when applied to the conversion. But may fail when applied to the | ||
term if one of the core conversions fails or returns an inappropriate theorem | ||
on the subterms. | ||
|
||
\EXAMPLE | ||
{ | ||
# BINOP2_CONV NUM_ADD_CONV NUM_SUB_CONV `(3 + 3) * (10 - 3)`;; | ||
val it : thm = |- (3 + 3) * (10 - 3) = 6 * 7 | ||
} | ||
|
||
\COMMENTS | ||
The special case when the two conversions are the same is more briefly achieved | ||
using {BINOP_CONV}. | ||
|
||
\SEEALSO | ||
ABS_CONV, BINOP_CONV, COMB_CONV, COMB2_CONV, RAND_CONV, RATOR_CONV. | ||
|
||
\ENDDOC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
\DOC BITS_ELIM_CONV | ||
|
||
\TYPE {BITS_ELIM_CONV : conv} | ||
|
||
\SYNOPSIS | ||
Removes stray instances of special constants used in numeral representation | ||
|
||
\DESCRIBE | ||
The HOL Light representation of numeral constants like {`6`} uses a | ||
number of special constants {`NUMERAL`}, {`BIT0`}, {`BIT1`} and {`_0`}, | ||
essentially to represent those numbers in binary. The conversion | ||
{BITS_ELIM_CONV} eliminates any uses of these constants within the given term | ||
not used as part of a standard numeral. | ||
|
||
\FAILURE | ||
Never fails | ||
|
||
\EXAMPLE | ||
{ | ||
# BITS_ELIM_CONV `BIT0(BIT1(BIT1 _0)) = 6`;; | ||
val it : thm = | ||
|- BIT0 (BIT1 (BIT1 _0)) = 6 <=> 2 * (2 * (2 * 0 + 1) + 1) = 6 | ||
|
||
# (BITS_ELIM_CONV THENC NUM_REDUCE_CONV) `BIT0(BIT1(BIT1 _0)) = 6`;; | ||
val it : thm = |- BIT0 (BIT1 (BIT1 _0)) = 6 <=> T | ||
} | ||
|
||
\USES | ||
Mainly intended for internal use in functions doing sophisticated things with | ||
numerals. | ||
|
||
\SEEALSO | ||
ARITH_RULE, ARITH_TAC, NUM_RING. | ||
|
||
\ENDDOC |
Oops, something went wrong.