fact
stringlengths
6
30.1k
type
stringclasses
2 values
library
stringclasses
46 values
imports
listlengths
0
156
filename
stringlengths
12
117
symbolic_name
stringlengths
1
145
docstring
stringclasses
1 value
pos-induction-scheme : t :rule-classes ((:induction :pattern (integerp x) :condition (and (integerp x) (>= x 1)) :scheme (pos-ind x))))
theorem
acl2s
[ "defdata/top", "tau/bounders/elementary-bounders", "definec", "acl2s/ccg/ccg", "arithmetic-5/lib/basic-ops/simple-equalities-and-inequalities", "arithmetic-5/lib/basic-ops/simplify", "arithmetic-5/lib/basic-ops/building-blocks", "arithmetic-5/lib/floor-mod/floor-mod", "arithmetic-5/top", "rtl/rel1...
acl2s/base-arithmetic.lisp
pos-induction-scheme
int-induction-scheme : t :rule-classes ((:induction :pattern (integerp x) :condition (integerp x) :scheme (int-ind x)))) ; The above induction schemes maybe useful in certain cases, but they ; also tend to cause ACL2 to pick the "wrong" induction schemes, so ; they are off by default. (in-theory (disable nat-induction-...
theorem
acl2s
[ "defdata/top", "tau/bounders/elementary-bounders", "definec", "acl2s/ccg/ccg", "arithmetic-5/lib/basic-ops/simple-equalities-and-inequalities", "arithmetic-5/lib/basic-ops/simplify", "arithmetic-5/lib/basic-ops/building-blocks", "arithmetic-5/lib/floor-mod/floor-mod", "arithmetic-5/top", "rtl/rel1...
acl2s/base-arithmetic.lisp
int-induction-scheme
cancel- : <-+-1 (equal (< (+ a b) a) (< b 0)))
theorem
acl2s
[ "defdata/top", "tau/bounders/elementary-bounders", "definec", "acl2s/ccg/ccg", "arithmetic-5/lib/basic-ops/simple-equalities-and-inequalities", "arithmetic-5/lib/basic-ops/simplify", "arithmetic-5/lib/basic-ops/building-blocks", "arithmetic-5/lib/floor-mod/floor-mod", "arithmetic-5/top", "rtl/rel1...
acl2s/base-arithmetic.lisp
cancel-
cancel- : <-+-2 (equal (< a (+ a b)) (< 0 b)))
theorem
acl2s
[ "defdata/top", "tau/bounders/elementary-bounders", "definec", "acl2s/ccg/ccg", "arithmetic-5/lib/basic-ops/simple-equalities-and-inequalities", "arithmetic-5/lib/basic-ops/simplify", "arithmetic-5/lib/basic-ops/building-blocks", "arithmetic-5/lib/floor-mod/floor-mod", "arithmetic-5/top", "rtl/rel1...
acl2s/base-arithmetic.lisp
cancel-
cancel- : <-*-1 (implies (and (acl2-numberp a) (< 0 a) (rationalp b)) (equal (< (* a b) a) (< b 1))) :rule-classes ((:rewrite :backchain-limit-lst 1)))
theorem
acl2s
[ "defdata/top", "tau/bounders/elementary-bounders", "definec", "acl2s/ccg/ccg", "arithmetic-5/lib/basic-ops/simple-equalities-and-inequalities", "arithmetic-5/lib/basic-ops/simplify", "arithmetic-5/lib/basic-ops/building-blocks", "arithmetic-5/lib/floor-mod/floor-mod", "arithmetic-5/top", "rtl/rel1...
acl2s/base-arithmetic.lisp
cancel-
cancel- : <-*-2 (implies (and (acl2-numberp a) (< 0 a) (rationalp b)) (equal (< a (* a b)) (< 1 b))) :rule-classes ((:rewrite :backchain-limit-lst 1)))
theorem
acl2s
[ "defdata/top", "tau/bounders/elementary-bounders", "definec", "acl2s/ccg/ccg", "arithmetic-5/lib/basic-ops/simple-equalities-and-inequalities", "arithmetic-5/lib/basic-ops/simplify", "arithmetic-5/lib/basic-ops/building-blocks", "arithmetic-5/lib/floor-mod/floor-mod", "arithmetic-5/top", "rtl/rel1...
acl2s/base-arithmetic.lisp
cancel-
numerator-n-decreases : (implies (and (rationalp r) (<= n r) (integerp n) (< 0 n)) (< (numerator (+ (- n) r)) (numerator r))) :hints (("goal" :induct (pos-ind n)) ("subgoal *1/2.2" :use ((:instance numerator-1-decreases (n (+ r (- n) 1)))))) :rule-classes ((:linear) (:rewrite)))
theorem
acl2s
[ "defdata/top", "tau/bounders/elementary-bounders", "definec", "acl2s/ccg/ccg", "arithmetic-5/lib/basic-ops/simple-equalities-and-inequalities", "arithmetic-5/lib/basic-ops/simplify", "arithmetic-5/lib/basic-ops/building-blocks", "arithmetic-5/lib/floor-mod/floor-mod", "arithmetic-5/top", "rtl/rel1...
acl2s/base-arithmetic.lisp
numerator-n-decreases
replace-o : <-with-< (implies (and (natp x) (natp y)) (equal (o< x y) (< x y))) :hints (("goal" :in-theory (enable o<))) :rule-classes ((:rewrite :backchain-limit-lst 2))) (encapsulate () (local
theorem
acl2s
[ "defdata/top", "tau/bounders/elementary-bounders", "definec", "acl2s/ccg/ccg", "arithmetic-5/lib/basic-ops/simple-equalities-and-inequalities", "arithmetic-5/lib/basic-ops/simplify", "arithmetic-5/lib/basic-ops/building-blocks", "arithmetic-5/lib/floor-mod/floor-mod", "arithmetic-5/top", "rtl/rel1...
acl2s/base-arithmetic.lisp
replace-o
mul-frac-1 : (implies (and (rationalp a) (rationalp b) (rationalp c) (pos-rationalp d) (< a (* b (/ c d)))) (< (* d a) (* d (* b (/ c d))))))) (local
theorem
acl2s
[ "defdata/top", "tau/bounders/elementary-bounders", "definec", "acl2s/ccg/ccg", "arithmetic-5/lib/basic-ops/simple-equalities-and-inequalities", "arithmetic-5/lib/basic-ops/simplify", "arithmetic-5/lib/basic-ops/building-blocks", "arithmetic-5/lib/floor-mod/floor-mod", "arithmetic-5/top", "rtl/rel1...
acl2s/base-arithmetic.lisp
mul-frac-1
mul-frac-2 : (implies (and (rationalp a) (rationalp c) (pos-rationalp b) (pos-rationalp d) (< a (/ (* c b) d))) (< (/ a b) (/ (/ (* c b) d) b))))) (local
theorem
acl2s
[ "defdata/top", "tau/bounders/elementary-bounders", "definec", "acl2s/ccg/ccg", "arithmetic-5/lib/basic-ops/simple-equalities-and-inequalities", "arithmetic-5/lib/basic-ops/simplify", "arithmetic-5/lib/basic-ops/building-blocks", "arithmetic-5/lib/floor-mod/floor-mod", "arithmetic-5/top", "rtl/rel1...
acl2s/base-arithmetic.lisp
mul-frac-2
mul-frac-3 : (implies (and (rationalp a) (rationalp b) (rationalp c) (neg-rationalp d) (< a (* b (/ c d)))) (> (* d a) (* d (* b (/ c d))))))) (local
theorem
acl2s
[ "defdata/top", "tau/bounders/elementary-bounders", "definec", "acl2s/ccg/ccg", "arithmetic-5/lib/basic-ops/simple-equalities-and-inequalities", "arithmetic-5/lib/basic-ops/simplify", "arithmetic-5/lib/basic-ops/building-blocks", "arithmetic-5/lib/floor-mod/floor-mod", "arithmetic-5/top", "rtl/rel1...
acl2s/base-arithmetic.lisp
mul-frac-3
mul-frac-4 : (implies (and (rationalp a) (rationalp c) (neg-rationalp b) (non-0-rationalp d) (< a (/ (* c b) d))) (> (/ a b) (/ (/ (* c b) d) b)))))
theorem
acl2s
[ "defdata/top", "tau/bounders/elementary-bounders", "definec", "acl2s/ccg/ccg", "arithmetic-5/lib/basic-ops/simple-equalities-and-inequalities", "arithmetic-5/lib/basic-ops/simplify", "arithmetic-5/lib/basic-ops/building-blocks", "arithmetic-5/lib/floor-mod/floor-mod", "arithmetic-5/top", "rtl/rel1...
acl2s/base-arithmetic.lisp
mul-frac-4
multiply- : <-fractions (implies (and (rationalp a) (rationalp c) (non-0-rationalp b) (non-0-rationalp d) (< 0 (* b d))) (equal (< (* a (/ b)) (* c (/ d))) (< (* a d) (* c b)))) :hints (("Goal" :use (mul-frac-1 mul-frac-2 mul-frac-3 mul-frac-4)))) (local
theorem
acl2s
[ "defdata/top", "tau/bounders/elementary-bounders", "definec", "acl2s/ccg/ccg", "arithmetic-5/lib/basic-ops/simple-equalities-and-inequalities", "arithmetic-5/lib/basic-ops/simplify", "arithmetic-5/lib/basic-ops/building-blocks", "arithmetic-5/lib/floor-mod/floor-mod", "arithmetic-5/top", "rtl/rel1...
acl2s/base-arithmetic.lisp
multiply-
l1 : (implies (and (rationalp a) (rationalp b) (non-0-rationalp x)) (equal (equal (* x a) (* x b)) (equal a b)))))
theorem
acl2s
[ "defdata/top", "tau/bounders/elementary-bounders", "definec", "acl2s/ccg/ccg", "arithmetic-5/lib/basic-ops/simple-equalities-and-inequalities", "arithmetic-5/lib/basic-ops/simplify", "arithmetic-5/lib/basic-ops/building-blocks", "arithmetic-5/lib/floor-mod/floor-mod", "arithmetic-5/top", "rtl/rel1...
acl2s/base-arithmetic.lisp
l1
multiply- : =-fractions (implies (and (rationalp a) (rationalp c) (non-0-rationalp b) (non-0-rationalp d)) (equal (equal (* a (/ b)) (* c (/ d))) (equal (* a d) (* c b)))) :hints (("Goal" :use (:instance l1 (x d) (b (* b (/ c d)))))))) ; The following is a proof of EWD-1297 and is included as a test (encapsulate () (lo...
theorem
acl2s
[ "defdata/top", "tau/bounders/elementary-bounders", "definec", "acl2s/ccg/ccg", "arithmetic-5/lib/basic-ops/simple-equalities-and-inequalities", "arithmetic-5/lib/basic-ops/simplify", "arithmetic-5/lib/basic-ops/building-blocks", "arithmetic-5/lib/floor-mod/floor-mod", "arithmetic-5/top", "rtl/rel1...
acl2s/base-arithmetic.lisp
multiply-
mod-plus-simplify-a : <n-+b (implies (and (non-neg-rationalp a) (< a n)) (equal (equal (+ a (mod b n)) b) (and (equal a 0) (equal (mod b n) b)))) :hints (("goal" :cases ((rationalp n)))))
theorem
acl2s
[ "defdata/top", "tau/bounders/elementary-bounders", "definec", "acl2s/ccg/ccg", "arithmetic-5/lib/basic-ops/simple-equalities-and-inequalities", "arithmetic-5/lib/basic-ops/simplify", "arithmetic-5/lib/basic-ops/building-blocks", "arithmetic-5/lib/floor-mod/floor-mod", "arithmetic-5/top", "rtl/rel1...
acl2s/base-arithmetic.lisp
mod-plus-simplify-a
mod-plus-simplify-b : <n-+b (implies (and (acl2-numberp a) (non-neg-rationalp b) (< b n)) (equal (equal (+ a (mod b n)) b) (equal a 0))))
theorem
acl2s
[ "defdata/top", "tau/bounders/elementary-bounders", "definec", "acl2s/ccg/ccg", "arithmetic-5/lib/basic-ops/simple-equalities-and-inequalities", "arithmetic-5/lib/basic-ops/simplify", "arithmetic-5/lib/basic-ops/building-blocks", "arithmetic-5/lib/floor-mod/floor-mod", "arithmetic-5/top", "rtl/rel1...
acl2s/base-arithmetic.lisp
mod-plus-simplify-b
mod-plus-simplify-a : <n-+b+n (implies (and (non-neg-rationalp a) (< a n)) (equal (equal (+ a (mod b n)) (+ n b)) (and (equal a 0) (< b 0) (equal (mod b n) (+ b n))))))
theorem
acl2s
[ "defdata/top", "tau/bounders/elementary-bounders", "definec", "acl2s/ccg/ccg", "arithmetic-5/lib/basic-ops/simple-equalities-and-inequalities", "arithmetic-5/lib/basic-ops/simplify", "arithmetic-5/lib/basic-ops/building-blocks", "arithmetic-5/lib/floor-mod/floor-mod", "arithmetic-5/top", "rtl/rel1...
acl2s/base-arithmetic.lisp
mod-plus-simplify-a
mod-plus-simplify-b : <n-+b+n (implies (and (non-neg-rationalp b) (< b n)) (equal (equal (+ a (mod b n)) (+ n b)) (or (and (equal a 0) (< b 0) (equal (mod b n) (+ b n))) (and (equal a n) (<= 0 b) (equal (mod b n) b))))))
theorem
acl2s
[ "defdata/top", "tau/bounders/elementary-bounders", "definec", "acl2s/ccg/ccg", "arithmetic-5/lib/basic-ops/simple-equalities-and-inequalities", "arithmetic-5/lib/basic-ops/simplify", "arithmetic-5/lib/basic-ops/building-blocks", "arithmetic-5/lib/floor-mod/floor-mod", "arithmetic-5/top", "rtl/rel1...
acl2s/base-arithmetic.lisp
mod-plus-simplify-b
odd-times-odd-is-odd : (implies (and (integerp n) (integerp m)) (equal (integerp (* 1/2 n m)) (or (integerp (* 1/2 n)) (integerp (* 1/2 m))))) :hints (("goal" :induct (int-ind m))))
theorem
acl2s
[ "defdata/top", "tau/bounders/elementary-bounders", "definec", "acl2s/ccg/ccg", "arithmetic-5/lib/basic-ops/simple-equalities-and-inequalities", "arithmetic-5/lib/basic-ops/simplify", "arithmetic-5/lib/basic-ops/building-blocks", "arithmetic-5/lib/floor-mod/floor-mod", "arithmetic-5/top", "rtl/rel1...
acl2s/base-arithmetic.lisp
odd-times-odd-is-odd
expt-n-m-even-if-n-even : (implies (and (integerp n) (integerp m) (< 0 m)) (equal (integerp (* 1/2 (expt n m))) (integerp (* 1/2 n)))) :hints (("goal" :induct (nat-ind m)) ("subgoal *1/2.2" :in-theory (disable acl2::normalize-factors-gather-exponents) :expand ((expt n m))) ("subgoal *1/2.1" :in-theory (disable acl2::no...
theorem
acl2s
[ "defdata/top", "tau/bounders/elementary-bounders", "definec", "acl2s/ccg/ccg", "arithmetic-5/lib/basic-ops/simple-equalities-and-inequalities", "arithmetic-5/lib/basic-ops/simplify", "arithmetic-5/lib/basic-ops/building-blocks", "arithmetic-5/lib/floor-mod/floor-mod", "arithmetic-5/top", "rtl/rel1...
acl2s/base-arithmetic.lisp
expt-n-m-even-if-n-even
my-nonlinearp-default-hint (stable-under-simplificationp hist pspv) :
function
acl2s
[ "defdata/top", "tau/bounders/elementary-bounders", "definec", "acl2s/ccg/ccg", "arithmetic-5/lib/basic-ops/simple-equalities-and-inequalities", "arithmetic-5/lib/basic-ops/simplify", "arithmetic-5/lib/basic-ops/building-blocks", "arithmetic-5/lib/floor-mod/floor-mod", "arithmetic-5/top", "rtl/rel1...
acl2s/base-arithmetic.lisp
my-nonlinearp-default-hint
app-assoc : (implies (and (tlp x) (tlp y) (tlp z)) (equal (app (app x y) z) (app x (app y z)))))
theorem
acl2s
[ "defdata/top", "std/lists/top", "definec", "check-equal", "acl2s/ccg/ccg" ]
acl2s/base-lists.lisp
app-assoc
app-nil : (implies (tlp x) (equal (app x nil) x)))
theorem
acl2s
[ "defdata/top", "std/lists/top", "definec", "check-equal", "acl2s/ccg/ccg" ]
acl2s/base-lists.lisp
app-nil
app-of-cons : (implies (and (tlp x) (tlp y)) (equal (app (cons a x) y) (cons a (app x y)))))
theorem
acl2s
[ "defdata/top", "std/lists/top", "definec", "check-equal", "acl2s/ccg/ccg" ]
acl2s/base-lists.lisp
app-of-cons
app-of-rcons : (implies (and (tlp x) (tlp y)) (equal (app (acl2::rcons a x) y) (app x (cons a y)))) :hints (("goal" :in-theory (enable acl2::rcons))))
theorem
acl2s
[ "defdata/top", "std/lists/top", "definec", "check-equal", "acl2s/ccg/ccg" ]
acl2s/base-lists.lisp
app-of-rcons
app-under-iff : (implies (and (tlp x) (tlp y)) (iff (app x y) (or x y))))
theorem
acl2s
[ "defdata/top", "std/lists/top", "definec", "check-equal", "acl2s/ccg/ccg" ]
acl2s/base-lists.lisp
app-under-iff
app-of-repeat-to-cons-of-same : (implies (tlp x) (equal (app (repeat n a) (cons a x)) (cons a (app (repeat n a) x)))) :hints (("goal" :in-theory (enable repeat))))
theorem
acl2s
[ "defdata/top", "std/lists/top", "definec", "check-equal", "acl2s/ccg/ccg" ]
acl2s/base-lists.lisp
app-of-repeat-to-cons-of-same
app-when-prefixp : (implies (and (tlp x) (tlp y) (acl2::prefixp x y)) (equal (app x (nthcdr (len x) y)) y)) :hints (("goal" :in-theory (enable acl2::prefixp))))
theorem
acl2s
[ "defdata/top", "std/lists/top", "definec", "check-equal", "acl2s/ccg/ccg" ]
acl2s/base-lists.lisp
app-when-prefixp
app-of-take-and-nthcdr : (implies (and (tlp x) (<= (nfix n) (len x))) (equal (app (take n x) (nthcdr n x)) x))) ; shorthand for equal
theorem
acl2s
[ "defdata/top", "std/lists/top", "definec", "check-equal", "acl2s/ccg/ccg" ]
acl2s/base-lists.lisp
app-of-take-and-nthcdr
expand-len-with-trigger-cdr : (implies (and (<= c (len x)) (posp c)) (<= (1- c) (len (cdr x)))) :rule-classes ((:forward-chaining :trigger-terms ((< (len x) c) (cdr x)))))
theorem
acl2s
[ "defdata/top", "std/lists/top", "definec", "check-equal", "acl2s/ccg/ccg" ]
acl2s/base-lists.lisp
expand-len-with-trigger-cdr
len-non-nil-with-trigger-cdr : (implies (and (<= c (len x)) (posp c)) x) :rule-classes ((:forward-chaining :trigger-terms ((< (len x) c))))) #| This may be useful. I started with this, but used the above rule instead.
theorem
acl2s
[ "defdata/top", "std/lists/top", "definec", "check-equal", "acl2s/ccg/ccg" ]
acl2s/base-lists.lisp
len-non-nil-with-trigger-cdr
exp-len1 : (implies (and (syntaxp (quotep c)) (syntaxp (< (second c) 100)) (posp c) (<= c (len x))) (<= (1- c) (len (cdr x)))) :rule-classes ((:forward-chaining :trigger-terms ((< (len x) c)))))
theorem
acl2s
[ "defdata/top", "std/lists/top", "definec", "check-equal", "acl2s/ccg/ccg" ]
acl2s/base-lists.lisp
exp-len1
exp-len2 : (implies (and (syntaxp (quotep c)) (syntaxp (< (second c) 100)) (posp c) (<= c (len x))) x) :rule-classes ((:forward-chaining :trigger-terms ((< (len x) c))))) |# #| A collection of forward-chaining rules that help with reasoning about conses with car, cdr, head, tail, left, right. |#
theorem
acl2s
[ "defdata/top", "std/lists/top", "definec", "check-equal", "acl2s/ccg/ccg" ]
acl2s/base-lists.lisp
exp-len2
cddr-implies-cdr-trigger-cddr : (implies (cddr x) (cdr x)) :rule-classes ((:forward-chaining :trigger-terms ((cddr x)))))
theorem
acl2s
[ "defdata/top", "std/lists/top", "definec", "check-equal", "acl2s/ccg/ccg" ]
acl2s/base-lists.lisp
cddr-implies-cdr-trigger-cddr
tlp-implies-tlpcdr-trigger-cdr : (implies (true-listp x) (true-listp (cdr x))) :rule-classes ((:forward-chaining :trigger-terms ((cdr x)))))
theorem
acl2s
[ "defdata/top", "std/lists/top", "definec", "check-equal", "acl2s/ccg/ccg" ]
acl2s/base-lists.lisp
tlp-implies-tlpcdr-trigger-cdr
tlp-consp-cdr-implies-tail-trigger-tail : (implies (and (true-listp x) (consp (cdr x))) (tail x)) :rule-classes ((:forward-chaining :trigger-terms ((tail x)))))
theorem
acl2s
[ "defdata/top", "std/lists/top", "definec", "check-equal", "acl2s/ccg/ccg" ]
acl2s/base-lists.lisp
tlp-consp-cdr-implies-tail-trigger-tail
tlp-consp-implies-tlp-tail-trigger-tail : (implies (and (true-listp x) x) (true-listp (tail x))) :rule-classes ((:forward-chaining :trigger-terms ((tail x)))))
theorem
acl2s
[ "defdata/top", "std/lists/top", "definec", "check-equal", "acl2s/ccg/ccg" ]
acl2s/base-lists.lisp
tlp-consp-implies-tlp-tail-trigger-tail
consp-cdr-implies-right-trigger-right : (implies (consp (cdr x)) (right x)) :rule-classes ((:forward-chaining :trigger-terms ((right x)))))
theorem
acl2s
[ "defdata/top", "std/lists/top", "definec", "check-equal", "acl2s/ccg/ccg" ]
acl2s/base-lists.lisp
consp-cdr-implies-right-trigger-right
tlp-consp-implies-tlp-right-trigger-right : (implies (and (true-listp x) x) (true-listp (right x))) :rule-classes ((:forward-chaining :trigger-terms ((right x))))) ; Basic left-right theorems
theorem
acl2s
[ "defdata/top", "std/lists/top", "definec", "check-equal", "acl2s/ccg/ccg" ]
acl2s/base-lists.lisp
tlp-consp-implies-tlp-right-trigger-right
left-cons : (equal (left (cons x y)) x))
theorem
acl2s
[ "defdata/top", "std/lists/top", "definec", "check-equal", "acl2s/ccg/ccg" ]
acl2s/base-lists.lisp
left-cons
right-cons : (equal (right (cons x y)) y))
theorem
acl2s
[ "defdata/top", "std/lists/top", "definec", "check-equal", "acl2s/ccg/ccg" ]
acl2s/base-lists.lisp
right-cons
left-consp : (implies (force (consp x)) (equal (left x) (car x))))
theorem
acl2s
[ "defdata/top", "std/lists/top", "definec", "check-equal", "acl2s/ccg/ccg" ]
acl2s/base-lists.lisp
left-consp
right-consp : (implies (force (consp x)) (equal (right x) (cdr x)))) ; Basic head-tail theorems
theorem
acl2s
[ "defdata/top", "std/lists/top", "definec", "check-equal", "acl2s/ccg/ccg" ]
acl2s/base-lists.lisp
right-consp
head-cons : (implies (force (tlp y)) (equal (head (cons x y)) x)))
theorem
acl2s
[ "defdata/top", "std/lists/top", "definec", "check-equal", "acl2s/ccg/ccg" ]
acl2s/base-lists.lisp
head-cons
tail-cons : (implies (force (tlp y)) (equal (tail (cons x y)) y)))
theorem
acl2s
[ "defdata/top", "std/lists/top", "definec", "check-equal", "acl2s/ccg/ccg" ]
acl2s/base-lists.lisp
tail-cons
head-consp : (implies (and (force (tlp x)) (force x)) (equal (head x) (car x))))
theorem
acl2s
[ "defdata/top", "std/lists/top", "definec", "check-equal", "acl2s/ccg/ccg" ]
acl2s/base-lists.lisp
head-consp
tail-consp : (implies (and (force (tlp x)) (force x)) (equal (tail x) (cdr x)))) ; Disable tail, head, left, right so that it is easier to debug ; proofs (in-theory (disable tail tail-definition-rule head head-definition-rule left left-definition-rule right right-definition-rule)) #|| Suppose I want to define a datatyp...
theorem
acl2s
[ "defdata/top", "std/lists/top", "definec", "check-equal", "acl2s/ccg/ccg" ]
acl2s/base-lists.lisp
tail-consp
app-of-snoc : (implies (and (tlp x) (tlp y)) (equal (app (snoc x a) y) (app x (cons a y)))))
theorem
acl2s
[ "defdata/top", "std/lists/top", "definec", "check-equal", "acl2s/ccg/ccg" ]
acl2s/base-lists.lisp
app-of-snoc
len-of-app : (implies (and (tlp x) (tlp y)) (equal (len (app x y)) (+ (len x) (len y)))))
theorem
acl2s
[ "defdata/top", "std/lists/top", "definec", "check-equal", "acl2s/ccg/ccg" ]
acl2s/base-lists.lisp
len-of-app
fcheck (form state) : (declare (xargs :mode :program :stobjs (state))) (b* (((er res) (with-output! :on error (trans-eval form 'check state t))) ((when (not (equal (cdr res) t))) (prog2$ (cw "~%ACL2s Error in CHECK: The form evaluates to: ~x0, not T!~%" (cdr res)) (mv t nil state)))) (value '(value-triple :passed))))
function
acl2s
[ "std/util/bstar" ]
acl2s/check-equal.lisp
fcheck
cons-size-type : (natp (cons-size x)) :rule-classes ((:type-prescription) (:forward-chaining :trigger-terms ((cons-size x)))))
theorem
acl2s
[ "std/lists/top", "std/alists/top", "std/strings/top", "acl2s/defdata/records" ]
acl2s/cons-size.lisp
cons-size-type
acons-cons-size-lemma : (= (cons-size (acons x1 x2 x3)) (+ 2 (cons-size x1) (cons-size x2) (cons-size x3))) :rule-classes ((:linear) (:rewrite)))
theorem
acl2s
[ "std/lists/top", "std/alists/top", "std/strings/top", "acl2s/defdata/records" ]
acl2s/cons-size.lisp
acons-cons-size-lemma
split-list-1-cons-size : (implies (consp x) (< (cons-size (mv-nth 1 (str::split-list-1 x str::del))) (cons-size x))) :hints (("Goal" :in-theory (enable str::split-list-1))) :rule-classes :linear)
theorem
acl2s
[ "std/lists/top", "std/alists/top", "std/strings/top", "acl2s/defdata/records" ]
acl2s/cons-size.lisp
split-list-1-cons-size
head-cons-size : (implies (not (set::emptyp x)) (< (cons-size (set::head x)) (cons-size x))) :hints (("Goal" :in-theory (enable set::emptyp set::head))) :rule-classes :linear)
theorem
acl2s
[ "std/lists/top", "std/alists/top", "std/strings/top", "acl2s/defdata/records" ]
acl2s/cons-size.lisp
head-cons-size
tail-cons-size : (implies (not (set::emptyp x)) (< (cons-size (set::tail x)) (cons-size x))) :hints (("Goal" :in-theory (enable set::emptyp set::tail))) :rule-classes :linear)
theorem
acl2s
[ "std/lists/top", "std/alists/top", "std/strings/top", "acl2s/defdata/records" ]
acl2s/cons-size.lisp
tail-cons-size
cons-size-append : (= (cons-size (append x y)) (+ (cons-size x) (cons-size y))) :rule-classes ((:linear) (:rewrite)))
theorem
acl2s
[ "std/lists/top", "std/alists/top", "std/strings/top", "acl2s/defdata/records" ]
acl2s/cons-size.lisp
cons-size-append
rev-cons-size-lemma : (= (cons-size (rev x)) (cons-size x)) :hints (("Goal" :in-theory (enable rev))) :rule-classes ((:linear) (:rewrite)))
theorem
acl2s
[ "std/lists/top", "std/alists/top", "std/strings/top", "acl2s/defdata/records" ]
acl2s/cons-size.lisp
rev-cons-size-lemma
cons-size-evens-strong : (implies (and (consp x) (consp (cdr x))) (< (cons-size (evens x)) (cons-size x))) :rule-classes :linear)
theorem
acl2s
[ "std/lists/top", "std/alists/top", "std/strings/top", "acl2s/defdata/records" ]
acl2s/cons-size.lisp
cons-size-evens-strong
cons-size-evens-weak : (<= (cons-size (evens x)) (cons-size x)) :hints (("Goal" :induct (evens x))) :rule-classes :linear)
theorem
acl2s
[ "std/lists/top", "std/alists/top", "std/strings/top", "acl2s/defdata/records" ]
acl2s/cons-size.lisp
cons-size-evens-weak
cons-size-of-remove-assoc-equal-upper-bound : (<= (cons-size (remove-assoc-equal a x)) (cons-size x)) :hints (("Goal" :in-theory (enable remove-assoc-equal))) :rule-classes :linear)
theorem
acl2s
[ "std/lists/top", "std/alists/top", "std/strings/top", "acl2s/defdata/records" ]
acl2s/cons-size.lisp
cons-size-of-remove-assoc-equal-upper-bound
cons-size-when-member : (implies (member-equal a x) (< (cons-size a) (cons-size x))) :hints (("Goal" :in-theory (enable member-equal))) :rule-classes :linear)
theorem
acl2s
[ "std/lists/top", "std/alists/top", "std/strings/top", "acl2s/defdata/records" ]
acl2s/cons-size.lisp
cons-size-when-member
cons-size-of-remove-duplicates : (<= (cons-size (remove-duplicates-equal x)) (cons-size x)) :rule-classes :linear)
theorem
acl2s
[ "std/lists/top", "std/alists/top", "std/strings/top", "acl2s/defdata/records" ]
acl2s/cons-size.lisp
cons-size-of-remove-duplicates
cons-size-of-hons-remove-duplicates : (<= (cons-size (acl2::hons-remove-duplicates x)) (cons-size x)) :hints (("Goal" :in-theory (enable acl2::hons-remove-duplicates))) :rule-classes :linear)
theorem
acl2s
[ "std/lists/top", "std/alists/top", "std/strings/top", "acl2s/defdata/records" ]
acl2s/cons-size.lisp
cons-size-of-hons-remove-duplicates
cons-size-of-nthcdr-linear : (implies (and (not (zp n)) (consp x)) (< (cons-size (nthcdr n x)) (cons-size x))) :hints (("Goal" :in-theory (enable nthcdr))) :rule-classes :linear)
theorem
acl2s
[ "std/lists/top", "std/alists/top", "std/strings/top", "acl2s/defdata/records" ]
acl2s/cons-size.lisp
cons-size-of-nthcdr-linear
cons-size-of-nthcdr-linear-weak : (<= (cons-size (nthcdr n x)) (cons-size x)) :hints (("Goal" :in-theory (enable nthcdr))) :rule-classes :linear)
theorem
acl2s
[ "std/lists/top", "std/alists/top", "std/strings/top", "acl2s/defdata/records" ]
acl2s/cons-size.lisp
cons-size-of-nthcdr-linear-weak
cons-size-of-nth-linear-weak : (<= (cons-size (nth i x)) (cons-size x)) :rule-classes :linear)
theorem
acl2s
[ "std/lists/top", "std/alists/top", "std/strings/top", "acl2s/defdata/records" ]
acl2s/cons-size.lisp
cons-size-of-nth-linear-weak
cons-size-of-nth-linear : (implies (consp x) (< (cons-size (nth i x)) (cons-size x))) :rule-classes :linear)
theorem
acl2s
[ "std/lists/top", "std/alists/top", "std/strings/top", "acl2s/defdata/records" ]
acl2s/cons-size.lisp
cons-size-of-nth-linear
cons-size-of-prod-cons1 : (<= (cons-size std::y) (cons-size (std::prod-cons std::x std::y))) :rule-classes :linear)
theorem
acl2s
[ "std/lists/top", "std/alists/top", "std/strings/top", "acl2s/defdata/records" ]
acl2s/cons-size.lisp
cons-size-of-prod-cons1
cons-size-of-prod-cons2 : (<= (cons-size std::x) (cons-size (std::prod-cons std::x std::y))) :rule-classes :linear)
theorem
acl2s
[ "std/lists/top", "std/alists/top", "std/strings/top", "acl2s/defdata/records" ]
acl2s/cons-size.lisp
cons-size-of-prod-cons2
records-cons-size-linear-arith- : <= (<= (cons-size (mget k r)) (cons-size r)) :hints (("goal" :in-theory (enable mget recordp no-nil-val-alistp ordered-unique-key-alistp))) :rule-classes :linear)
theorem
acl2s
[ "std/lists/top", "std/alists/top", "std/strings/top", "acl2s/defdata/records" ]
acl2s/cons-size.lisp
records-cons-size-linear-arith-
records-cons-size-linear-arith- : < (implies (mget k r) (< (cons-size (mget k r)) (cons-size r))) :hints (("goal" :in-theory (enable mget recordp no-nil-val-alistp ordered-unique-key-alistp))) :rule-classes :linear)
theorem
acl2s
[ "std/lists/top", "std/alists/top", "std/strings/top", "acl2s/defdata/records" ]
acl2s/cons-size.lisp
records-cons-size-linear-arith-
records-cons-size : (implies (consp r) (< (cons-size (mget k r)) (cons-size r))) :hints (("goal" :in-theory (enable mget recordp no-nil-val-alistp ordered-unique-key-alistp))) :rule-classes :linear)
theorem
acl2s
[ "std/lists/top", "std/alists/top", "std/strings/top", "acl2s/defdata/records" ]
acl2s/cons-size.lisp
records-cons-size
len- : <=-cons-size (<= (len x) (cons-size x)) :rule-classes :linear)
theorem
acl2s
[ "std/lists/top", "std/alists/top", "std/strings/top", "acl2s/defdata/records" ]
acl2s/cons-size.lisp
len-
cons-size- : <=-acl2-count (<= (cons-size x) (acl2-count x)) :rule-classes :linear) ; This shows that cons-size can be used to prove termination of ; acl2-count (which is what acl2-size is).
theorem
acl2s
[ "std/lists/top", "std/alists/top", "std/strings/top", "acl2s/defdata/records" ]
acl2s/cons-size.lisp
cons-size-
cons-size (x) : (declare (xargs :guard t)) (if (consp x) (+ 1 (cons-size (car x)) (cons-size (cdr x))) 0))
function
acl2s
[ "std/lists/top", "std/alists/top", "std/strings/top", "acl2s/defdata/records" ]
acl2s/cons-size.lisp
cons-size
acl2-size (x) : (declare (xargs :guard t :measure (if (and (not (rationalp x)) (complex/complex-rationalp x)) 1 (* 2 (cons-size x))))) (if (consp x) (+ 1 (acl2-size (car x)) (acl2-size (cdr x))) (if (rationalp x) (if (integerp x) (integer-abs x) (+ (integer-abs (numerator x)) (denominator x))) (if (complex/complex-rati...
function
acl2s
[ "std/lists/top", "std/alists/top", "std/strings/top", "acl2s/defdata/records" ]
acl2s/cons-size.lisp
acl2-size
allp (x) :
function
acl2s
[ "cgen/top", "definec", "defintrange", "acl2s-sigs", "acl2s/installation", "acl2s/extra-doc", "acl2s/interface/top" ]
acl2s/custom.lisp
allp
defunt-make-sym (s suf) : ; Returns the symbol s-suf. (declare (xargs :guard (and (symbolp s) (symbolp suf)))) (fix-intern-in-pkg-of-sym (concatenate 'string (symbol-name s) "-" (symbol-name suf)) s))
function
acl2s
[ "cgen/top", "definec", "defintrange", "acl2s-sigs", "acl2s/installation", "acl2s/extra-doc", "acl2s/interface/top" ]
acl2s/custom.lisp
defunt-make-sym
defunt-make-code-list (l) : (if (or (null l) (and (consp l) (consp (car l)) (not (eq 'lambda (caar l))))) l (list l)))
function
acl2s
[ "cgen/top", "definec", "defintrange", "acl2s-sigs", "acl2s/installation", "acl2s/extra-doc", "acl2s/interface/top" ]
acl2s/custom.lisp
defunt-make-code-list
defunt-declarations-prefix (args) : (if (or (atom args) (atom (car args)) (not (eq 'declare (caar args)))) nil (cons (car args)
function
acl2s
[ "cgen/top", "definec", "defintrange", "acl2s-sigs", "acl2s/installation", "acl2s/extra-doc", "acl2s/interface/top" ]
acl2s/custom.lisp
defunt-declarations-prefix
defunt-after-declarations (args) : (if (or (atom args) (atom (car args)) (not (eq 'declare (caar args)))) args
function
acl2s
[ "cgen/top", "definec", "defintrange", "acl2s-sigs", "acl2s/installation", "acl2s/extra-doc", "acl2s/interface/top" ]
acl2s/custom.lisp
defunt-after-declarations
nth-non-pos-integer-builtin (n) : (declare (xargs :guard (natp n))) (+ 1 n)) This is guaranteed to return a positive integer, so the enumerator will always fail! There were similar problems with other enumerators, so I added this file to test the definitions. Every time we add a new custom data definition to the defdat...
function
acl2s
[ "acl2s/ccg/ccg", "acl2s/base-theory", "acl2s/custom", "acl2s/acl2s-sigs" ]
acl2s/defdata-testing.lisp
nth-non-pos-integer-builtin
nth-complex-rational-builtin (n) :
function
acl2s
[ "acl2s/ccg/ccg", "acl2s/base-theory", "acl2s/custom", "acl2s/acl2s-sigs" ]
acl2s/defdata-testing.lisp
nth-complex-rational-builtin
nth-complex-rational-between (n lo hi) :
function
acl2s
[ "acl2s/ccg/ccg", "acl2s/base-theory", "acl2s/custom", "acl2s/acl2s-sigs" ]
acl2s/defdata-testing.lisp
nth-complex-rational-between
nth-acl2-number-builtin (n) :
function
acl2s
[ "acl2s/ccg/ccg", "acl2s/base-theory", "acl2s/custom", "acl2s/acl2s-sigs" ]
acl2s/defdata-testing.lisp
nth-acl2-number-builtin
nth-acl2-number-between (n lo hi) :
function
acl2s
[ "acl2s/ccg/ccg", "acl2s/base-theory", "acl2s/custom", "acl2s/acl2s-sigs" ]
acl2s/defdata-testing.lisp
nth-acl2-number-between
nth-number-between-fn (n lo hi type) :
function
acl2s
[ "acl2s/ccg/ccg", "acl2s/base-theory", "acl2s/custom", "acl2s/acl2s-sigs" ]
acl2s/defdata-testing.lisp
nth-number-between-fn
zeerop (x) : (declare (xargs :guard t)) (equal x 0))
function
acl2s
[ "acl2s/ccg/ccg", "acl2s/base-theory", "acl2s/custom", "acl2s/acl2s-sigs" ]
acl2s/defdata-testing.lisp
zeerop
zeeerop (x) : (declare (xargs :guard (acl2-numberp x))) (equal x 0)) ; If we then try to define zeerop using the alias route, still fail ; because we try to define zeeerop as a macro (must-fail
function
acl2s
[ "acl2s/ccg/ccg", "acl2s/base-theory", "acl2s/custom", "acl2s/acl2s-sigs" ]
acl2s/defdata-testing.lisp
zeeerop
F-DEFINEC-FC-RULE : (IMPLIES (FORCE (AND (NATP X) (NATP Y))) (NATP (F X Y))) :RULE-CLASSES ((:FORWARD-CHAINING :TRIGGER-TERMS ((F X Y))))) |#
theorem
acl2s
[ "defunc", "xdoc/top" ]
acl2s/definec.lisp
F-DEFINEC-FC-RULE
f-definec-fc-rule : (implies (force (and (natp x) (natp y))) (natp (f x y))) :rule-classes ((:forward-chaining :trigger-terms ((f x y))))) }) <p> Notice that nat was turned into natp. We convert type names into the corresponding predicates using @(see defdata) and we support :all (the type of the ACL2 universe), :tl (t...
theorem
acl2s
[ "defunc", "xdoc/top" ]
acl2s/definec.lisp
f-definec-fc-rule
map-preds (types tbl atbl) : (declare (xargs :guard (and (symbol-listp types) (sym-aalistp tbl) (sym-aalistp atbl)))) (if (endp types) nil (cons (pred-of-type (car types) tbl atbl) (map-preds (rest types) tbl atbl))))
function
acl2s
[ "defunc", "xdoc/top" ]
acl2s/definec.lisp
map-preds
map-intern-type (type pkg) : (declare (xargs :guard (and (symbolp type) (pkgp pkg)))) (if (keywordp type) (fix-intern$ (symbol-name type) pkg) type))
function
acl2s
[ "defunc", "xdoc/top" ]
acl2s/definec.lisp
map-intern-type
map-intern-types (types pkg) : (declare (xargs :guard (and (symbol-listp types) (pkgp pkg)))) (if (endp types) nil (cons (map-intern-type (car types) pkg) (map-intern-types (rest types) pkg))))
function
acl2s
[ "defunc", "xdoc/top" ]
acl2s/definec.lisp
map-intern-types
make-input-contract-aux (args types) : (declare (xargs :guard (and (symbol-listp args) (symbol-listp types)))) (cond ((endp args) nil) ((equal (car types) 'acl2s::allp) (make-input-contract-aux (rest args) (rest types))) (t (cons `(,(car types) ,(car args)) (make-input-contract-aux (rest args) (rest types))))))
function
acl2s
[ "defunc", "xdoc/top" ]
acl2s/definec.lisp
make-input-contract-aux
make-input-contract (args types) : (declare (xargs :guard (and (symbol-listp args) (symbol-listp types)))) (let ((res (make-input-contract-aux args types))) (cond ((endp res) t) ; if res=(), no constraints ((equal (len res) 1) (first res)) (t (cons 'and res))))) #|
function
acl2s
[ "defunc", "xdoc/top" ]
acl2s/definec.lisp
make-input-contract
find-bad-d-arg-types (d-arg-types d-arg-preds) : (cond ((endp d-arg-preds) nil) ((null (car d-arg-preds)) (car d-arg-types)) (t (find-bad-d-arg-types (cdr d-arg-types) (cdr d-arg-preds)))))
function
acl2s
[ "defunc", "xdoc/top" ]
acl2s/definec.lisp
find-bad-d-arg-types
find-next-type (var l acc) : (cond ((endp l) acc) ((keywordp (car l)) (find-next-type var (cdr l) (cons (car l) (cons var acc)))) ((endp acc) (find-next-type var (cdr l) acc)) (t acc))) ; (find-next-type 'x '(:nat y :int) nil) ; (find-next-type 'x '(:nat :int y :int) nil) ; (find-next-type 'x '(u v :nat :int y :int) ni...
function
acl2s
[ "defunc", "xdoc/top" ]
acl2s/definec.lisp
find-next-type
process-typed-args-aux (l acc) : (cond ((endp l) (rev acc)) ((keywordp (car l)) (process-typed-args-aux (cdr l) acc)) (t (process-typed-args-aux (cdr l) (append (find-next-type (car l) (cdr l) nil) acc)))))
function
acl2s
[ "defunc", "xdoc/top" ]
acl2s/definec.lisp
process-typed-args-aux