Skip to content

Commit ab0ac94

Browse files
[axe] Organize some supporting rules.
1 parent 02fadb4 commit ab0ac94

File tree

6 files changed

+49
-10
lines changed

6 files changed

+49
-10
lines changed

books/kestrel/axe/arithmetic-rules-axe.lisp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
(in-package "ACL2")
1212

13+
;; See also basic-rules.lisp
14+
1315
(defthm equal-of-+-combine-constants-alt
1416
(implies (syntaxp (and (quotep k1)
1517
(quotep k2)))

books/kestrel/axe/basic-rules.lisp

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,17 @@
1212

1313
(in-package "ACL2")
1414

15-
(include-book "kestrel/utilities/if" :dir :system)
15+
;(include-book "kestrel/utilities/if" :dir :system) ; drop?
1616
(include-book "kestrel/booleans/bool-fix-def" :dir :system)
17+
(local (include-book "kestrel/arithmetic-light/mod" :dir :system))
1718

1819
;; TODO: Rephrase some of these
1920

2021
;;theorems about built-in ACL2 functions. Many of these are things that ACL2
2122
;;knows by type reasoning (but Axe does not have type reasoning).
2223

24+
;; See also arithmetic-rules-axe.lisp
25+
2326
(defthmd rationalp-of-len
2427
(rationalp (len x)))
2528

@@ -31,6 +34,12 @@
3134
(defthmd acl2-numberp-of-*
3235
(acl2-numberp (* x y)))
3336

37+
;dup
38+
(defthm integerp-of-*
39+
(implies (and (integerp x)
40+
(integerp y))
41+
(integerp (* x y))))
42+
3443
(defthmd acl2-numberp-of-unary--
3544
(acl2-numberp (unary-- x)))
3645

@@ -189,3 +198,12 @@
189198
(defthmd acl2-numberp-when-signed-byte-p
190199
(implies (signed-byte-p size x) ; size is a free var
191200
(acl2-numberp x)))
201+
202+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
203+
204+
;dup
205+
(defthm integerp-of-mod
206+
(implies (integerp y)
207+
(equal (integerp (mod x y))
208+
(integerp (fix x))))
209+
:hints (("Goal" :in-theory (enable mod))))

books/kestrel/axe/def-simplified.lisp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
(include-book "choose-rules")
3030
;(include-book "rules-in-rule-lists")
3131
;; The rest of these include-books are to bring in everything included in def-simplified-rules below:
32+
(include-book "kestrel/utilities/if" :dir :system)
3233
(include-book "rules1") ; for BV-ARRAY-CLEAR-OF-BV-ARRAY-CLEAR-SAME
3334
(include-book "basic-rules") ;for equal-same
3435
(include-book "boolean-rules-axe") ;for MYIF-BECOMES-BOOLIF-AXE

books/kestrel/axe/rule-lists.lisp

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,6 @@
189189
not-of-if
190190

191191
fix-when-acl2-numberp
192-
acl2-numberp-of-+
193-
acl2-numberp-of-fix
194-
integerp-of-ifix
195192
= ; introduces EQUAL
196193
eql ; introduces EQUAL ; EQL can arise from CASE
197194
eq ; introduces EQUAL
@@ -203,7 +200,7 @@
203200
double-rewrite ; todo: or remove these when we make the axe-rules
204201
return-last
205202

206-
not-stringp-of-cons)
203+
)
207204
(mv-nth-rules)
208205
(boolean-rules-safe)
209206
(booleanp-rules)))
@@ -252,7 +249,24 @@
252249
integerp-of--
253250
integerp-of-+
254251

255-
integerp-when-unsigned-byte-p-free))
252+
integerp-when-unsigned-byte-p-free
253+
254+
;; todo: acl2-numberp-when-integerp
255+
;; todo: acl2-numberp-when-natp ?
256+
acl2-numberp-of-fix
257+
acl2-numberp-of-+
258+
acl2-numberp-of-*
259+
acl2-numberp-of-unary--
260+
acl2-numberp-of-mod
261+
acl2-numberp-of-floor
262+
263+
integerp-of-ifix
264+
integerp-of-+
265+
integerp-of-*
266+
integerp-of-mod
267+
268+
not-stringp-of-cons
269+
))
256270

257271
(defun safe-trim-rules ()
258272
(declare (xargs :guard t))
@@ -2216,6 +2230,7 @@
22162230
;;normalize boolif nests that are really ands?
22172231

22182232
;; TODO: add many more rules to this?
2233+
; not used?
22192234
(defun arithmetic-rules ()
22202235
(declare (xargs :guard t))
22212236
'(fold-consts-in-+
@@ -2284,10 +2299,10 @@
22842299
bvplus-of-unary-minus
22852300
bvchop-of-+-becomes-bvplus
22862301
;move these to type-rules:
2287-
integerp-of-*
2288-
acl2-numberp-of-+
2289-
acl2-numberp-of-*
2290-
acl2-numberp-of-unary--
2302+
;; integerp-of-*
2303+
;; acl2-numberp-of-+
2304+
;; acl2-numberp-of-*
2305+
;; acl2-numberp-of-unary--
22912306
fix
22922307
integerp-of-+-when-integerp-1-cheap
22932308
mod-becomes-bvchop-when-power-of-2p

books/kestrel/axe/rules-in-rule-lists.lisp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
;; This book is intended to bring in all the rules that are in rule-lists.lisp.
1616
;; See also rules-in-rule-lists-jvm.lisp.
1717

18+
(include-book "kestrel/utilities/if" :dir :system)
1819
(include-book "kestrel/arithmetic-light/mod2" :dir :system)
1920
(include-book "basic-rules")
2021
(include-book "if-rules")

books/kestrel/axe/tactic-prover.lisp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@
4646
(include-book "kestrel/bv/unsigned-byte-p-forced-rules" :dir :system)
4747
(include-book "bv-rules-axe0")
4848
(include-book "bv-rules-axe")
49+
(include-book "basic-rules")
50+
(include-book "arithmetic-rules-axe")
4951
(include-book "bv-array-rules-axe") ; not all are needed, but we need integerp-of-bv-array-read
5052
(include-book "bv-intro-rules")
5153
(include-book "kestrel/bv-lists/bv-array-read-rules" :dir :system) ; for UNSIGNED-BYTE-P-FORCED-OF-BV-ARRAY-READ

0 commit comments

Comments
 (0)